Wichita State University Logo

Math 555: Differential Equations

2.3 Modeling with First Order Differential Equations


2.3.1 Modeling the Physical World

Differential equations are very useful in investigating various systems. Due to their nature of expressing rates of change, they are used to study many problems in the biological, social, and physical sciences. This is done primarily through the construction of models, which are simplified or idealized representations of a system that are used to study or predict its behavior.

Here are the common steps to the development and use of a mathematical model:

1. Construct the Model

Model construction begins with some assumptions about the system. This could be a physical principal such as an object moving subject to Newton's laws of motion or that bacteria populations grow at a rate proportional to their current population. Both of these involve a rate of change, a derivative, and leads naturally to the statement of a differential equation.

It is important to note that any model constructed will be limited by the assumptions made about the principals in play. For instance, a model assuming Newton's laws of motion will be ineffective when talking about object moving close to the speed of light (where Einstein's special relativity is required) or if the bacteria population has food or environment size restrictions that inhibit its growth. The key is to make sure that the assumptions in play are tracking the primary features of the system and to make adjustments if necessary.

2. Analyze the Model

After constructing the model, it is time to apply it to systems to solve differential equations or to determine properties of the solution if the differential equation is too difficult to solve directly. Sometimes, the assumptions made in the model are still too complex and require further simplification to produce a tractable differential equation. Typical refinements are to approximate a nonlinear equation with a linear one or to replace a coefficient with small variance by a constant.

Any such changes need to be examined from a common sense or physical standpoint to make sure that the additional assumptions or simplifications do not fail to reflect the primary nature of the system. Advanced knowledge of the physics governing the systems you wish to study will help in the determination of the correct principles to base a mathematical model on, or how to make additional simplifications if required.

3. Compare with Observations

The ultimate test of any mathematical model is to compare its results with that of the actual system. Whenever you look at the solution presented by a model, ask yourself "does this make sense?". Solutions generated by the model should obey the basic physical assumptions of the system, for instance, your bacterial growth model should have massive population if the population is large.

If the predictions made by the model are very inconsistent with measurements made of the actual system, then adjustments to the model are necessary. Reevaluate the assumptions being made in the model and determine if they are consistent with the behavior you desire to simulate.

Lastly, remember that every model has limitations. Even a good model will break down if the boundaries of its assumptions are pushed.


Let's look at some examples of these models.

2.3.2 Mixing

Suppose that a solute (e.g. salt) is being dissolved in a solvent (water) to make a solution (salt water) in a large tank. Animated Image of Mixing Tank

A solution with a given concentration (mass of solute per volume of solvent) enters the tank at the top at a specified rate and is mixed with the contents of the tank. At the bottom, the mixed solution exits the tank at the same rate. For the purposes of the model, we are assuming the total volume of solution in the tank remains constant and that mixing happens instantaneously.

The independent variable of the problem is time $t$ and the dependent variable is the total mass of solute in the tank $Q(t)$. To construct our model, we are going to focus on the total mass of the solute in the tank, looking at rate the solute enters and leaves the tank. This looks like

$$ \dfrac{dQ}{dt} = \text{rate in} - \text{rate out}. $$

Let's do a specific example to put this into practice.

2.3.3 Mixing Example Problem

At time $t=0$, a tank contains $Q_0$ lb of salt dissolved in 100 gal of water. Suppose that a salt water solution containing $\frac{1}{5}$ lb of salt per gallon is entering the tank at a rate of $r$ gal/min and the mixed solution is exiting the tank at the same rate. Set up the initial value problem that describes this process, and do the following:

  1. Find the amount of salt $Q(t)$ in the tank at any time $t$
  2. Find the limiting amount of salt $Q_L$ that is present after a long time
  3. If $r=4$ and $Q_0 = 2Q_L$, find the time $T$ after which the salt level is within 2% of $Q_L$
  4. Find the flow rate required if this threshold must be met within 60 minutes
Video Solution

2.3.4 Another Mixing Example

Suppose that a tank contains 100 gal of water and 50 oz of salt. Water containing a varying concentration of salt given by $\displaystyle\frac{1}{4}\left(1 + \frac{1}{2}\sin t\right)$ oz/gal flows into the tank at a rate of 2 gal/min. The mixture flows out of the tank at the same rate.

  1. Find the amount of salt in the tank at any time $t$.
  2. Plot the solution for a period of time long enough to be able to infer the ultimate behavior of the graph.
  3. The long-term behavior of the solution is an oscillation about a certain constant level. What is this level? What is the amplitude of the oscillation?

