Computational Methods in Engineering Che 374

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

CHE 374 – Lec # 2 Modelling Examples

Using Newton’s 2nd law to determine the terminal


velocity of a free falling body near the earth’s surface

FR Upward force
Computational Methods in Engineering
ChE 374

Modelling Examples

FD Downward force

1 2

The mathematical model for this case is derived by


expressing the acceleration as a time rate of Forces Acting on a free falling sphere
change of velocity (a = dv/dt)

dv F Downward force due to gravity


 (4)
dt m
Where v is the velocity in m/s and t is time in seconds (s)
FD  mg (6)

Now, let’s express the net force in terms of measurable


variables and parameters.

m = mass of the body


F  FD  FR (5) g = gravitational acceleration = 9.81 m/s2

3 4

CHE 374 - Computational Methods in Engineering 1


CHE 374 – Lec # 2 Modelling Examples

Forces Acting on the Falling Object The net force is the difference between the
downward force and the upward force
Air Resistance Linear
approximation
Air resistance is proportional to velocity: dv F mg  kv
  (8)
dt m m
Linear
approximation FR   kv (7)
or
dv k
k = proportionality constant
g v (9)
(drag coefficient kg/s for linear) dt m
accounts for properties of the falling body
e.g. shape, surface roughness, etc. A mathematical model which relates to the acceleration of a
5
falling object to Forces acting on it !!! 6

Example # 1
If the object is initially at rest (v = 0 at t = 0), we can use
calculus to find the solution of the differential equation:
Analytical solution to the falling sphere
Problem statement
dv k A sphere of mass 20 g is falling in a large environment
g v Use the equation developed (equation 10) to compute
dt m the velocity of the sphere. The resistance coefficient
as is k = 0.015 kg/s.
gm
v (t ) 
k

1  e 
k /m t
 (10) SOLUTION
v(t ) 
gm
1  e( k / m)t 
The velocity at any time is given by
k
Where:
v(t )  dependent variable 9.81(20  103 )
Inserting parameters in the model v(t ) 
0.015
 3
1  e (0.015/2010 ) t 
t  the independent variable
k, m  parameters
g  the forcing function v(t )  13.11  e0..75t 
7 8

CHE 374 - Computational Methods in Engineering 2


CHE 374 – Lec # 2 Modelling Examples

We can use the model to compute v at different times Plot of velocity vs. time
t, s v, m/s
0 0 14
Terminal velocity
1 6.91 12

2 10.18 10

Velocity (m/s)
3 11.72 8

4 12.45 6

4
5 12.79
2
10 13.09
0
20 13.10 0 5 10 15 20
Terminal T im e (s)
Net force=0  13.10 Velocity
a=0 9 10

gm Numerical Methods
v(t ) 
k
1  e  ( k / m )t 
• Numerical methods are techniques by
which a mathematical problem is re-
• The equation is called an analytical or exact
solution because it satisfies the original formulated so that it can be solved by
differential equation exactly. arithmetic operations !!!!
• Many mathematical models cannot be
solved exactly
• Alternative is to develop a numerical solution
that approximates the exact solution !!! Let’s reformulate the falling sphere problem so that
it can be solved by arithmetic operations !!!

11 12

CHE 374 - Computational Methods in Engineering 3


CHE 374 – Lec # 2 Modelling Examples

Approximation of DERIVATIVES
Substitute in equation (9) to obtain
rate change of velocity

dv v
 true slope
dt t
v(ti 1 )

 v(ti )
Approximate slope
v v(ti 1 )  v(ti )
t

ti 1  ti
Which can be rearranged to yield

(12)

ti

dv v v(ti 1 )  v(ti )
ti 1

(11)
The differential equation has been transformed into an
equation that can be solved algebraically at different times
  using the slope and previous values of v and t
dt t ti 1  ti 13 14

Example # 2

Numerical solution of the falling object problem For the next interval (from t = 0.5 to 1.0 s), the
Problem statement: computation is repeated, with the result
• Perform the same computation as in example #1 but
use equation (12) to compute the velocity  0.015 
v(1)  4.90  9.8  (1) (1  0.5)  7.97 m/s
 20 103 
Solution:
At the start of the computation (ti = 0), the velocity of the sphere is
The computations are repeated in similar fashion
zero. Using this information and parameter values from example #1, t,s 0 0.5 1 1.5 2 2.5 3.0 inf
equation (12) can be used to compute the velocity at ti+1 = 0.5 s:
v, 0.00 4.90 7.97 9.87 11.83 12.30 12.59 13.10
m/s
 0.015 
v (0.5)  0  9.8  (0)  (0.5  0)  4.9 m/s
 20  103  The REPETITION Process is called ITERATION in
numerical lingo !!
15 16

CHE 374 - Computational Methods in Engineering 4


CHE 374 – Lec # 2 Modelling Examples

We can compare the analytical and


ALGORITHMS
numerical solutions graphically !!
14 Approximate (numerical) solution • The concept of algorithms is central
12
to numerical analysis
10 • An algorithm is a precisely defined
Numerical
sequence of steps for performing a
Velocity (m/s)

8 Analytical Exact (analytical) solution

6
specified task.
4
• We shall develop and implement
2
algorithms for computing approximate
solutions to mathematical problems
0
0 0.5 1 1.5 2 2.5
Time (s)
3 3.5 4 4.5 5
relevant to engineering !!
17 18

ISSUES Components of Algorithms


• To determine the conditions under • Algorithms developed will differ in the
which an algorithm is expected to work number of steps, complexity or general
objectives. However, they will consist of
• How accurately the solution produced
the following basic components
by an algorithm approximates the exact
solution
• INPUT
• How various parameter values affect • OPERATIONS
algorithm performance • OUTPUT

19 20

CHE 374 - Computational Methods in Engineering 5


CHE 374 – Lec # 2 Modelling Examples

Step size h = 1 s Step size h = 2s


14 20
Numerical
18 Analytical
12
16
10
14
Velocity (m/s)

Numerical 12

Velocity (m/s)
8
Analytical
10
6
8

4 6

4
2
2

0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0
0 2 4 6 8 10 12 14 16 18 20
Time (s)
Time (s)

21 22

Step size h= 4s Step size h = 0.01s


14

500 12

Numerical
400 10
Analytical

Velocity (m/s)
300 8

Numerical
Velocity (m/s)

200 Analytical 6

100 4

0 2

-100 0
0 2 4 6 8 10 12 14 16 18 20
Time (s)
-200
0 2 4 6 8 10 12 14 16 18 20
Time (s)

23 24

CHE 374 - Computational Methods in Engineering 6

You might also like