% Simulate the mousetrap ODE for different
% Probabilities, p, and mousetraps, M
% Find length of simulation, unstrung 
% traps, and max number balls in air
ts = [0:100]; % 100 units of time simulated
p = 0.99; M = 100;
[t,y] = ode23(@mouseODE,ts,1,[],p,M);
time = 1;
for i = 1:100
    b(i) = 2*M*(y(i)-y(i+1));
    if ((time == 1) && (b(i) < 1))
        time = i;
        unspr = M*y(i+1);
    end
end
bmax = norm(b,inf);
fprintf('Unsprung = %6.2f, bmax = %6.2f, time = %2.0d \n', ...
  unspr,bmax,time);