Try this one on your own, then check your work.

Check Your Work
  1. $$ Q(t) = 25 + \dfrac{25}{5002}\left(\sin t - 50\cos t\right) + \dfrac{63150}{2501}e^{-\frac{t}{50}} $$

  2. Plot provided in Video Solution.
  3. The level is 25 oz. The amplitude of the oscillation is $\dfrac{25}{5002}\sqrt{2501}\approx 0.25$

Video Solution

2.3.5 Finance with Payments and Withdrawals

Continuously compounded interest is another common situation modeled by a differential equation. A sum of money $S$ grows according to a relative rate of change (interest rate) $r$ governed by the following differential equation:

$$ \dfrac{dS}{dt} = rS $$
The solution to this is quite simple, $S(t) = S_0 e^{rt}$. However, we would like to study what happens to the solution in the face of regular payments to or withdrawals from the sum to model situations like saving for retirement, investing in stocks, paying a mortgage, student loan debt, etc. To do this, we modify the question by adding a factor $k$, which is positive if payments are being added to the sum and negative if withdrawals from the sum are made.

$$ \dfrac{dS}{dt} = rS + k$$
This equation first-order linear and may be rewritten in standard form

$$ \dfrac{dS}{dt} - rS = k$$
and solved using an integrating factor $e^{-rt}$:
$$ \begin{aligned} \dfrac{d}{dt}\left[ e^{-rt}S \right] &= ke^{-rt} \\ e^{-rt}S &= C -\frac{k}{r}e^{-rt} \\ S(t) &= Ce^{rt} - \frac{k}{r}. \end{aligned} $$
Finally, applying the initial condition $S(0) = S_0$ yields

$$ S(t) = S_0e^{rt} + \frac{k}{r}\left(e^{rt} - 1\right). $$

With the equation in this form without specified values, it is possible to now plug in different starting sums, interest rates, and payment/withdrawal values to obtain the solutions to different problems.

2.3.6 Retirement Savings

Suppose that recent college graduate with no initial investment capital has started to save for retirement. This individual will be investing \$2000 per year at a 8% rate of return. How long will it take for this person to save $1 million for retirement?

In [1]:
t  = linspace(0,50,50);
k  = 2000;
r  = 0.075;
S0 = 0;
S  = S0*exp(r*t) + (k/r)*(exp(r*t) - 1); % solution to the ODE
plot(t, S) 
xticks(0:5:50)
yticks(0:2e5:1.2e6)
yticklabels({'$0','$200,000','$400,000','$600,000','$800,000','$1,000,000','$1,200,000'})
ylabel('Total Savings')
xlabel('Years')
grid on

       

Now that we've seen that it takes nearly 50 years at this investment level to save for retirement, we can ask questions about what the effects of changing the interest rate or investment level slightly are.

In [2]:
t  = linspace(0,50,50);
k  = 2500; % investing $500 more a year
r  = 0.075;
S0 = 0;
S  = S0*exp(r*t) + (k/r)*(exp(r*t) - 1); % solution to the ODE
plot(t, S) 
xticks(0:5:50)
yticks(0:2e5:1.2e6)
yticklabels({'$0','$200,000','$400,000','$600,000','$800,000','$1,000,000','$1,200,000'})
ylabel('Total Savings')
xlabel('Years')
grid on

       
In [3]:
t  = linspace(0,50,50);
k  = 2000; 
r  = 0.08; % a half-percent increase in rate of return
S0 = 0;
S  = S0*exp(r*t) + (k/r)*(exp(r*t) - 1); % solution to the ODE
plot(t, S) 
xticks(0:5:50)
yticks(0:2e5:1.2e6)
yticklabels({'$0','$200,000','$400,000','$600,000','$800,000','$1,000,000','$1,200,000'})
ylabel('Total Savings')
xlabel('Years')
grid on

       

Of course, the best way to perform this sort of analysis is directly manipulating the solution to the differential equation, but these figures do put one very important thing into perspective. The "last 10 years" of growth on this chart are massively important to the overall value of the investment.

Start saving early!

Creative Commons Logo - White


Your use of this self-initiated mediated course material is subject to our Creative Commons License .


Creative Commons Attribution-NonCommercial-ShareAlike 4.0

Creative Commons Logo - Black
Attribution
You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

Creative Commons Logo - Black
Noncommercial
You may not use the material for commercial purposes.

Creative Commons Logo - Black
Share Alike
You are free to share, copy and redistribute the material in any medium or format. If you adapt, remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.