Math 1483 - Quiz 4

<=/Solutions\=>

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

Problem 1

We  have  two 100 gallon tanks, call them tank A and tank B.  Tank A has 50 lbs of salt dissolved in it, and tank B has 300 lbs of salt in it.  The tanks are connected by two tubes, the first pumps water from tank A to tank B at a rate of 5 gallons/minute, while the second moves water from tank B to tank A at 2 gallons/minute.  Furthermore, water is pumped into tank A from an outside source at a rate of 3 gallons/minute, and the salinity of this water is 1 lb of salt/gallon.  Tank B has a spigot which is open, and water pours out of it at a rate of 5 gallons/minute.


The amount of salt in Tank A (measured in liters), as a function  of t (in minutes), is given by:
A(t) = -25 (e^(-(t/20)-(t/(10 (Sqrt[10])))))-20 (Sqrt[10]) (e^(-(t/20)-(t/(10 (Sqrt[10])))))-25 (e^(-(t/20)+(t/(10 (Sqrt[10])))))+20 (Sqrt[10]) (e^(-(t/20)+(t/(10 (Sqrt[10])))))+100 (e^(-(t/20)+(t/(10 (Sqrt[10])))-(1/100) (-5+(Sqrt[10])) t))

The amount of salt in Tank B (measured in liters), as a function of t (in minutes), is given by:
B(t) = 100 (e^(-(t/20)-(t/(10 (Sqrt[10])))))+25 (Sqrt[(5/2)]) (e^(-(t/20)-(t/(10 (Sqrt[10])))))+100 (e^(-(t/20)+(t/(10 (Sqrt[10])))))-25 (Sqrt[(5/2)]) (e^(-(t/20)+(t/(10 (Sqrt[10])))))+100 (e^(-(t/20)+(t/(10 (Sqrt[10])))-(1/100) (-5+(Sqrt[10])) t))

A[t_]:=-25 (E^(-(t/20)-(t/(10 (Sqrt[10])))))-20 (Sqrt[10]) (E^(-(t/20)-(t/(10 (Sqrt[10])))))-25 (E^(-(t/20)+(t/(10 (Sqrt[10])))))+20 (Sqrt[10]) (E^(-(t/20)+(t/(10 (Sqrt[10])))))+100 (E^(-(t/20)+(t/(10 (Sqrt[10])))-(1/100) (-5+(Sqrt[10])) t));
B[t_]:=100 (E^(-(t/20)-(t/(10 (Sqrt[10])))))+25 (Sqrt[(5/2)]) (E^(-(t/20)-(t/(10 (Sqrt[10])))))+100 (E^(-(t/20)+(t/(10 (Sqrt[10])))))-25 (Sqrt[(5/2)]) (E^(-(t/20)+(t/(10 (Sqrt[10])))))+100 (E^(-(t/20)+(t/(10 (Sqrt[10])))-(1/100) (-5+(Sqrt[10])) t));

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 lbs of salt in Tank A at the start, and 300 lbs in Tank B, the computations above agree with the setup.

Part 2

So no peeking ahead at part 3 here.  Clearly the functions which define A(t) and B(t) are pretty complicated looking.  However, if you look at the problem and consider how the tanks are set up, how much salt should each tank have in it if this system is allowed to run for a very long time.  Note: you will NOT be marked off for an incorrect answer here, you just need to think about the problem and give a justification for what you think will happen.

Over time, the original amount of salt will not matter. Water with a ratio of 1 lb of salt/gallon is being pumped into the system via the first tank, and the mixture is being dumped out of the second tank.  Thus, over time, we should assume that each tank should end up with about 100 lbs in each of their 100 gallon tanks.

Part 3

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

Plot[{A[t],B[t]},{t,0,100},AxesLabel->{"time (min)", "salt (lbs)"},PlotLegends->{"Tank A", "Tank B"}, PlotRange->{{0,100},{40,310}}]

Part 4

Explain how the graphs given in part 3 agree (or disagree) with your intuition (part 2) 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 starts off with 50 lbs of salt in its 100 gallon tank, while tank B starts off with 300 lbs of salt in its 100 gallon tank.  As they mix, salt will transfer from tank B to tank A since tank A has less salt than tank B.  At the same time, tank B’s salinity is decreasing not only due to mixing with tank A, but because it is receiving a weaker salinity mixture from an outside source.  Now repeat the argument from part 2 to complete the description!

Part 5

Modify your graph from part 3 to include the limiting value each function tends to.

Plot[{A[t],B[t], 100},{t,0,100},AxesLabel->{"time (min)", "salt (lbs)"},PlotLegends->{"Tank A", "Tank B", "limiting value"}, PlotRange->{{0,100},{40,310}}]

Part 6

Do the two tanks ever have the same salinity (lbs of salt/gallon)?

From the graph from part 5, the answer appears to be ‘no’. We can use the NSolve and Reduce commands to check our answers. From the output below, the answer is still indeed ‘no’.

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

