% This script illustrates stiffness for a burning match problem
clear all
clc
close all
f = @(t,y) y^2-y^3;
t0=0;
tol = 1e-4;
opts = odeset('RelTol',tol,'Position', [5 10 scrnsz(3)-5 scrnsz(4)-60]);
dvalues = [0.01 0.001 0.0001];
for delta=dvalues
    tmax=2/delta;
    y0=delta;    % initial condition
    ode45(f,[t0 tmax],y0,opts);
    title(sprintf('ode45 with delta=%f',delta)) 
    pause
end
for delta=dvalues
    tmax=2/delta;
    y0=delta;    % initial condition
    ode23s(f,[t0 tmax],y0,opts);
    title(sprintf('ode23s with delta=%f',delta)) 
    pause
end

