Parameters
Parameters
R0=15;(*Initialreserveinbillions*)v0=1;(*Initialspendingrateinbillions/month*)a=0.3;(*Accelerationofspendinginbillions/month^2*)Reserve[t_]:=R0-v0t-(at^2)/2(*Reservefunctionovertime*)
Three methods of solving for time to depletion
Three methods of solving for time to depletion
tSolve=Solve[Reserve[t]==0,t]tDepletion=Select[t/.tSolve,#>=0&]tDepletionNum=N@tDepletion
Out[]=
{{t-13.8743},{t7.20759}}
Out[]=
{7.20759}
Out[]=
{7.20759}
In[]:=
Plot[Reserve[t],{t,0,2Max[tDepletion]},AxesLabel->{"Months","Reserve (billions)"},PlotLabel->"Reserve Depletion Over Time",Filling->Axis,PlotRange->All]
Out[]=
In[]:=
Manipulate[Plot[R0-v0t-(at^2)/2,{t,0,tMax},AxesLabel->{"Time (months)","Reserve (billions)"},PlotLabel->"Reserve Decay Model",Filling->Axis],{{R0,15},0,30},{{v0,1},0,5},{{a,0.3},-1,1},{{tMax,24},6,60}]
Out[]=

