openmodelicainterest  

Re: Acausal systems modelling and compilation

Arquimedes Canedo
Wed, 16 Dec 2009 17:28:23 -0800

Francesco,

Sure this is helping me. Thanks for the references, I'll look into
those books to have a better understanding.


Your explanation of how OMC uses DASSL as a standard ODE solver is
very clear. I thought the relationship between DAEs-DASSL was
stronger. It is also clear why Euler is preferred for real-time
simulations.

I think I am finally understanding the logic behind the BLT form. And
I guess the strongly connected components algorithm is executed
precisely to find these tightly coupled equations that can be seen as
just 1 single equation ?

Somewhere else I read that index reduction is considered a symbolic
manipulation of DAEs and therefore, this transformation, may affect
the original semantics and behaviour of the original system.
Therefore, in this case, the concern of accuracy not only comes from
the selection of the ODE solver but from the previous transformations.
Is this a major concern in actual systems development ?

Finally, to extend the point of acausality in Modelica, you mentioned
that the system remains acausal if there are algebraic loops. What
options do we have for handling algebraic loops ? More algebraic
transformations, or is there a way to iteratively approximate its
solution ?

Thanks,

Arquimedes


On Thu, Dec 17, 2009 at 1:24 AM, Francesco Casella
<case...@elet.polimi.it> wrote:
> Hi Arquimedes,
>
>> I have read the Open Modelica Compiler Phases document and it gives a
>> very good high-level perspective on how the omc works. I have also
>> read some of the related papers on the omc compiler and this is where
>> things start getting fuzzy.
>
> I'd suggest you to also read the books by Tiller and by Fritzson about
> Modelica :)
>
>> While I can see the benefit of ordering the dependency matrix in BLT
>> form for reducing the reaching definitions of variables for
>> parallelization, I don't fully understand why this step is necessary
>> for generating uniprocessor code. Is it to reduce the complexity of
>> the matrix manipulation algorithms ? How does the BLT form affect the
>> quality of the generated code, in the case of uniprocessor ?.
>
> Even with a single thread, in general it is obviously easier to solve N
> smaller systems than one, single, bigger system.
>
>> Concerning the numerical solver selection, I have seen the ongoing
>> discussion about DAEs with index > 1. It seems that DAEs are passed to
>> the index reduction and if the resulting system has an index == 1 then
>> we can easily solve with fixed-step ODE solvers, Runge-Kutta methods
>> for example. However, if the index > 1, are we forced to use DASSL ?.
>
> No, if the system has index > 1, symbolic index reduction is applied to
> reduce it to index = 1, no matter what solver is later used. BTW, DASSL
> cannot handle index>1 DAEs.
>
>> What criteria does openmodelica apply for the selection of DASSL or
>> Euler ?
>
> DASSL is a high-order, variable step size BDF solver, with support for event
> handling. Euler is a simple one-step, first order solver, usually employed
> at fixed time step for real-time simulation.
>
> An excellent source to know more about this is the book by Petzold and
> Ascher "Computer Methods for ordinary differential equations and
> differential-algebraic equations.
>
> Note that OMC conceptually brings the DAE into ODE form before linking to a
> solver, so even if DASSL is used, it is used as an ode solver.
>
>> I know this is highly dependent on the problem itself, but how often
>> do you get systems with index >= 2 ?
>
> In mechanical systems, every time you make a rigid connection, you get index
> = 3.
>
> In electrical circuit, you get index=2 whenever connect condensers in
> parallel, or inductors in series.
>
>> How do you handle them ?
>
> Pantelides' algorithm + dummy derivative algorithm.
>
> , is it
>>
>> possible to apply index reduction again and again until we reach our
>> target ?
>
> Yes, if OMC can differentiate the constraint equations enough times.
>
>> Finally, I would like to ask about the meaning of 'acausality' inside
>> a Modelica compiler, openmodelica in this case. After deciding the
>> ordering of equations based on their data dependencies and scheduling
>> them, aren't we transforming the 'acausal' system into a 'causal' one
>
> No, if there are algebraic loops (i.e. implicit algebraic equations) in the
> model.
>
> Hope this helps
>
>                                Francesco
>
> --
> Francesco Casella - Ph.D.
> Dipartimento di Elettronica e Informazione
> Politecnico di Milano
> Via Ponzio 34/5
> I-20133 MILANO - ITALY
>
> Tel:    +39-02-2399-3465 (Leonardo)
>        +39-02-2399-7749 (Polo di Cremona)
> Fax:    +39-02-2399-3412
> e-mail: case...@elet.polimi.it
> web:    http://home.dei.polimi.it/casella
> Skype:  callto://francesco.casella
>
>