Main Page | Report this Page
 
   
Science Forum Index  »  Math - Numerical Analysis Forum  »  Is this a differential algebraic equation?...
Page 1 of 1    
Author Message
Monty Hall...
Posted: Tue May 13, 2008 11:23 am
Guest
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 at (no spam) 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...
Posted: Tue May 13, 2008 5:01 pm
Guest
Monty Hall <monty at (no spam) hall.com> writes:

Quote:
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.

Quote:
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 israel at (no spam) math.MyUniversitysInitials.ca
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada
Peter Spellucci...
Posted: Wed May 14, 2008 1:48 am
Guest
In article <ggjWj.3412$J16.1931 at (no spam) newssvr23.news.prodigy.net>,
Monty Hall <monty at (no spam) hall.com> writes:
Quote:
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)


Quote:


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 at (no spam) 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?

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


Quote:
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...
Posted: Wed May 14, 2008 9:49 am
Guest
Peter Spellucci wrote:
Quote:
In article <ggjWj.3412$J16.1931 at (no spam) newssvr23.news.prodigy.net>,
Monty Hall <monty at (no spam) 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 at (no spam) 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


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
 
Page 1 of 1       All times are GMT - 5 Hours
The time now is Fri Aug 29, 2008 9:45 pm