Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is this a differential algebraic equation?

0 views
Skip to first unread message

Monty Hall

unread,
May 13, 2008, 12:23:44 PM5/13/08
to
Hello,

When I assemble a system that I want to simulate I get a matrix equation
of the following form. My input vector is a list of function
derivatives. I'm solving for pipeline flow rates using a linear model -
something very similar to a electrical circuit. Would the matrix
equation be classified as a differential algebraic equation?


A x b
--------------- ------ -
a11 a12 a13 a14 m''(t) c1
a21 a22 a23 a24 * m'(t) = c2
a31 a32 a33 a34 m(t) c3
a41 a42 a43 a44 p c4


The above was written abbreviated. If I had 3 pipelines, my "x" vector
would be
m1''(t)
m2''(t)
m3''(t)
m1'(t)
m2'(t)
m3'(t)
m1(t)
m2(t)
m3(t)
...

Currently, I place the initial conditions into the "b" input vector -
which includes the initial/current value to the diff eq's - and multiply
by a LU decomposed "A" matrix to solve to the "x" vector. At that point
I accumulate the solutions - an euler integration in appearance, place
accumulated values into "b" vector and solve again for each time step.

"euler" performed @ each time step:
----------------------------------
m(t1) = m(t0) + m'(t1) placed into "b" for next iteration
m'(t1) = m'(t0) + m''(t1) placed into "b" for next iteration
m''(t1) = solution from "x"

What are my choices for a numerical solution? Any examples on the web
that solves a similar system? It looks like a DAE, from what I can tell
from the web, but DASPK solver is a fortran program. I would a
c/c++/java version w/ source if possible. I would very much like to
keep the above form w/ a minimal of symbolic rearrangement (avoid having
to hand craft ODE's from the above equation for each new piping network
that is created..) Any help appreaciated, TIA.

Regards,

Monty

Robert Israel

unread,
May 13, 2008, 6:01:59 PM5/13/08
to
Monty Hall <mo...@hall.com> writes:

> Hello,
>
> When I assemble a system that I want to simulate I get a matrix equation
> of the following form. My input vector is a list of function
> derivatives. I'm solving for pipeline flow rates using a linear model -
> something very similar to a electrical circuit. Would the matrix
> equation be classified as a differential algebraic equation?
>
>
> A x b
> --------------- ------ -
> a11 a12 a13 a14 m''(t) c1
> a21 a22 a23 a24 * m'(t) = c2
> a31 a32 a33 a34 m(t) c3
> a41 a42 a43 a44 p c4

I think this would be classified as overdetermined. Just one equation
involving m'', m' and m is a differential equation, and already determines
m(t) up to initial conditions. But here you have four such equations.

> The above was written abbreviated. If I had 3 pipelines, my "x" vector
> would be
> m1''(t)
> m2''(t)
> m3''(t)
> m1'(t)
> m2'(t)
> m3'(t)
> m1(t)
> m2(t)
> m3(t)
> ...

Make that 12 equations instead of 3.
--
Robert Israel isr...@math.MyUniversitysInitials.ca
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada

Peter Spellucci

unread,
May 14, 2008, 7:48:30 AM5/14/08
to

In article <ggjWj.3412$J16....@newssvr23.news.prodigy.net>,

Monty Hall <mo...@hall.com> writes:
>Hello,
>
>When I assemble a system that I want to simulate I get a matrix equation
> of the following form. My input vector is a list of function
>derivatives. I'm solving for pipeline flow rates using a linear model -
>something very similar to a electrical circuit. Would the matrix
>equation be classified as a differential algebraic equation?
>
>
> A x b
>--------------- ------ -
>a11 a12 a13 a14 m''(t) c1
>a21 a22 a23 a24 * m'(t) = c2
>a31 a32 a33 a34 m(t) c3
>a41 a42 a43 a44 p c4

!!!!! this looks quite strange: maybe you intended here to write this in the
original meaning but had the system already transformaed in the first order
system form. but even then the system would look like
A(y)y' + B(y) = F(t)

y(t)=(y1(t),y2(t),p(t)) with y1(t)=m(t) and y2(t)=m'(t)


>
>
>The above was written abbreviated. If I had 3 pipelines, my "x" vector
>would be
> m1''(t)
> m2''(t)
> m3''(t)
> m1'(t)
> m2'(t)
> m3'(t)
> m1(t)
> m2(t)
> m3(t)
> ...
>
>Currently, I place the initial conditions into the "b" input vector -
>which includes the initial/current value to the diff eq's - and multiply
>by a LU decomposed "A" matrix to solve to the "x" vector. At that point
>I accumulate the solutions - an euler integration in appearance, place
>accumulated values into "b" vector and solve again for each time step.
>
>"euler" performed @ each time step:
>----------------------------------
> m(t1) = m(t0) + m'(t1) placed into "b" for next iteration
> m'(t1) = m'(t0) + m''(t1) placed into "b" for next iteration
> m''(t1) = solution from "x"
>


obviously you forgot the factor delta_t on the right hand side
and took Euler implicit?

>What are my choices for a numerical solution? Any examples on the web
>that solves a similar system? It looks like a DAE, from what I can tell
>from the web, but DASPK solver is a fortran program. I would a

it _is_ a DAE, hence your Euler solution would fail for sure :
a DAE can be considered as a stiff ODE with infinite stiffness,
not a good point to start with Euler
with DASSL or DASPK you are on the rihgt track


>c/c++/java version w/ source if possible. I would very much like to
>keep the above form w/ a minimal of symbolic rearrangement (avoid having
>to hand craft ODE's from the above equation for each new piping network
>that is created..) Any help appreaciated, TIA.
>
>Regards,
>
>Monty
>

concerning your wishes for C++:
<this is from Hairer' homepage>
There is a folder, written by Blake Ashby "bmashby (at) stanford.edu",
which contains C++ versions of the nonstiff integrator DOPRI5
and of the stiff integrator RADAU5.
It can be unfolded with "tar xzf IntegratorT.tgz".

radau5 allows the implicit form with singular mass matrix (your case)
Hairer has also specail codes for constrained mechanical systems
look here:
http://www.unige.ch/~hairer/software.html

hth
peter

Monty Hall

unread,
May 14, 2008, 10:49:47 AM5/14/08
to

Thank you very much. Your reply has pointed me in the right direction.
Sorry, in my haste, my post was sloppy and awkward.


Regards,

Monty

0 new messages