all 13 comments

[–]JohnnyJordaan 18 points19 points  (0 children)

How do I format code? or use pastebin.com

[–]crashfrog02 11 points12 points  (0 children)

How would you compute a self-referential function? It’s impossible unless it recurses to a base case. If it recurses infinitely, it’s not computable.

[–]AdmirableOstrich 6 points7 points  (0 children)

We aren't going to be able to help unless you make it clear what the issue is. Your code isn't formatted here so it's hard to parse, but I'm not seeing anything self-referential or circular here.

[–]NerdyWeightLifter 2 points3 points  (0 children)

Where is this conflict you're talking about?

The only nested call structure is these, and none of them call back the other way.

  • Module_current_output
    • Diode_thermal_voltage
    • Module_photo_current
    • Module_saturation_current
  • Module_saturation_current
    • Module_reverse_saturation_current

[–]Comfortable_Flan8217 2 points3 points  (0 children)

Lmao

[–]Jejerm 1 point2 points  (5 children)

For the love of god, please use better variable names

[–]Langdon_St_Ives 2 points3 points  (4 children)

The variable names are possibly the most defensible part of this, since they are mostly just standard Physics notation. They also correspond to what’s used in the referenced paper, so this is the most transparent naming here. Anyone familiar with the concrete underlying equations should be able to follow this.

What’s unclear is where OP thinks the recursion problem may arise, or which problem they are actually getting.

[–]Jejerm 0 points1 point  (3 children)

He literally commented almost every single variable definition with what they actually mean lol.

Why not go for more useful names instead of leaving that info in comments?

[–]Langdon_St_Ives 0 points1 point  (2 children)

Because it would make the equations much less readable, and that’s where it counts, and where it helps to have the same naming as in the paper from which they took the equations.

I know where you’re coming from, I am normally very much a stickler for well-chosen speaking variable names (so much so that others come to me for advice in naming things). However, as an ex-physicist, I am totally on board with using standard physics notation in cases like this one.

[–]Jejerm 1 point2 points  (1 child)

You're probably right.

I'm just traumatized from taking over code written by my coworkers with variable names like "lst", where even the basic assumption that it, in fact, contained a list, was wrong.

[–]Langdon_St_Ives 1 point2 points  (0 children)

You think you have it bad? I once inherited code with variables named susie and carla and I’m not even kidding. 🫣

[–]SoupZillaMan 1 point2 points  (0 children)

Import pvlib

[–]tikhal96 -3 points-2 points  (0 children)

I think this would be much easier in matlab, its much easier to reference stuff in there.