Solving DAE equations simultaneously with ODE15s
Show older comments
Hi,
I have a set of equations as DAE which I need to be solved. I am using ODE15s. The equations are of the form.
(1/y)(dx/dz)+(2x)(dy/dz)=q; q+y+5=0; (I/x)(dp/dz)=y; (dx/dz)+(dy/dz)=25; where x,y,p and q are the variables needed to be solved as initial value problem. Can you please help how to proceed as from example here (https://www.mathworks.com/help/matlab/ref/ode15s.html) I can only see one derivative in one equation and that is why the M matrix is very simple. How can I write the M matrix in my case? If I need to solve similar problem as boundary value problem, is it possible? Thanks...
Answers (1)
Torsten
on 24 Aug 2017
0 votes
M=[1/w(2) 2*w(1) 0 0; 0 0 0 0; 0 0 l/w(1) 0; 1 1 0 0] f=[w(4);w(4)+w(2)+5.0;w(2);25.0]
if you order the solution variable as w(1)=x, w(2)=y, w(3)=p, w(4)=q.
If you solve your differential equations explicitly for dx/dz, dy/dz and dp/dz, it is possible to use "bvp4c". This is easily possible for your system from above.
Best wishes
Torsten.
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!