- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Problem using initial equations
Problem using initial equations
Problem using initial equations
Hi,
Please see the follwing model
Code:
model Test
import SI = Modelica.SIunits;
parameter SI.Temperature T;
initial equation
T = (300+400)/2;
end Test;
When I simulate this, I get the following warnings
Code:
[:0:0-0:0] Warning: No system for the symbolic initialization was generated. A method using numerical algorithms will be used instead.
[:0:0-0:0] Warning: It was not possible to solve the over-determined initial system (2 equations and 1 variables)
[:0:0-0:0] Warning: System is over-determined in Equations 1: T = 350.0;
2: T = 288.15;
[:0:0-0:0] Warning: Trying to fix over-determined initial system with 1 variables and 2 equations... [not implemented yet!]
[:3:3-3:29] Warning: Parameter T has no value, and is fixed during initialization (fixed=true), using available start value (start=288.15) as default value.
Firstly, I dont understand why it tells me that there are 2 equations and 1 variable. When instantiating it says that there are 0 equations and 0 variables which is correct.
Secondly, By default, all parameters will have fixed = false by default. Why is OMEdit taking fixed = true?
Re: Problem using initial equations
The variables browser will show the start-value because that is all that is available to it (the information before simulation starts).
In Modelica, variables will have fixed=false by default. But parameters have fixed=true.
- sjoelund.se
- 1700 Posts
Re: Problem using initial equations
Code:
model Test
import SI = Modelica.SIunits;
parameter SI.Temperature T;
initial equation
T = (300+400)/2;
end Test;
is basically transformed into:
Code:
model Test
import SI = Modelica.SIunits;
parameter SI.Temperature T(fixed=false);
initial equation
T = T.start;
T = (300+400)/2;
end Test;
- sjoelund.se
- 1700 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Problem using initial equations