- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Simulation error
Simulation error
Simulation error
Hi, I developed a simple script to solve an electrical circuit using simple equations on branches and nodes.
Some inizialization problems arose using second order polynomial equations. I tried to fix the error with the hints of the debug on the inizialization but I couldn't find a solution. The run exits with an error code 0xffffffffffffffff, with a message saying that the maximum number of iterations has been done without finding a root.
If anyone has any suggestion, I could use some help
Thank you!
Ale
Re: Simulation error
is it possible to share your code?
- Arinomo23
- 120 Posts
Re: Simulation error
Re: Simulation error
Code:
The initialization problem is inconsistent due to the following equation: 0 != -4.05568 = $START.Pv - Pv
I got the above error. So the problem is with initialization.
Code:
Real Pv(start = 1, fixed = true); // state variable - ventricular pressure
it works when I set fixed to false. But i don't know if the simulation results are correct.
From Modelica by Example
fixed
The fixed attribute changes the way the start attribute is used when the start attribute is used as an initial condition. Normally, the start attribute is considered a “fallback” initial condition and only used if there are insufficient initial conditions explicitly specified in the initial equation sections. However, if the fixed attribute is set to true, then the start attribute is treated as if it was used as an explicit initial equation (i.e., it is no longer used as a fallback, but instead treated as a strict initial condition).
Another, more obscure, use of the fixed attribute is for “computed parameters”. In rare cases where a parameter cannot be initialized explicitly, it is possible to provide a general equation for the parameter in an initial equation section. But in cases where the parameter is initialized in this way, the fixed attribute for the parameter variable must be set to false.
Default: false (except for parameter variables, where it is true by default)
Type: Boolean
- Arinomo23
- 120 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Simulation error