% simple first-order differential equation solution
% by Gavin LaRose, 1/9/2012
% this graphs three solutions to the differential equation
%    v' = 8.730 - 0.721 v,
% which is a model for Usain Bolt's velocity in his 2008
% (then) world-record 100 meter run of 9.69 seconds in the
% Beijing olympics
%
% (c)2012 Regents of the University of Michigan
% This work is licensed under the
% Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
% To view a copy of this license, visit
% http://creativecommons.org/licenses/by-nc-sa/3.0/
% or send a letter to
% Creative Commons,
% 444 Castro Street, Suite 900,
% Mountain View, CA, 94041, USA.
% 
%----------------------------------------------------------------------
% configuration variables

t = 0:.01:10;
% the velocity with v(0) = 0
v1=12.11*(1 - exp(-0.721*t));
% the constant solution v = 12.11
v2=12.11*ones(length(t),1);
% another solution in the family of solutions, having v(0) = 6
v3=12.11 - 6.11*exp(-0.721*t);

% plot them
figh = figure();
axes('Parent', figh, 'Color',[0.6 0.6 0.6]);
hold on;
plot( t, v1, t, v2, t, v3, 'LineWidth', 2 );
axis([0,10,0,13]);
title('Solutions to v''=8.730-0.721v', 'FontSize', 18);
xlabel('t', 'FontSize', 14);
ylabel('v(t)', 'FontSize', 14);
hold off;

% all done
%----------------------------------------------------------------------
