ode15s works, but not with my Jacobian

조회 수: 1 (최근 30일)
Amy
Amy 2015년 10월 2일
편집: Walter Roberson 2015년 10월 2일
Hi!
Thanks for looking at the problem!
Part of the code:
options=odeset('Jacobian',@J);
[tn,C]=ode15s(@F,[tinitial tfinal], C0, options);
The functions are defined with variables: J(tn,C) and F(tn,C)
1. When I don't use options, my system is solved fine.
2. When I do use the option to include the Jacobian, the following error occurs:
Error using *
Inner matrix dimensions must agree.
Error in ode15s (line 387)
DfDt = dfdt + dfdy*yp;
Error in myprogram (line 23)
[tn,C]=ode15s(@F,[tinitial tfinal], C0, options);
I used keyboard to see if the function Jacobian is being called. This is not the case. Where could the error come from then?
Thanks a lot in advance!

답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by