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 commentaires

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 le 29 Mai 2018
Torsten, can you show how you arrived at your suggestion for the 3rd equation?
Torsten
Torsten le 30 Mai 2018
Modifié(e) : Torsten le 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 le 1 Juin 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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Mathematics dans Centre d'aide et File Exchange

Produits

Version

R2017b

Commenté :

le 1 Juin 2018

Community Treasure Hunt

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

Start Hunting!

Translated by