# Solving chemicals mixing in a tank using differential equations

Gasoline is stored in tanks with diameter $40\,\rm m$ and height $15\,\rm m$. Tank #5 is initially $50\%$ full with $92$-Octane fuel. The fuel is being drained at a rate of $500\,\rm m^3$ per hour (approximately $30$ large trucks). The tank is being filled with $87$-Octane fuel from the pipeline, at the rate of $3000\,\rm m^3$ per hour. Assuming fuel additives mix evenly, how long (in hours) until the fuel in tank #5 is $91$-Octane?

Apologies for repeatedly asking questions. I have started by letting $x$ be the amount of octane in $\rm kg$ and have the differential equation:

$$\frac{dx}{dt}=\big(\text{rate in} \cdot \text{concentration in}\big)-\big(\text{rate out} \cdot \text{concentration out}\big)$$

rate in and out are given in $m^3$, but I could not find a way to describe the changes in concentration. I have attempted to solve for the ratio of $92$ and $87$ octane needed using $92x+87(1-x)=91$ and found that we needed $80\%$ of $92$-Octane and $20\%$ of 87-Octane, but I'm not sure how this relates to the question or is even useful at all.

The change of volume is $3000\pi-(5000-3000)t$. Any hints to how I can describe the change in concentration using the information given in the question to complete the differential equation?

• 210 hours is incorrect. Volume, V(t) = {0.5*pi*r^2*h + (3000 - 500)t} m^3 At t=210 hours, V(210) = {0.5*pi*20^2*15 + (2500)(210)} m^3 = 534424.778 m^3 The maximum volume in the tank is only pi*20^2*15 = 18849.556 m^3 You have overfilled the tank by 515575.222 m^3 Use the hint I provided in the handout. – user305897 Jan 17 '16 at 21:17
• According to the hint, we are suppose to try and set up the differential equation in the form of $\frac{total chemicals}{volume}$, but is the volume the total volume of the container or just the volume of the chemicals? Assuming it is the total volume, we would just proceed to set $x$ as 92 octane and $y$ as 87 octane and then the differential equation would look something like $\frac{\frac{x}{x+y}+\frac{y}{x+y}}{6000pi}=\frac{dV}{dt}$? But the $\frac{dV}{dt}=0$ because the volume itself doesn't change... – in0ru Jan 19 '16 at 3:04

Let $x$ be the amount of $92$ octane in the tank and $y$ be the amount of $87$ octane in the tank, both in $m^3$. Each is a function of time and the total volume is $x+y$. Then $\frac {dx}{dt}=500\frac x{x+y}$ because the left represents the amount of $92$ octane removed in a short amount of time. Similarly, $\frac {dy}{dt}=3000-500\frac y{x+y}$. Solve this coupled set and find the time when $\frac xy=0.8$
• I understand the $500 \frac{x}{x+y}$ is the amount of 92 octane leaving, but why is the left side of equation $x+y \frac{dx}{dt}$? – in0ru Jan 16 '16 at 18:24
• There is a period you are missing. The $x+y$ is the total volume in the ank. The left side is just $\frac {dx}{dt}$ – Ross Millikan Jan 16 '16 at 18:30
• Thank you for pointing that out, I thought I was a mistyped multiplication sign. I directly integrated the first equation and applied integrating factors to the second. The $t$ variable is cancelled out in the second differential equation so I plugged in the initial condition to complete the equations and solved for $t$ using $x=0.8y$ and got 210 hours (seems reasonable). Thank you for your help! – in0ru Jan 16 '16 at 18:56