I am confused about the solving DAEs process in Dymola. So I made an example to explore it.
Here is the screenshot of the example scheme and control equations
Based on the following definition of variables, I think the solving DAEs process is to
I build the model in Dymola with the following debug settings.
Since the DAE's index in my model is 3, there is a need to do index reduction, after using the Pantelides Algorithm, Dymola would adding more differentiated equations to the DAE system.
The translate log verified my deduction.
Now, according to the equation browser, it is apparent the DAE system has been modified into a BLT form, I think I could just use the newton method with the current equation system, but Dymola would use the DASSL algorithm. And apparently, DASSL would do build the Structural Jacobian Matrix from scratch again, so during the initialization(using Pantelides Algorithm) and simulation(using DASSL Algorithm) processes, different Structural Jacobian Matrix would be used.
My question is:
After using Pantelides Algorithm to do index reduction and partitioning, I could solve the equations with Newton Method, but why does Dymola have to do partitioning again and use DASSL Algorithm?
In addition, I compared the Structural Jacobian Matrix in initialization and simulation process in Wolfram System Modeler, which showed these two matrices are different.
I think there are actually two things that are important to understand the overall process:
During this phase, also the derivatives,
der(..)
, and the pre-variables,pre(..)
, are interpreted as unknown algebraic variables. The initialization uses all equations and algorithms that are utilized in the intended operation...
Basically, a different set of unknowns (and respective equations) results in two separated problems to solve for initialization and during simulation. As far as I know symbolic processing (incl. Pantelides algorithm) is applied to simplify both problems. As an example: Translating Modelica.Blocks.Examples.PID_Controller
results in the following translation log, which separates the two aspects (Note: the "Translated Model" and the "Initialization problem" being different):
One thing that is special about DASSL, though not unique, is that DASSL has two interfaces which can be used during simulation: It can work with an ODE description of the system (after it has been transformed e.g. by the symbolic pre-processing of Dymola) or it can use a DAE description (by setting Advance.Define.DAEsolver=true;
). By default, the ODE interface is used. Both have advantages, the Dymola Manual states:
When DAE solver is enabled the equations in the output and dynamics section of the model are not solved during calls to the model. They are instead handled by the integrator as part of the nonlinear system of equations that the integrator solves each step. If the translated model contains several or large nonlinear equation systems, then DAE solvers may be more efficient since fewer nonlinear systems are solved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With