Unable to solve ODE23

1 view (last 30 days)
Steve Stevens
Steve Stevens on 2 Jun 2015
Commented: Walter Roberson on 2 Jun 2015
Dear users,
I'm trying to solve a ODE using a solver available in Matlab. The equation is the following:
ode23(@(Tm,t) -1E-5/(5000*(1531*Tm^2.38/(13+Tm)))*(Tm-30/600*t+225),[0 3600],225)
When a run the command, unfortunately, the following error message appears: -> Warning: Failure at t=0.000000e+00. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (7.905050e-323) at time t.
I realized it is related to the term (1531*Tm^2.38/(13+Tm)). If I replace the expression by a constant, the problem no longer subsists.
Is matlab not able to tackle complex ODE equations? Or am I missing something?
Cheers!
  1 Comment
Walter Roberson
Walter Roberson on 2 Jun 2015
The objective function is passed time in as the first parameter. Time is often named "t". You have used "Tm" for the first parameter, which could suggest "time", but you have also used "t" for your second parameter, and people would be more likely to read that as "time". With the parameter names you have used, my reaction would be to think that you got the order wrong in the @() part, that you wanted @(t, Tm). If you are sure you got the right order, I recommend that you rename "t" as otherwise other people who read the code are going to be confused by it.

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!