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 Kommentare

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
Tom Mallin am 29 Mai 2018
Torsten, can you show how you arrived at your suggestion for the 3rd equation?
Torsten
Torsten am 30 Mai 2018
Bearbeitet: Torsten am 30 Mai 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
Tom Mallin am 1 Jun. 2018
Torsten, your suggestion is exactly what I've done to change the first formulation into the second. My fun2 and fun3 were meant to be different in the 2 formulations. I thought you were starting with the 3rd equation in the 2nd formulation and differentiating again which didn't make sense.
In any case, I think ode15i is proper for solving formulation 1 and ode45 is proper for formualation 2. Neither are working so I suspect some other issue.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Mathematics finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2017b

Gefragt:

am 26 Mai 2018

Kommentiert:

am 1 Jun. 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by