Reduce[A[t]==B[t],t, Reals]

Part 7

Create a three-column table with the values of t, A(t), and B(t) for 0<= t <= 200 minutes by increments of 10 minutes.  Be sure to express entries in the the columns corresponding to A(t) and B(t) in decimal form.

TableForm[Table[{t,N[A[t]],N[B[t]]},{t,0,200,10}] ,TableHeadings->{None,{"t minutes","Salt in Tank A (lbs)", "Salt in Tank B (lbs)"}}]

Part 8

Is there a time at which tank A has the limiting value of 100 lbs of salt in it?

From the table from part 7, it appears that this occurs somewhere between 10 and 20 minutes. Using the NSolve command, we see it happens at approximately 13.2 minutes.

NSolve[A[t]==100,t,Reals]

Part 9

Is there a time at which tank B has the limiting value of 100 lbs of salt in it?

From the table from part 7, it appears that this never occurs. Using the NSolve command returns the empty set { }, thus there is no solution.

NSolve[B[t]==100,t,Reals]

Part 10

At what time does tank A have a maximum amount of salt?

From the table from part 7, it appears that this occurs somewhere between 30 and 50 minutes. Using the Maximize command, we see it happens at approximately 36.8 minutes, with a value of just over 115 lbs of salt.

N[Maximize[{A[t],t>= 0},t]]

Part 11

At what time does tank B have a maximum amount of salt?

Tank B’s maximum occurs at t=0 since it is then mixed with water which has lower salinity thereafter.

N[Maximize[{B[t],t>= 0},t]]

Part 12

On what time interval is the amount of salt in tank B between 150 and 250 lbs?

We use the Reduce command, as shown below, and this gives us a time range of 5.76 <= t <= 28.19 minutes.

Reduce[150.0 <= B[t] <= 250.0,t,Reals]

Problem 2

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

({{Day (in November),  People Fully Vaccinated }, {1, 1983104}, {2, 1984181}, {3, 1987280}, {4, 1990041}, {5, 1992503}, {6, 1994874}, {7, 1997888}, {8, 2000242}, {9, 2001258}, {10, 2003393}, {11,  }, {12, 2008936}, {13, 2010706}, {14, 2012852}, {15, 2014148}, {16, 2014904}, {17, 2017058}})

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

VaccineData =  {{1, 1983104},{2,1984181},{3,1987280},{4,1990041},{5,1992503},{6,1994874},{7,1997888},{8,2000242},{9,2001258},{10,2003393},{12,2008936},{13,2010706},{14,2012852},{15,2014148},{16,2014904},{17,2017058}};

Part 1

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

ListPlot[VaccineData, PlotStyle->Blue, PlotMarkers->{"▽",16}, AxesLabel->{"Day of November", "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 November 2nd to November 3rd, where there was an added 3,099 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 2,122 people/day.

Part 5

There was no data for November 11th, and the rate of change from the 10th to the 12th was 2771.5.  If we assume that this increase does include data from the 11th, find the equation of the line through the two points corresponding to the data on November 10th and November 12th.

The rate of change from November 10th to the 12th was 2,771.5, this is the slope of the line through the two points.  Now we simply plug this into the equation of a line.  For this, we will use point slope: y-(Subscript[y, 0]) = m(x-(Subscript[x, 0])), or y = m(x-(Subscript[x, 0]))+(Subscript[y, 0]).  This gives the equation: y = 2771.5(t-10) + 2003393 , where t is a variable measuring the days past November 10th.

VLine[t_]:= 2771.5(t-10) + 2003393;

VLine[t]

Part 6

Use the rate of change from November 10th to the 12th to create a new data point for November 11th. (Note: If you are having a hard time getting Mathematica to give you a proper number without exponents, try using the DecimalForm command!)

The rate of change from November 10th to the 12th was 2,771.5, so we simply take the value on November 10th and add 2,771.5 to it. We can also simply evaluate the line from part 5 at t=11. Either way, the number of fully vaccinated people on November 11th we approximate to be 2,006,165.

VaccineData[[10]]

DecimalForm[N[VaccineData[[10]][[2]]*1.0+2771.500,6]]

DecimalForm[VLine[11]]

Problem 3

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 2.  Look up “Interpolation” in the Help menu.

F = Interpolation[VaccineData]

Part 2

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

The result here is 2,006,225 fully vaccinated Oklahomans by November 11th.

F[11.0]

DecimalForm[F[11.0]]

Part 3

Compare your result from part 2 to part 6 of the previous problem.  Do they agree? What can you conclude about the interpolating function with regards to average rates of change?

The two values are different.  Using the linear rate of change, we ended up with a value of 2,006,165, while the interpolating function gives a value of 2,006,225.   Thus, we may conclude that the interpolating function does not simply use the average rate of change from day to day to evaluate the next value.