Math 1483 - Quiz 4

<=/Solutions\=>

Remember, ALT+7 gives a new text cell, be sure to explain your answers, if needed!

Problem 1

The background information for this problem was taken from:

https://www.tsijournals.com/articles/elzaki-transform-for-two-tank-mixing-problems.pdf

You do not need to know anything that appears in that pdf, the two functions will be defined for you, this is just for reference.

We  have  two 100 gallon tanks.  Tank A  is  initially  full  of  salt  water  with  a  salt  concentration  0.5  liter/gallon. Tank B  is  full  of  pure  water.  Pure  water  enters tank A  at  2  gal/min  water  and exits  the  well  mixed  tank  A  at  two  gal/min  and then flows into tank B.  The well mixed water in Tank B exits  at a rate of 2 gal/min and flows out of the system.   It can be shown that in this situation, the amount of salt in each tank can be modeled by the following two functions.

The amount of salt in Tank A (measured in liters), as a function  of t (in minutes), is given by:
A(t) = 50(e^(-t/50))

The amount of salt in Tank B (measured in liters), as a function of t (in minutes), is given by:
B(t) = 50t (e^(-t/50))

A[t_]:=50*Exp[-t/50];
B[t_]:=t*Exp[-t/50];

Part 1

Evaluate A(0) and B(0) and compare those results to the situation described in the problem.  Do they agree?

A[0]

B[0]

Since there was 50 liters of salt in Tank A at the start, and none in Tank B, the computations above agree with the setup.

Part 2

Plot A(t) and B(t) on the same graph, for the time range t=0 minutes to t=200 minutes.

Plot[{A[t],B[t]},{t,0,200},AxesLabel->{"time (min)", "salt (liters)"},PlotLegends->{"Tank A", "Tank B"}]

Part 3

Explain how the graphs given in part 2 agree with your intuition about how much salt should be in each tank as time passes.  Be sure to include the initial state, the mixing of the tanks, and the amount of salt in the tanks after a long period of time has passed.

Tank A will have the most salt in it at the start of this process, as freshwater is being added to the tank.  Tank B has no salt to start with in it, but receives saltwater from Tank A, so the amount of salt in Tank B should initially increase.  That being said, at some point, both tanks will have less and less saltwater, as only freshwater is being pumped into Tank A.  So over time, both tanks should have almost no salt.

Part 4

When do both tanks have the same salinity?

Here we simply set A(t) = B(t) and solve for t using the NSolve command (although Solve would suffice in this case).

NSolve[A[t]==B[t],t]

Solve[A[t]==B[t],t]

Part 5

At what time was there the most salt in Tank B?  And how much salt was there?

Here we can use Maximize command (wrapped in a N to get a decimal):

N[Maximize[B[t],t]]

It appears that the most salt in Tank B was 18.394 liters at 50 minutes into the process.

Part 6

Compare your results from Part 4 and Part 5, and then explain.

The time at which the two tanks have the same amount of salt is also the time at which Tank B has the most salt.  The reason is that Tank A’s salt content is constantly decreasing, so it can only give Tank B the level of salinity currently in its own tank.

Problem 2

Normally, if we draw two random lines in a plane, they will intersect at a single point.  What happens if we take three lines and plot them.  What do you think the chances are of all three points intersecting at single point?

Part 1

Consider the following two lines:
y=6x+5
y=-3x+4
Find where these two lines intersect by using the Solve command.

Solve[{y==6x+5,y==-3x+4},{x,y}]

Part 2

Plot both of the lines, and verify that your solution is indeed where the two lines intersect.

Plot[{6x+5,-3x+4},{x,-2,2}, Epilog->{Red,PointSize[Medium],Point[{-1/9,13/3}]}]

Part 3

Verify that the following three lines do not have a single point of intersection.
y=6x+5
y=-3x+4
y = -x+1

We can examine this problem in two ways.  The first is algebraically using the Solve command.  The result it { }, which is the empty set (no solution).

Solve[{y==6x+5,y==-3x+4,y==-x+1},{x,y}]

We can also graph all three lines, noting that they do not all intersect at a single point.

Plot[{6x+5,-3x+4,-x+1},{x,-2,3}]

Part 4

Find a value for b such that the following three lines do intersect at a single point.
y=6x+5
y=-3x+4
y = -x+b

