ode15s works, but not with my Jacobian

1 次查看(过去 30 天)
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