ode15s works, but not with my Jacobian

1 view (last 30 days)
Amy
Amy on 2 Oct 2015
Edited: Walter Roberson on 2 Oct 2015
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!

Answers (0)

Community Treasure Hunt

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

Start Hunting!