MATLAB Code for ode15s


Here is a specific example of a stiff problem solved using ode15s.

       function [out1,out2,out3]=P15(t,x)
          if (t<1)
            yin=.01;
            Tin=600;
          else
            if (t<2)
              yin=.02*t - .01;
              Tin=100*t + 500;
            else 
              yin=.03;
              Tin=700;
            end
          end  
          ak1 = 6.7e10*exp(-12556/x(2));
          bk1 = 65.5*exp(961/x(2));
          r = ak1*(.05+.5*(x(1)-yin))*x(1)/(x(2)*(1+bk1*x(1))^2); 
          xdot(1,:)=160*(yin-x(1)) - 1.94e6*r;
          xdot(2,:)=.09*(Tin-x(2))+ 9.22e5*r;
          out1=xdot;

In the command code, this is how to call the ode15s function.

[t,x]=ode15s('P15',[0,60],[1.4227e-5,688.3585])

To look at a plot of the solutions

top -- Back to ODE Page -- Back to Solve Page


This is the graphical output of the given function

[IMAGE]

top -- Back to ODE page -- Back to Solve Page


Page constructed by Doug Thornhill, James Bopp, Cory Clemmons and Devin Hodgson.
For any questions or suggestions, email to dt@u.washington.edu
Last modification on 8 Dec 1995