Skip to content

Commit

Permalink
- SimCode.mo, BackendVariable.mo
Browse files Browse the repository at this point in the history
  - for initialisation use not startvalue use pre(variable) this is the same value but it is possible to change the startvalue with the model_init.txt file 
  - also add residual equations from vars moved to known variables 
  - ToDo: 
     - change states variables fixed=true by default to fixed=false and do not set the fixed attribute from variables (dummy_states) to false if it is true. 
     - analyse the initial equaition system if additional variables must be fixed for initialisation
  - add some stuff for calculating the initialisation values via matching algorithm. This works if the number of unknown variables es equal to the number of equations for initialisation, use the debugflag=initdlowdump and uncomment the initialisation method via initial_residual function

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7349 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Dec 10, 2010
1 parent 7601eb7 commit 275fe12
Show file tree
Hide file tree
Showing 2 changed files with 324 additions and 25 deletions.
7 changes: 4 additions & 3 deletions Compiler/BackendVariable.mo
Expand Up @@ -321,14 +321,15 @@ algorithm
BackendDAE.PARAM() = varKind(v);
then
true;
/* See Modelica Spec 3.2 page 88:
/* See Modelica Spec 3.2 page 88:
For constants and parameters, the attribute fixed is by default true. For other variables
fixed is by default false. For all variables declared as constant it is an error to have "fixed = false".
*/ case (v) // states are by default fixed.
*/ case (v) // states are by default fixed.
equation
BackendDAE.STATE() = varKind(v);
fixed = RTOpts.debugFlag("initdlowdump");
then
true;
not fixed;

case (_) then false; /* rest defaults to false*/
end matchcontinue;
Expand Down

0 comments on commit 275fe12

Please sign in to comment.