Open HansOlsson opened 1 month ago
(oops - wrong labels, both started on 'd').
Well, the electrical circuit is simple, I can't imagine anything simpler than a resistor connected to an ideal voltage source. The circuit behaviour maybe is not completely trivial because of the dependency of the resistance on the quadratic losses, but the circuit and its behaviour are two different concepts.
Surfing the web I even found "A simple chaotic circuit with a light-emitting diode", so it seems that a simple circuit can even show chaotic behaviour with strange attractors.
Maybe we should include it the Modelica.Electrical examples 😃
@HansOlsson what's the problem with a nonlinear set of algebraic equations? @casella To be honest: The "simple chaotic circuit with a light-emitting diode" is not simple, it consists of 4 OpAmps besides the diode. Anyway, yes we could implement that circuit.
@HansOlsson what's the problem with a nonlinear set of algebraic equations?
There's no problem with the equations. However, if a new user looks at the examples and sees a "very simple" circuit, and think that it will be a good starting point to understand models and then sees algebraic equations, they might be a bit surprised.
@HansOlsson What's easier with an additional ODE?
IMHO the example is simple and demonstrates:
It can even be solved analytically - witt a linear temperature dependency of resistance it leads to a quadratic equation for temperature.
The new user sees a circuit in the diagram layer which is nearly self-explanatory. Looking into the used components, he could obtain the above mentioned (quadratic) equation.
Ok, but even if "simple" could we drop the "very"?
No big deal, feel free to open a PR for that 😃
@HansOlsson yes we can drop the "very". I admit the circuit is simple but not very simple.
@casella here you go: have a preview on the PR. Feel free to comment / change ... I'm not familiar with optoelectronics and chaotic circuits, but I suppose it's a nice test example ;-) Now an ever nicer solution: ChaoticDiodeCircuit.zip For b=1 you can see the same chaotic behavior and for b=1.6 the same periodic behavior as shown in the paper. Hint: In OpenModelica use solver = cvode (works much better than dassl).
The documentation of Modelica.Electrical.Analog.Examples.Resistor says
I don't agree with that. Clearly the model looks simple and the electrical part is in itself simple, but the thermal coupling makes the behavior more complicated:
If you look at the code generated by Dymola you see that there's a non-linear system of equations!
The reason is that the thermal part isn't connected to a heat capacitor as one would naïvely expect, but only to a linear thermal conductor. Since the resistor's resistance depend on temperature we therefore have a non-linear system of equations keeping the loss-power (that is
v*i
orv^2/R(T)
right?) in balance with conducted heat power (G*(T-293.15)
).I see a number of possibilities:
The current model would be limit if we in the second possibility have a an epsilon-heat capacitor and let epsilon go to zero.