Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Choice of state variables

Choice of state variables

I use OpenModelica in a class making comparison with block diagram based modelling.
I'd like to show which variables are chosen as state variables and therefore which variables need an initial value.
I wonder if a file is produce when compiling the model.

Re: Choice of state variables

Well, you could look in the result file: If there is a der(x), x is a state variable.

You could also look in the _init.xml file:

Code:

  <ScalarVariable

    name = "x"
    valueReference = "1000"
    variability = "continuous" isDiscrete = "false"
    causality = "internal" isValueChangeable = "true"
    alias = "noAlias"
    classIndex = "0" classType = "rSta"
    isProtected = "false" hideResult = "false"
    fileName = "/home/marsj/tmp/a.mo" startLine = "2" startColumn = "3" endLine = "2" endColumn = "9" fileWritable = "true">
    <Real fixed="false" useNominal="false" />
  </ScalarVariable>

classType = "rSta" is a state variable.

Re: Choice of state variables

Hi,
thanks for the help! Surely, I can look at which variables have derivatives computed.
As I said, I'd like to have a file to show the students but I cannot find the _init.xml file. Shall I set some options in order to produce the file?
I cannot find any file produced under compilation.
Anna

Re: Choice of state variables

In the OMEdit go to Tools -> Options -> General and under Working Directory you will see a path where you can find generated files of particular simulation, including __init.xml

There are 0 guests and 0 other users also viewing this topic