is partially coupled system and can be solved by first solving the first equation and then substituting the solution into the second equation, which can then be solved.

To be able to use Sage to solve systems of the form

Mixing problems model how substances flow back and forth between two or more compartments. These problems often arise in applications—for example, we might want to model how greenhouse gases flow back and forth between different layers of the earth's atomosphere[17], how chemicals move between tanks in a refinery or a brewery, or how pollutants move between a series of lakes or ponds. Systems of differential equations can prove very useful when it comes to modeling such situations.

Subsection2.4.1Partially Coupled Systems

We will use linear systems of differential equations such as

to illustrate how we can use systems of differential equations to model how substances flow back and forth between two or more compartments. Suppose that we have two tanks (\(A\) and \(B\)) between which a mixture of brine flows (Figure 2.4.1). Tank \(A\) contains 300 liters of water in which 100 kilograms of salt has been dissolved and Tank \(B\) contains 300 liters of pure water. Fresh water is pumped into Tank \(A\) at the rate of 500 liters per hour, and brine is pumped into Tank \(B\) from Tank \(A\) at the rate of 500 liters per hour. Brine is also drained at a rate 500 liters of brine per hour from Tank \(B\text{.}\) All brine mixtures are well-stirred. If we let \(x = x(t)\) be the amount of salt in Tank \(A\) at time \(t\) and \(y = y(t)\) be the amount of salt in Tank \(B\) at time \(t\text{,}\) then we know that

We know that the salt concentrations in the two tanks are \(x/300\) kilograms per liter and \(y/300\) kilograms per liter. Thus, we can describe the rate of change in each tank with a differential equation,

then each equation is an autonomous first-order equation. To solve our system, we only need to solve two first-order equations. Such a system is said to be decoupled. Generalizing slightly, we say that a partially coupled system is a system of the form

Since the first equation is an autonomous first-order equation in \(x\text{,}\) we can solve this equation separately, and substitute our solution into the second equation.

Consider the system

\begin{align*}
\frac{dx}{dt} & = x \\
\frac{dy}{dt} & = x + y.
\end{align*}

We can easily solve the first equation, \(dx/dt = x\text{,}\) to obtain \(x = a e^t\text{.}\) Using this information in the second equation, we have

\begin{equation*}
\frac{dy}{dt} - y = a e^t
\end{equation*}

which is a first-order linear equation. This equation has an integrating factor \(\mu(t) = e^{-t}\text{,}\) and

\begin{equation*}
\frac{d}{dt} (e^{-t} y) = \mu(t) \left(\frac{dy}{dt} - y \right)= a e^t \mu(t) = a.
\end{equation*}

Therefore, the solution to our second equation is

\begin{equation*}
y(t) = at e^t + be^t.
\end{equation*}

Revisiting the mixing problem that we posed at the beginning of this section, we have the following initial value problem,

Solving \(dx/dt = - (5/3) x\) is easy. We can quickly determine that \(x(t) = c_1 e^{-5t/3}\text{.}\) Applying the initial condition \(x(0) = 100\text{,}\) we can determine that \(c_1 = 100\) and \(x(t) = 100 e^{-5t/3}\text{.}\) Our second equation now becomes

\begin{equation*}
\frac{dy}{dt} = \frac{5}{3} x - \frac{5}{3} y = \frac{500}{3} e^{-5t/3} - \frac{5}{3} y.
\end{equation*}

This last equation is a first-order linear equation

\begin{equation*}
\frac{dy}{dt} + \frac{5}{3} y = \frac{500}{3} e^{-5t/3}.
\end{equation*}

Multiplying both sides of this last equation by the integrating factor \(\mu(t) = e^{5t/3}\) yields

Notice that we already have the tools to solve \(x' = 2x\text{.}\) In fact, the solution is \(x(t) = c_1 e^{2t}\text{.}\) We can use this information to solve the second equation, \(y' = x + 3y\text{.}\) That is, if we use the fact that \(x(t) = c_1 e^{2t}\text{,}\) the second equation becomes

is much more difficult, since we cannot use the same strategies that we used to solve partially-coupled systems. We will devote all of Chapter 3 to finding an answer. However, we can use Sage to solve linear systems for the moment. The following is a Sage interact that will solve the initial value problem

is a specific case of a damped harmonic oscillator, where \(m = 1\text{,}\) the spring constant is 2, and the damping constant is 3. We can rewrite this equation as a first-order linear system,

Suppose that \(x(0) = 0\) is the initial position of the mass and \(v(0) = 1\) is the initial velocity. We can use Sage to verify that the solution to our system is

This is an example of an over-damped harmonic oscillator (Figure 2.4.4). In other words, a spring-mass system that is modeled by this system of equations has so much damping that the mass will not oscillate.

Now let us relax the damping and increase the spring constant on our harmonic oscillator,

is a partially coupled system. Since the first equation is an autonomous first-order equation in \(x\text{,}\) we can solve this equation separately, and substitute our solution into the second equation.

Suppose that we have two tanks (\(A\) and \(B\)) between which a mixture of brine flows. Tank \(A\) contains 200 liters of water in which 20 kilograms of salt has been dissolved and Tank \(B\) contains 200 liters of water in which 10 kilograms of salt has been dissolved. Fresh water is pumped into Tank \(A\) at the rate of 200 liters per hour, and brine is pumped into Tank \(B\) from Tank \(A\) at the rate of 200 liters per hour. Brine is also drained at a rate 200 liters of brine per hour from Tank \(B\text{.}\) All brine mixtures are well-stirred. Find the amount of salt in each tank at time \(t\text{.}\)

3.

For each of the following harmonic oscillators (1) rewrite the second-order initial value problem as a system of two first-order linear equations, (2) use Sage to solve the system of linear equations, and (3) classify the harmonic oscillator as underdamped, critically damped, or overdamped.