Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: A differential inside another differential - DAES
Replies: 1   Last Post: Mar 8, 2013 2:35 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Torsten

Posts: 1,459
Registered: 11/8/10
Re: A differential inside another differential - DAES
Posted: Mar 8, 2013 2:35 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Elsis" wrote in message <khaghp$q69$1@newscl01ah.mathworks.com>...
> Hello
>
> I have a set of DAES, but I have one differential inside another something like this:
>
> Dx(1)=x(2)-x(1)
> 0=x(2)-K*x(1) >>> an algebraic equation
> Dx(3)=K*Dx(1)+K*x(3)
>
> is it possible to solve a system like this on Matlab or I should require to do something extra to solve it?
>
> thanks! have a nice day!
>
> Elsa


Three ways to rewrite your DAE system:

Either you define the mass matrix for the system above as
M=[1 0 0; 0 0 0; -K 0 1]
and the right-hand side vector as
f=[x(2)-x(1);x(2)-K*x(1);K*x(3)]

or, since Dx1 = x(2)-x(1), you can insert this expression directly into the third
equation to get
Dx(1)=x(2)-x(1)
0=x(2)-K*x(1) >>> an algebraic equation
Dx(3)=K*(x(2)-x(1))+K*x(3)=K*(x(2)-x(1)+x(3))
and thus
M=[1 0 0; 0 0 0; 0 0 1]
f=[x(2)-x(1);x(2)-K*x(1);K*(x(2)-x(1)+x(3))]
or you solve for x(2) from the algebraic equation and insert in the other two:
from the algebraic equation you get x(2)=K*x(1) and thus
Dx(1) = x(2)-x(1) = K*x(1)-x(1)=(K-1)*x(1)
Dx(3) = K*Dx(1)+K*x(3)=K*(K-1)*x(1)+K*x(3)=K*((K-1)*x(1)+x(3))

Best wishes
Torsten.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.