openmodelicainterest  

Re: Acausal systems modelling and compilation

Francesco Casella
Fri, 18 Dec 2009 14:26:13 -0800

Dear Rafael,

In a numerical sense, the solution of a index-reduced problem is not
the same of the original high-index problem.

I was referring to the exact solution.

This is because the
reduced index problem accepts more solutions than the original one
(algebraic constraints are replaced by differential equations). This
is known as the "drift-off" effect.

I'm sorry, but I don't agree with this. It depends how you build the reduced-index problem. If you use the dummy derivative algorithm (http://portal.acm.org/citation.cfm?id=153121) there will be no drift-off at all.

Let's take a simple example

der(x1) = 1 + y
der(x2) = -y
x1 = x2

this is an index 2 problem. If you apply the dummy derivatives algorithm, you differentiate the third equation, *but you also keep the original one*. In order to avoid an overdetermined system, you then demote one of the state variables in the differentiated state to algebraic variable (e.g. x2), and introduce one extra algebraic variable (the dummy derivative) in place of the derivative of this ex-state (e.g., der_x2 instead of der(x2)).

As a result, you get this first-order, index-1 DAE:

der(x1) = 1 + y
der_x2 = -y
x1 = x2
der(x1) = der_x2

which has only one state variable x1. These equations can be solved for der(x1), der_x2, y, x2, giving

der(x1) = 1/2
y = -1/2
der_x2 = 1/2
x2 = x1

The first equation can be integrated giving x1 = x1(0) + 1/2*time (or, you can integrate it numerically), and there is of course no drift here, since x2 is always computed to be equal to x1 at each time step.

> Please check "Hairer, E. and
Wanner, G., Solving Ordinary Differential Equations II. Stiff and
Differential-Algebraic Problems, Springer-Verlag, 1996." for more
details on that effect.

I don't have access to this book, but they are probably using a different method, I guess.

Best

                                Francesco


Just my 2 cents.

2009/12/17 Arquimedes Canedo <can...@gmail.com>:
Francesco,


Thanks for the insightful answers.


The solution of an initial value problem for a higher index DAE and for the
same DAE brought to index 1 with Pantelides / Dummy Derivatives is exactly
the same.
This is good news. The only place where we could have numerical error
is then the numerical solver itself.

If the implicit algebraic equations have a unique solution in closed form, a
symbolic manipulator could solve them symbolically and replace them with
their closed-form solution. Otherwise, you typically use numerical,
Newton-like solvers, which require to know the residuals of the implicit
equations, and possibly their Jacobian w.r.t. the unknowns.
This sounds familiar, at least that is what Scicos/Simulink try to
handle the algebraic loops.
I guess this is all explained in detail in the books you have
recommended before. I'll try to get my hands on them soon.


Thanks,

Arquimedes






--
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