help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Solving DAE using daspk function


From: Windhorn, Allen E [ACIM/LSA/MKT]
Subject: Re: Solving DAE using daspk function
Date: Mon, 25 Nov 2019 21:59:55 +0000

vmz,

I thank you for your interesting question of the 20th, because I need to learn
to solve differential-algebraic equations.  I'm not particularly familiar with
daspk yet, so I don't know why your third example isn't working, but you can
solve the third and fourth equations (the algebraic ones) for x(3) and x(4) by 
hand, and just substitute those values back into the first two equations,
turning the system into a pure differential equation (please check my work to
see if I got the equations correct):

function f = exam4f(x, xdot, t)
  f(1) = xdot(1)+t*x(2)+(1.0+t)*(x(2)-5*sin(t^2/2));
  f(2) = xdot(2)+t*x(1)+(1.0+t)*5*(x(1)-5*cos(t^2/2));
endfunction

Still using daspk (because it was handy), I tried this function and got a 
solution.
The solution gets really truly enormous very quickly, so I don't know whether
to believe it or not, but at least it doesn't crash.

Regards,
Allen
-- 
Allen Windhorn P.E. (Mn), CEng| Senior Principal Engineer
Leroy-Somer Americas | Kato Engineering, Inc.
2075 Howard Dr. West | North Mankato, MN 56003 | USA
T +1 507-345-2782 | F +1 507-345-2798
address@hidden | address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]