2. Mathematical Models
2.1 A Discrete in Time
Model
2.1 A Continuous in
Time Model
3. Algorithm
for a Discrete in Time Model
3.1 Pseudocode
3.2 C Code
3.3 Fortran Code
4. Computational
Experiments and Model Refinements
4.1 Computational
Experiments
4.2 Model Refinements
A mathematical model can be described as a set of equations or expressions which describe some physical phenomenon. Mathematical models are frequently used to describe the state of a physical system as the system evolves in time. As a concrete example of a physical system, consider a rock dropped with initial velocity V0 (meters/second) from a height of Z0 (meters). So that we can formulate a very simple mathematical model describing this physical system, we make the simplifying assumptions that (1) air resistance is zero and (2) the gravitational force is constant.
This document has two main goals: (1) present mathematical models of a simple physical phenomenon and (2) describe some mathematical modeling terminology.
In our example the physical system is a rock dropped with initial velocity V0 from a height of Z0. In a mathematical model, the state variables are quantities that characterize the behavior of the physical system. In the case of a falling rock, the state of the physical system is completely characterized by the velocity of the rock and the vertical distance that the rock has traveled from its release point. The state of the system will evolve with time, i.e., the rock will fall. As a consequence the state variables in our model, the rock height and the rock velocity, are time dependent.
The input variables, output variables, and parameters for our mathematical model of the falling rock are
The distinction between input variables and parameters is somewhat arbitrary. One could argue that the gravitational constant should be an input variable. The point of view often adopted is that input variables characterize a single physical problem and parameters determine the context or setting of the physical problem. For example two falling rock problems with different input variables are: (1) drop the rock from 1000 meters; and (2) throw the rock downward with velocity 2 meters/second from a height of 500 meters. The reason for classifying the gravitational constant as a parameter is that it defines the context of the problem. That is, the gravitational constant does not change from one falling rock problem to another as long as we are near the earth's surface. If we were to move our falling rock experiment to the moon, then the value of the gravitational constant would change.
Quantity |
Symbol |
Units |
| time | t | seconds |
| acceleration due to gravity | g (g=9.8) | meters/second/second |
| velocity of the rock | V or V(t) | meters/second |
| rock height (distance above ground) | Z or Z(t) | meters |
| initial velocity of the rock | V0 or V(0) | meters/second |
| initial height of the rock | Z0 or Z(0) | meters |
Velocity: Velocity equals the rate of change of position.
Acceleration: Acceleration equals the rate of change of velocity.
These last two sentences are the physical principles from which we will develop two mathematical models for a falling rock.
<----- h -----> --x-------|-------x-------|-------x-------|-------x-- (t-axis) t0 t1/2 t1 t3/2 t2 . . .
The points on the t-axis marked with the symbol
The grid we have defined is called a uniform grid or a regular grid since each pair of adjacent grid points are separated by a constant time interval. This time interval between grid points, h, is called the time step, the grid spacing or the mesh spacing.
Following the notation introduced in Figure 1, we can represent an arbitrary grid point on the t-axis by
In the notation table of Section 2.3, we have chosen to denote the physical
height and velocity of the rock by Z(t) and V(t), respectively. A common
notational convention in mathematical modeling is to use variables of an
opposite case to denote the mathematical model approximations of physical
quantities. Following this convention, we define zi to be a
numerical approximation to Z(ti) and vi to be a
numerical approximation to
To continue our development of a mathematical model of a falling rock, recall that if an object moves along a line at a constant rate R for a time T, then the object moves a distance D. In words, "distance traveled (D) equals rate (R) multiplied by time (T)", or
Put another way, if the initial position of the object is PI and the new position of the object T seconds later is PN, then
Similarly, if an object moves along a line at an initial rate of RI and accelerates at a constant rate A for a time interval T then its new velocity is given by
Equations (1) and (2) are special cases of the governing physical principles stated in Section 2.4.
Recall that V0 is the initial velocity of the rock. Let
Similar reasoning for successive points marked " | " yields
Now we turn to the part of the mathematical model which deals with
estimating the position of the rock as it falls. Recall that Z0 is the initial
height of the rock. If the initial velocity is zero or negative (downward),
then during the time interval
Now that we have assumed a constant fall rate during
Similar reasoning for successive grid points marked " x " in Figure 1 yields
Equations (3a,b) and (4a,b) are the core of our discrete in time mathematical model for a falling rock. We will postpone the discussion of how to implement this mathematical model until Section 3.
Z'(t) = V(t), Z(0) = Z0
where the prime ' denotes differentiation with respect to time.
Those who have studied calculus will recognize that the exact solution to the above mathematical model is given by
Later we will compare the mathematical model predictions from the discrete in time method with the continuous in time method.
Algorithm: Discrete in Time Mathematical Model of a Falling Rock
Step 1. Document
This algorithm uses the discrete in time mathematical model defined by Equations (3a,b) and (4a,b) to approximate the velocity and height of a rock dropped with initial velocity V0 from an initial height of Z0. The model is based on the assumptions that (1) air resistance is negligible and (2) acceleration due to gravity is constant.
INPUT
V0 -- initial velocity (double precision)
Z0 -- initial height (double precision)
g -- gravitational constant of acceleration (double precision)
h -- time step (double precision)
imax -- number of time steps to perform (integer)
OUTPUT
for i = 0 to imax
if height is positive print:
ti -- t-value a time step i (double precision)
zi -- approximate height at time ti (double precision)
vi -- approximate velocity at time ti (double precision)
AUXILIARY VARIABLES
vi_left -- approximate velocity at time ti - .5*h (double precision)
vi_right -- approximate velocity at time ti + .5*h (double precision)
i -- loop counter (integer)
Step 2. Initialize numerical solution at t = 0
Set ti = 0
vi = V0
zi = Z0
Print ti, vi, zi
Step 3. Calculate velocity at t = .5*h
Set vi_left = V0 - 0.5*g*h
Step 4. Begin time stepping
For i = 1,2,...,imax
Do steps 5-7
Step 5. Advance solution one time step
Set ti = ti + h
zi = zi + vi_left*h
vi_right = vi_left - g*h
vi = .5*(vi_left + vi_right)
Step 6. Output numerical solution
If zi < 0, print "rock is on the ground" and terminate calculation
else
Output ti, zi, vi
Step 7. Prepare for next time step
Set vi_left = vi_right
This C source code for implementing the pseudocode of Section 3.1 was developed and tested using the gnu C compiler. The format string " %lf " for dealing with variables of type double may have to be changed to read " %f " when the code is compiled by other compilers.
Here is Fortran source code implementation of the pseudocode of Section 3.1.
To become familiar with the behavior of the discrete in time mathematical model for a falling rock, perform the following experiments.
Experiment 1. Compile the C or Fortran code. Then make several
runs with
Experiment 2. Compile the C or Fortran code. Choose
Experiment 3. Modify the C or Fortran code so that the modified code prints out the difference between the continuous in time model and the discrete in time model at each grid point. Run the modified code for various choices of Z0, V0 and h. What do you conclude about the accuracy of the discrete in time model?
would this produce the correct qualitative behavior? Can you find the exact solution to a continuous in time model with the above expression for V'(t)? Can you support such a modeling assumption based on a force balance between the gravitational force and the frictional (due to air resistance) force acting on the rock?
Many other similar modeling assumptions will produce mathematical models in which a terminal velocity is attainable. For example,
will result in a falling rock mathematical model with a terminal velocity. How does a modeler know which mathematical model is a better description of the physical problem?
Model Refinement 2. Suppose it has been observed that the falling rock does not continue to accelerate, but instead reaches a terminal velocity of VMAX. In the discrete in time model, if we make the modeling assumption that
and
would this produce the correct qualitative behavior? Can you modify one of the source codes to incorporate the above modeling assumption?
Model Refinement 3. After reading the spring-mass modeling project, can you reformulate the falling rock model based on Newton's 2nd Law and the definition of velocity? If you assume that air resistance increases in proportion to fall velocity, can you give a force balance argument that leads to a discrete in time model in which the rock reaches a terminal velocity? Repeat for the continuous in time model, if you have studied calculus.