%Math 316 - Spring 2017
%Chapter 1 - Code 2
%Written by M. Motamed @ UNM 
%================================================================
%Plotting several general solutions of the ODE: dv/dt = 9.8 - v/5
%================================================================

T=20;                %final time
N=1000;              %the number of time instances between 0 and T
t=linspace(0,T,N);

figure
set(gca,'fontsize', 20);
hold on

for c=-40:10:40
    v=49+c*exp(-t/5);
    plot(t,v)
    xlabel('t')
    ylabel('v(t)')
end

%To plot the equilibrium solution
plot(t,49*ones(size(t)),'r','Linewidth',2)
box