Professional Documents
Culture Documents
CVE 154 Lesson 1 Introduction To Numerical Solutions
CVE 154 Lesson 1 Introduction To Numerical Solutions
CVE 154 Lesson 1 Introduction To Numerical Solutions
LESSON 1:
INTRODUCTION TO
NUMERICAL SOLUTIONS
NUMERICAL SOLUTIONS
Numerical methods or solutions are techniques developed to
solve mathematical problems using only the four basic arithmetic
operations of addition, subtraction, multiplication and division.
+ – * /
These techniques require a large number of arithmetic
calculations to be performed repeatedly until an appropriate
answer with minimal error is arrived. Luckily, with the use of
computers, this task is now made easier. Hence, the usage of
these techniques to solve engineering problems have increased.
NUMERICAL SOLUTIONS
The mathematical problems we will be learning how to solve with
numerical solutions are the following types:
Given:
𝑑𝑥 Δ𝑥
≅ = 𝑓 𝑡, 𝑦
𝑑𝑡 Δ𝑡
Solve for y as a function of t
𝑦𝑖:1 = 𝑦𝑖 + 𝑓 𝑡𝑖 , 𝑦𝑖 Δ𝑡
MATHEMATICAL MODELING
A mathematical model can be broadly defined as a formulation or equation
that expresses the essential features of a physical system or process in
mathematical terms. In general sense,
𝐷𝑒𝑝𝑒𝑛𝑑𝑒𝑛𝑡 𝑖𝑛𝑑𝑒𝑝𝑒𝑛𝑑𝑒𝑛𝑡 𝑓𝑜𝑟𝑐𝑖𝑛𝑔
=𝑓 , 𝑝𝑎𝑟𝑎𝑚𝑒𝑡𝑒𝑟𝑠,
𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒𝑠 𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒𝑠 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛𝑠
where:
dependent variable = is a characteristic that usually reflects the behavior or
state of the system
independent variable = are usually dimensions, such as time and space,
along which the system’s behavior is being determined
parameters = are reflective of the system’s properties or composition
forcing functions = are external influences acting upon the system
MATHEMATICAL MODELING
Take Newton’s 2nd Law 𝐹 = 𝑚𝑎. Writing it in the same format, we get:
𝐹
𝑎=
𝑚
where:
𝑎 = acceleration (the dependent variable reflecting the systems behavior)
𝐹 = net force (the forcing function)
𝑚 = mass (a parameter reflecting a property of the system)
Note that there is no independent variable, since we are not yet predicting how
acceleration varies with time and space.
This model in its algebraic form is very simple. Hence, a solution can be easily
solved without the use of numerical solutions.
MATHEMATICAL MODELING
To demonstrate a more complex mathematical model of a
physical phenomena, we derive a model that modifies
Newton’s 2nd Law. For example, if we are asked to
determine the terminal velocity of a free falling body near
the earth’s surface such as a parachutist.
Let us represent the acceleration the parachutist
experiences as the rate of change of velocity with respect
to time:
𝑑𝑣
𝑎=
𝑑𝑡
From the figure, we can see 2 external forces that affect the
system. Assuming forces directed downwards are positive,
the net force the body experiences is :
𝐹 = 𝐹𝐷 + −𝐹𝑈
𝐹 = 𝐹𝐷 − 𝐹𝑈
MATHEMATICAL MODELING
In this system, the downward force 𝐹𝐷 would be due to gravity
𝐹𝐷 = 𝑚𝑔
where 𝑔 is the acceleration due to gravity.
The upward force 𝐹𝑈 would be due to air resistance (drag). This is usually
represented by a linear relationship between force and velocity of the body.
Imagine you are riding a car. When you lower the windows and extend your
hand outside, you would suddenly feel that your hand is being pushed back by
some imaginary force. Then, as the car speeds up, the force pushing your
hand back would also feel stronger. This is air resistance that you are feeling.
The relationship can be written by setting a parameter 𝑐 (drag coefficient)
that takes into account all factors that makes the air resistance proportional to
velocity.
𝐹𝑈 = 𝑐𝑣
Substituting all these that we have derived into the original equation for
Newton’s 2nd Law:
MATHEMATICAL MODELING
𝐹
Newton’s 2nd Law: 𝑎=
𝑚
𝑑𝑣 𝑚𝑔 − 𝑐𝑣
=
𝑑𝑡 𝑚
𝑑𝑣 𝑐
=𝑔− 𝑣
𝑑𝑡 𝑚
The resulting mathematical model that we have derived is an ordinary
differential equation (ODE). The exact solution for the velocity of the falling
parachutist cannot be obtained using simple algebraic manipulation.
ANALYTICAL SOLUTION
To get the exact or analytical solution, we would need to deploy advance
techniques in calculus. Recall the technique of separation of variables.
𝑑𝑣 𝑐
=𝑔− 𝑣
𝑑𝑡 𝑚
𝑑𝑣
𝑐 = 𝑑𝑡
𝑔− 𝑣
𝑚
𝑐 𝑐
𝑙𝑛 −1 + 𝑣 + 𝐶𝐿 = − 𝑡 + 𝐶𝑅 𝐶𝐿 and 𝐶𝑅 are constants
𝑔𝑚 𝑚
𝑐 𝑐
𝑙𝑛 ;1: 𝑣 ; 𝑡: 𝐶𝑅 ; 𝐶𝐿
𝑒 𝑔𝑚 =𝑒 𝑚
𝑐 𝐶𝑅 ; 𝐶𝐿 ;
𝑐
𝑡
−1 + 𝑣=𝑒 𝑒 𝑚
𝑔𝑚
𝐶𝑅 ; 𝐶𝐿
Let a constant 𝑘 = 𝑒 , we get
𝑐 ;
𝑐
𝑡
−1 + 𝑣=𝑘𝑒 𝑚
𝑔𝑚
𝑐 ;
𝑐
𝑡
𝑣 =1+𝑘𝑒 𝑚
𝑔𝑚
𝑔𝑚 ;
𝑐
𝑡
𝑣= 1+𝑘𝑒 𝑚
𝑐
ANALYTICAL SOLUTION
Therefore, the general solution to the problem is:
𝑔𝑚
𝑣 𝑡 = 1 + 𝑘 𝑒 ; 𝑐/𝑚 𝑡
𝑐
To get the particular solution, we need some initial conditions to evaluate the
value of the constant 𝑘. For example if the parachutist is initially at rest, then
𝑣 0 = 0 at time 𝑡 = 0.
𝑔𝑚
0= 1 + 𝑘 𝑒 ; 𝑐/𝑚 0
𝑐
𝑐
0 = 1+𝑘 1
𝑔𝑚
𝑘 = −1
ANALYTICAL SOLUTION
Therefore, the particular solution to the parachutist problem is:
𝑔𝑚
𝑣 𝑡 = 1 − 𝑒 ; 𝑐/𝑚 𝑡
𝑐
where:
𝑣 𝑡 = velocity (dependent variable)
𝑡 = time (independent variable)
𝑐 = drag coefficient (parameter)
𝑚 = mass (parameter)
𝑔 = acceleration due to gravity (forcing function)
Next, we will apply this solution we have derived to a specific problem.
SAMPLE PROBLEM
EXAMPLE 1: ANALYTICAL SOLUTION:
A parachutist of mass 68.1 kg jumps We insert the known values into the
out of a stationary hot air balloon. Use equation. To make it less confusing, we will
𝑔𝑚 not write units in the equation. However,
𝑣 𝑡 = 1 − 𝑒 ; 𝑐/𝑚 𝑡 take note that the equation must be
𝑐
to compute the terminal velocity the dimensionally homogeneous (units must be
parachutists reaches before he opens his the same or related).
chute. The drag coefficient is equal to 9.8 68.1
𝑣 𝑡 = 1 − 𝑒 ; 12.5/68.1 𝑡
12.5 kg/s. Use 9.8 m/s2 as the value for 12.5
acceleration due to gravity. 𝑣 𝑡 = 53.3904 1 − 𝑒 ;0.183553597𝑡
Using the equation, plot the curve
formed for time t=0 to t=20 seconds. Note that terminal velocity of a free falling
Use an interval of 2 seconds. body is the maximum velocity that can be
reached by that body as it falls freely to the
ground. After it is reached, acceleration will
stop and the velocity remains constant. This
means even if the time is increased, velocity
will not change.
SAMPLE PROBLEM
Looking at the formula, we can easily get the terminal velocity. We can do this by letting
the time t approach ∞ (infinity). If this happens, the value of the exponential
𝑒 ;0.183553597𝑡 would approach zero.
lim 𝑣 𝑡 = lim 53.3904 1 − 𝑒 ;0.183553597𝑡 = 53.3904
𝑡→∞ 𝑡→∞
time t velocity v
(s) (m/s) Velocity Curve of the Parachutist up to t=20 s
0 0.0000 60.0000
2 16.4050
50.0000
4 27.7693
6 35.6418 40.0000
8 41.0953
30.0000 Velocity curve
10 44.8731
Terminal Velocity
12 47.4902 20.0000
14 49.3031
10.0000
16 50.5590
18 51.4290 0.0000
0 5 10 15 20 25
20 52.0317
NUMERICAL SOLUTION
We use finite divided difference to approximate the first derivative of velocity with
respect to time (slope of the curve) to the slope of a line within a finite interval.
𝑑𝑣 Δ𝑣 𝑣 𝑡𝑖:1 − 𝑣 𝑡𝑖
= =
𝑑𝑡 Δ𝑡 𝑡𝑖:1 − 𝑡𝑖
where:
Δ𝑣 = difference in velocities
Δ𝑡 = difference in time
𝑣 𝑡𝑖 = velocity at initial time 𝑡𝑖
𝑣 𝑡𝑖:1 = velocity at a later time 𝑡𝑖:1
NUMERICAL SOLUTION:
Just like the analytical solution, the parachutists is initially at rest. Therefore, at the start,
𝑣 𝑡𝑖 = 0 at time 𝑡𝑖 = 0. The time interval considered is 2 seconds.
For 𝑖 = 1 𝑎𝑛𝑑 𝑖 + 1 = 2: 𝑣 𝑡1 = 0, 𝑡1 = 0 and 𝑡2 = 2
12.5
𝑣 𝑡2 = 0 + 9.8 − 0 2 − 0 = 19.60 𝑚/𝑠
68.1
SAMPLE PROBLEM
For 𝑖 = 2 𝑎𝑛𝑑 𝑖 + 1 = 3: 𝑣 𝑡2 = 19.6, 𝑡2 = 2 and 𝑡3 = 4
12.5
𝑣 𝑡3 = 19.60 + 9.8 − 19.60 4 − 2 = 32.00 𝑚/𝑠
68.1
For 𝑖 = 3 𝑎𝑛𝑑 𝑖 + 1 = 4: 𝑣 𝑡3 = 32.00, 𝑡3 = 4 and 𝑡4 = 6
12.5
𝑣 𝑡4 = 32.00 + 9.8 − 32.00 6 − 4 = 39.87 𝑚/𝑠
68.1
To speed up calculations, we will use Excel.
time t i velocity v i time t i+1 velocity v i+1 Velocity Curve of the Parachutist up to t=20 s
(s) (m/s) (s) (m/s)
60.0000
0 0.0000 2 19.6000
2 19.6000 4 32.0047 50.0000
4 32.0047 6 39.8555
40.0000
6 39.8555 8 44.8243
8 44.8243 10 47.9690 30.0000 Velocity curve
50.0000
40.0000
20.0000
10.0000
0.0000
0 5 10 15 20 25
Looking at the chart, we can see a considerable difference in the results. This
is because the numerical solution assumes straight lines to approximate the
curved line of the analytical or exact solution.
COMPARISON (Δt = 0.1 seconds)
To remedy this problem, we can select a very small value for the step size of the
numerical solution. For example, lets try a step size Δt = 0.1s The following are the
values for both analytical and numerical solution for the first 4 seconds.
50.0000
40.0000
20.0000
10.0000
0.0000
0.0 5.0 10.0 15.0 20.0 25.0
REFERENCE
Chapra, S. C., & Canale, R. P. (2010). Numerical Methods for
Engineers (6th Edition). McGraw-Hill.
THE END