Is ode15i correct for this situation?
Show older comments
Can someone tell me if this is the correct approach and if so provide suggestions to get this to solve?
I have a system that is characterized by 3 equations in this form:
y'(1) - y(2) = 0
y'(2) + fun1(y(1),y(2),y(3)) = 0
fun2(y(2)) + fun3(y(3)) = 0
The 3 functions are not linear. Since this is a DAE system and since it was most convenient to arrange them as f(t,y,y’) = 0, I used ode15i. Is this correct? The solution fails either at t=0 or some later time with a singular matrix warning depending on choice of parameters.
I differentiated the 3rd equation hoping to have a system of ODEs instead of DAEs. For my functions, the system takes this form:
y'(1) - y(2) = 0
y'(2) + fun1(y(1), y(2), y(3)) = 0
fun2(y'(2)) + fun3(y(3), y'(3)) = 0
Since both y'(2) and y'(3) appear in the 3rd equation, am I stuck with a fully implicit situation and back to using only ode15i? This formulation fails at t=0 with a singular matrix warning.
Any insight appreciated.
4 Comments
Torsten
on 28 May 2018
Use
y'(3) = -d/dy(2)(fun2(y(2))) * (-fun1(y(1),y(2),y(3))) / d/dy(3)(fun3(y(3)))
as third equation.
Best wishes
Torsten.
Tom Mallin
on 29 May 2018
Implicit differentiation of equation (3) with respect to t:
fun2(y(2)) + fun3(y(3)) = 0 ->
[d/dy(2) (fun2(y(2)))]*dy(2)/dt + [d/dy(3) (fun3(y(3)))]*dy(3)/dt = 0 ->
dy(3)/dt = - [d/dy(2) (fun2(y(2)))]*dy(2)/dt / [d/dy(3) (fun3(y(3)))] -> (from equation (2))
dy(3)/dt = - [d/dy(2) (fun2(y(2)))]*(-fun1(y(1), y(2), y(3)))/ [d/dy(3) (fun3(y(3)))]
Best wishes
Torsten.
Tom Mallin
on 1 Jun 2018
Answers (0)
Categories
Find more on Dynamic System Models 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!