Is ode15i correct for this situation?

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

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 2018년 5월 29일
Torsten, can you show how you arrived at your suggestion for the 3rd equation?
Torsten
Torsten 2018년 5월 30일
편집: Torsten 2018년 5월 30일
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 2018년 6월 1일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

제품

릴리스

R2017b

질문:

2018년 5월 26일

댓글:

2018년 6월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by