Mathematica Tool 1

This Mathematica notebook illustrates the process described in Section 5.2 for obtaining an approximate solution for the initial value problem
                                 (∂/(∂ t))v(t)=g-c ((v(t))^2)  with v(0)=0.

Needs["VectorFieldPlots`"]

For drops of diameter 0.05 inches or approximately 0.004 feet, the value of c is

c=0.115;

We enter a value for g in feet per second squared.

g=32.2;

We consider the velocity of the drop for the first two seconds. The time step is  Δ=Δt is determined by the number of divisions n of the 2-second time interval.

Δ=(2/n);

We plot the approximate solution together with the slope field for the differential equation.

Slopefield=VectorFieldPlot[#/Norm[#]&[{1,g-c (v^2)}],{t,0,2},{v,0,25},Axes->True,ColorFunction->Hue,AspectRatio->1]

We do the first two steps in the approximation individually.

n=10;
(Subscript[v, 0])=0;
(Subscript[v, 1])=(g-c ((Subscript[v, 0])^2)) Δ
(Subscript[v, 2]) =(Subscript[v, 1])+(g-c ((Subscript[v, 1])^2)) Δ

Now we calculate all the steps.

A=Range[n];
For[i=1,i<n+1,i++,If[i==1,A[[i]]=(Subscript[v, 0]),A[[i]]=A[[i-1]]+(g- c (((A[[i-1]]))^2)) Δ]]
v[t_]:=A[[t+1]]
Solution=Partition[Riffle[(Range[n]-1) Δ,A],2];

Check the values for (Subscript[v, 1]) and (Subscript[v, 2])

v[1]
v[2]

Plot the approximate solution for n steps.

solPlot=ListPlot[Solution,PlotStyle->{Blue,PointSize[0.02]},AxesLabel->{"t","v"}]

We compare this approximate solution with the slope field.

Show[Slopefield,solPlot]

We also compare the approximate soluti nto the symbolic solution stated in section 5.1.

V[t_]:=(((Sqrt[(g/c)])(1-(E^(-2(Sqrt[g c])t))))/(1+(E^(-2(Sqrt[g c])t))))

Start with n=10  and then double the number n of calculation steps. (The following block of commands repeats all of the essentials from above.)

n=10;
Δ=(2/n);
A=Range[n];
For[i=1,i<n+1,i++,If[i==1,A[[i]]=(Subscript[v, 0]),A[[i]]=A[[i-1]]+(g- c (((A[[i-1]]))^2)) Δ]]
v[t_]:=A[[t+1]]
Solution=Partition[Riffle[(Range[n]-1) Δ,A],2];
solPlot=ListPlot[Solution,PlotStyle->{Blue,PointSize[0.02]},AxesLabel->{"t","v"}];
Vplot=Plot[V[t],{t,0,2},PlotStyle->{Green,Thickness[0.01]}];
Show[Vplot,solPlot]

Go back to the most recent definiton of n and double twice more, comparing the symbolic and numerical solutions each time you double the number of calculation steps.