We know that the first two lines intersect at the point (-(1/9),(13/3)), so if we plug this point into the third line, then we can find the value of b which makes this work.  The value is b=(38/9).

Solve[13/3==1/9+b,b]

Part 5

Plot all three lines on the same graph to verify that they all intersect at the same point.

Plot[{6x+5,-3x+4,-x+38/9},{x,-2,2}, Epilog->{Red,PointSize[Medium],Point[{-1/9,13/3}]}]

Problem 3

The following table gives the total number of people fully vaccinated in Oklahoma over a window of time in September of 2021:

({{Day (in September),  People Fully Vaccinated }, {7, 1768580}, {8, 1776861}, {9, 1781639}, {10, 1788373}, {11, 1794448}, {12, 1801334}, {13, 1805668}, {14, 1808630}, {15, 1814425}, {16, 1820228}, {17, 1826304}, {18, 1832097}, {19, 1838725}, {20, 1842711}, {21, 1845303}, {22, 1849881}, {23, 1855558}})

Data was gathered from: https://github.com/owid/covid-19-data/tree/master/public/data/vaccinations

VaccineData =  {{7, 1768580},{8,1776861},{9,1781639},{10,1788373},{11,1794448},{12,1801334},{13,1805668},{14,1808630},{15,1814425},{16,1820228},{17,1826304},{18,1832097},{19,1838725},{20,1842711},{21,1845303},{22,1849881},{23,1855558}};

Part 1

Plot the data.  Be sure to label your axes appropriately.

ListPlot[VaccineData, PlotStyle->Blue, PlotMarkers->{"▽",16}, AxesLabel->{"Day of September", "Oklahomans Vaccinated"}, Joined->False]

Part 2

Compute the rate of change for the data.

ROCVaccineData  =Table[{StringForm[" `` to `` ",VaccineData  [[ i]][[1]],VaccineData  [[i+1]][[1]]],(VaccineData  [[i+1]][[2]]-VaccineData  [[i]][[2]])*1.0/(VaccineData  [[i+1]][[1]]-VaccineData  [[i]][[1]])},{i,1,Length[VaccineData  ]-1}];

TableForm[ROCVaccineData ,TableHeadings->{None,{"Change in Day","Change in Vaccinations (people/day)"}}]

Part 3

On what day from the data set was there the greatest increase in vaccinations?

The maximum increase occurs from September 7th to September 8th, where there was an added 8,281 people fully vaccinated.

Part 4

What is the average rate of change in the number of people vaccinated over the entire period of time in the data set.

N[(VaccineData[[-1,2]]-VaccineData[[1,2]])/(VaccineData[[-1,1]]-VaccineData[[1,1]])]

The average rate of change is approximately 5,436 people/day.

Part 5

There were 1,859,672 fully vaccinated Oklahomans on September 24th.  Is this number greater or less than expected based on the rate of change from September 22nd to September 23rd?

The rate of change from September 22nd to September 23rd was 5,677.  The change in vaccinated people from September 23rd to the 24th is:

1859672-VaccineData[[-1,2]]

5677-4114

Thus, the number of people vaccinated by September 24th is less than expected by 1563 people if we use the rate of change from the 22nd to the 23rd to estimate the number of people vaccinated by the 24th.

Problem 4

Time for a “Let’s find something fun to do with Mathematica” problem.

Part 1

Have Mathematica create an interpolation function based on the data set VaccineData from Problem 3.  Look up “Interpolation” in the Help menu.

F = Interpolation[VaccineData]

Part 2

Evaluate the interpolating function from Part 1 at 24 (i.e. if you called the function from part 1 F, evaluate F[24]).  This will be the approximation to the total number of Oklahomans full vaccinated by September 24th.

F[24]

Part 3

Use the rate of change from September 22nd to the 23rd from Problem 4 to estimate the value of fully vaccinated people on the 24th.

The average rate of change from the 22nd to the 23rd was 5,677, so we add this to the vaccinated population total from the 23rd, this gives: 1,861,235

VaccineData[[-1,2]]+5677

Part 4

The answers to Parts 2 and 3 are not equal, so what can you conclude about the interpolating function with regards to average rates of change?

The interpolating function does not simply use the average rate of change from day to day to evaluate the next value.