Here we will look at setting up DEs for various applications.

## Mixtures

Suppose a tank contains a mixture with some initial concentration. There can be flows coming in and out of the rank at
different rates and concentrations. Overall, the change in concentation is:

\( \cfrac{dA}{dt} = rate_{in} - rate_{out} \)

Chocolate containing \( 0.04 \frac{kg}{L} \) of almonds enters a tank at a rate of \(3 \frac{L}{hr}\).
The mixture is well mixed and drains at a rate of \( 5 \frac{L}{hr} \). The tank originally has \(100 L\) containing \(1 \; kg\) of
almonds. Write a DE and describe how to solve for \(A(t)\) the amount of almonds at time \(t\).

Show Answer
We set up the equation as rate in less rate out. We will also assume the mixture is homogeneous.

\( \cfrac{dA}{dt} = rate_{in} - rate_{out} \)

The rate in is:

\( rate_{in} = 0.04 \frac{kg}{L} \cdot 3 \frac{L}{hr} = 0.12 \frac{kg}{hr}\)

The rate out depends on the total amount (kg) divided by the volume (L). Since the rate in is 3 and the rate out is 5, the volume will
decrease \(2 \frac{L}{hr} \):

\( rate_{out} = \frac{A}{100-2t} \frac{kg}{L} \cdot 5 \frac{L}{hr} = \frac{5A}{100-2t} \frac{kg}{hr}\)

The DE for this model is:

\( \cfrac{dA}{dt} = 0.12 - \frac{5A}{100-2t} \)

This is a linear DE that is not separable. You can solve it by putting it in standard form and finding an integration factor:

\( \cfrac{dA}{dt} + \frac{5A}{100-2t} = 0.12 \)

\( \cfrac{dA}{dt} + \frac{5}{100-2t}A = 0.12 \)

\( P(t) = \frac{5}{100-2t} \)

\( \mu(t) = e^ {\int \frac{5}{100-2t} dt } \)

The initial value condition here is:

\( A(0) = 1 \)

## Radioactive Decay

A radioactive element decays at a constant rate proportional to the nunmber of remaining nuclides:

\( \frac{dN}{dt} = -kN \)

This is a linear DE that is separable. It can be solved by direct integration:

\( N = N_0 e^{-kt} \)

Where \(N_0\) is the initial amount in grams of number of nuclides.

## Electric Circuits

A series circuit with a resistor and inductor has the following DE:

\( L \cfrac{di}{dt} + Ri = E \)

This is a linear DE that is also separable:

\( \cfrac{di}{E - Ri} = \cfrac{dt}{L}\)

\( \ln {(E - Ri)} = c_1 - \cfrac{Rt}{L}\)

\( E - Ri = c_2e^{\cfrac{-Rt}{L}}\)

\( Ri = E - c_2e^{\cfrac{-Rt}{L}}\)

\( i(t) = \cfrac{E}{R} + C e^{\cfrac{-Rt}{L}}\)