Reputation: 457
Does Modelica transfer the DAE into state-space form (system of ODE's)?
If I want to model a system: For example a simpley model with a dynamic pipe and sink, source: Medium simple incompressible liquid water. What are the state variables (pressure, temperature,..?)?
Thank you for your help!
Upvotes: 1
Views: 1114
Reputation: 2696
Dymola shows the selcted states in the simulation log → Translation tab → Statistics section.
As an example, this is the output for Modelica.Mechanics.Translational.Examples.Oscillator
:
From the Modelica code, Dymola instantiates all objects, generates flat Modelica code, does some symbolic transformation and simplification (like elimination of alias variables). Then from the remaining variables and equations it chooses the states. How the states are selected and means to influence the selction process are described in the Dymola User Manual Volume 2, section 8.4 "Means to control the selection of states" or in this paper: https://www.modelica.org/events/workshop2000/proceedings/old/Mattsson.pdf
Upvotes: 1
Reputation: 108
A way to do that is to load the Modelica_LinearSystems2
library and use the function Modelica_LinearSystems2.ModelAnalysis.Linearize()
.
The Linearize()
function will return a state space object containing the A, B, C and D matrices but also the input, output and state vectors containing respectively names of the inputs, outputs and states.
If your model is not time-invariant you can also perform a simulation phase before the linearization to retrieve the linearized version of your model at a particular operating point.
Upvotes: 1