Você está na página 1de 21

MODELLING CONCEPTS

Case-studies

1. A bouncing ball 3. Emptying a tank

2. Falling bodies

ENG2028M, Spring 2008

“Some schools may have eradicated ‘fail grades’ and given you as long as you want to
get the right answer…. This bears NO resemblance to reality!!”
Bill Gates

Copyright  2003, by G.F Rosala


A bouncing ball 1

The problem A ball falling from an initial height. Model the maximum height reached
by the ball after each bounce
The Fundamental Principle involved Energy balance
Assumption 1 The initial height is small
Consequence 1.1 The maximum velocity of the ball
is small
Consequence 1.2 The air resistance can be neglected

Assumption 2 The impact surface is smooth, plane,


perpendicular to the falling ball and rigidly attached to the
Earth
Consequence 2.1 The change in the Earth’s kinetic
energy after each impact can be neglected (the object
is hugely larger than the ball)

Copyright  2003, by G.F Rosala


A bouncing ball 2

m Assumption 3 The collision is NOT perfectly elastic


Consequence 3.1
Kinetic energy Kinetic energy
=k x
after collision before collision
g
The restitution coefficient k < 1
h0
hn-1
Building the mathematical model
hn
m vn2 = km vn2−1
n-1 n Next, employ the conservation of energy principle: mv 2 = m g h
m g hn = k m g hn −1
vn-1
Validity question?
Leading to: hn = k n h0
n = 1 k = 0 h1 = 0
vn k = 1 h1 = h0

n Task: Identify variables, parameters and the forcing function

Copyright  2003, by G.F Rosala


A bouncing ball - results

The bouncing ball model

20.00

18.00

16.00

14.00 k=0.9
12.00 k=0.8
k=0.7
10.00
k=0.6
8.00 k=0.5
k=0.4

Height of bounces
6.00
Parameter study: 4.00

2.00
 Initial height – constant
0.00
0 5 10 15 20 25
 0.4 ≤ k ≤ 0.9
Number of bounces

Copyright  2003, by G.F Rosala


Falling bodies 1

The problem Model the velocity of a falling body close to the Earth’s surface

The Fundamental Principle “The time rate of change of momentum of a body equals
the resultant force acting upon it”.
Isaac Newton – The Second Law of Motion

d dv
m
( )v = m = ma = F
dt dt
m
Assumption The body is subjected to a downwards force FD
g
only, due to the gravitational acceleration field (free-fall model).
FD = m g

The velocity model: v( t ) = g t


Independent
Dependent variable
(state) variable Forcing
function

Copyright  2003, by G.F Rosala


Falling bodies 2

The velocity model: v( t ) = g t

g
FD = m g
This is what
we’ve modelled

This is what
really happens!

Validity question – how well does this model represent the reality?

Copyright  2003, by G.F Rosala


Falling bodies 3

An improved model

FU Assumption 1 The body is subjected to the downwards force FD and


to an upwards force FU , due to the resistance of the air.
Net force acting on the body
m dv
m = FD − FU
dt
g The assumption requires a “drag force” local model (submodel)!
FD = m g
Assumption 2 The upwards force FU , the drag force, is proportional
to the velocity of the body.
FU = −cv
Second
parameter
The velocity model: dv + c v = g
dt m
First
parameter

Copyright  2003, by G.F Rosala


Falling bodies 4

First computational model: Analytical solution


Applying the "integrating factor" technique an analytical explicit
FU solution for the velocity can be found:
m
v=g 1 − e −ct m 
m c  

g Validity question – how well does this model represent


FD = m g the reality?
v=0 at t = 0
v = gm / c at t = ∞
Weights
Terminal velocity

velocity
Feather
Terminal velocity

time

Copyright  2003, by G.F Rosala


Falling bodies 5

Second computational model: Numerical solution

FU From the velocity model, the rate of change of velocity (slope) is


given by:
dv c
=g− v
m dt m

g An explicit approximation for the future velocity value, based on


current value of the velocity, can be evaluated using Euler’s method
FD = m g
True slope
dν/dt
 c 
vti +1 = vti +  g − vti  ( ti +1 − ti )
νti+1  m 
∆ν Approximate Future = Current + slope x step size
slope value value
ν ti ∆ν/∆t
dv ∆v vti +1 − vti
ti Time The approximation: ≅ =
ti+1 dt ti ∆t ti +1 − ti
∆t

Copyright  2003, by G.F Rosala


Falling bodies - results

Models for predicting the velocity of a falling body

120
FU Modelling error v=gt

90 Truncation and
discretisation
errors
 c 
m v t + δt = v t +  g − v t  δ t
60  m 

Velocity (m/s)
30 c
FD = m g g m − t
v= 1 − e m 
c  
0
0 3 6 9 12
Time (s)

analytical numerical no_drag_force

All results are contaminated by round-off and data uncertainty errors!

Copyright  2003, by G.F Rosala


Falling bodies – truncation errors
Taylor’s formula:
(ti +1 − ti )2 + v ''' (ti +1 − ti )3 + L
vti+1 = vti + vt'i (ti +1 − ti ) + vt''i ti
FU 2! 3!
In Euler’s approximation we’ve used Taylor’s formula truncated after the
m first derivative: vti +1 = vti + vt′i ( ti +1 − ti ) + R1
The Lagrange reminder
g 2
The exact value of the velocity derivative: (t − t )
v′′ (ξ ) i +1 i
FD = m g
2!
vti +1 − vti R1

vti = −
( ti+1 − ti ) ( ti +1 − ti ) Truncation error
v′′ (ξ )
Truncation error = ( ti+1 − ti ) = O ( ti+1 − ti )
2!
 The velocity estimate via Euler’s method has a truncation error of order (t i+1 - t i )
 The truncation error is proportional to step size; by halving the step size the
truncation error is halved.

Copyright  2003, by G.F Rosala


Falling bodies
DIRECTED STUDY 1
FU = c v 2
Modify the falling bodies numerical model to account for
a drag force FU proportional with the square of the falling
m velocity.

g
FD = m g
DIRECTED STUDY 2

Solve the skydiver problem using the Excel framework as


developed in the workbook “1.2_Falling_bodies.xlsm”,
worksheet “Directed Study”.

Copyright  2003, by G.F Rosala


Emptying a tank 1

The problem A tank is emptied through a short pipe of diameter “d”. Model the
effect of the size of "d" on the discharging rates of the tank

The Fundamental Principles involved Mass and energy balance

Assumption 1 The fluid is incompressible


D
Consequence 1.1 The volume of the fluid doesn’t
change with pressure

π D2 π D2 πd2
The mass balance: hnew ρ = hold ρ − vδ tρ
4 4 4
h d

v hnew − hold d2 dh d2
Leading to =− 2v → =− 2v
δt D dt D
v – fluid’s exit velocity, δt – time increment

Copyright  2003, by G.F Rosala


Emptying a tank 2

D Assumption 2 The discharging pipe is short


Consequence 2.1 The effect of the friction between
the fluid and the pipe can be zeroed
Consequence 2.2 The velocity of the fluid is constant
across the surface of the pipe
h d
Assumption 3 The hydrostatic pressure is constant across
v the surface of the pipe
m v2
The energy balance: mgh =
2
Leading to v = 2 g h
dh d2
m And finally our mathematical model: = − 2 2g h
dt D
Task: Identify variables, parameters and the forcing function

Copyright  2003, by G.F Rosala


Emptying a tank 3

The mathematical model:


D
dh d2 d
= − 2 2g h = −R2 2g h → R=
dt D D

First computational model: Euler’s method


dy
h d = f ( x, y ) → y = ϕ ( x , y )
dx
yi +1 = yi + ( xi +1 − xi ) f ( xi , yi )
v
Applying Euler’s method to our mathematical model
dh
f (t, h) = = −R2 2 g h → h = ϕ ( t, h)
dt
gives an explicit solution for the instantaneous height of the fluid in the tank, with initial
conditions h = h0
hi+1 = hi + (ti+1 − ti ) f (ti , hi )

Copyright  2003, by G.F Rosala


Emptying a tank 4
Second computational model: The fourth-order Runge-Kutta
method - uses a sampling of slopes through the interval and
takes a weighted average to determine the next point.
D
dy
= f ( x , y ) → y = ϕ ( x, y )
dx
1
yi +1 = yi + ( k1,i + 2k2,i + 2k3,i + k4 )
6
h d With the coefficients, k, given by:

v k1,i = δ x f ( xi , yi ) k2,i = δ x f ( xi + 12 δ x, yi + 12 k1,i )


k3,i = δ x f ( xi + 12 δ x, yi + 12 k2,i ) k4,i = δ x f ( xi + δ x, yi + k3,i )

Applying Runge-Kutta’s method to our model gives an explicit solution for the
instantaneous height of the fluid in the tank, with initial conditions h = h0
1
hi +1 = hi + ( k1,i + 2k2,i + 2k3,i + k4,i ) with kn,i = f δ t, − R2 2 g h
( )
6
n = 1,..,4 δt = ti +1 − ti

Copyright  2003, by G.F Rosala


Emptying a tank – results 1

D 1
0.9
0.8 RK_R0.1
0.7 RK_R0.05
0.6 RK_R0.02
RK_R0.01
0.5
Euler_R0.01
h d 0.4 Euler_R0.02

Fluid height (m)


0.3 Euler_R0.05
0.2 Euler_R0.1
v
0.1

d 0
R= 0 20 40 60 80 100
D Time (s)

R = 0.1, 0.05, 0.02, 0.01 Parameter / method analysis

Comment: Higher order methods deliver a better accuracy where dealing with steep
changes of field variables.

Copyright  2003, by G.F Rosala


Emptying a tank – results 2

1
D
0.9
0.8 RK_0.02_5
0.7 Euler_0.02_5
0.6 RK_0.1_5
Euler_0.1_5
0.5
RK_0.02_20
h d 0.4 Euler_0.02_20

Fluid height (m)


0.3 RK_0.1_20
0.2 Euler_0.1_20
v 0.1
0
d 0 20 40 60 80 100
R=
D Time (s)

R = 0.1, 0.02 Step = 5s, 20s Time step / method sensitivity analysis

Comment: Higher order methods require additional computational effort but are less
sensitive to an increase in the time step.

Copyright  2003, by G.F Rosala


Emptying a tank – further work
1. Exit pipe with friction
Velocity profile for flow
without friction, vmax
Fluid-pipe friction leads to a variable velocity
profile in the pipe.
Velocity profile for flow
The mass balance: with friction, v = v(r) vmax

hnew − hold d2 dh d2
= − 2 vav → = − 2 vav
δt D dt D

dh d2
= − 2 Cv vmax Average velocity
dt D vav = Cv vmax

Turbulent flow: Cv = 0.5


The energy balance: Laminar flow: Cv = 0.83 - 0.71
2
mvmax v max = 2 gh
mgh =
2
dh d2
The mathematical model: Microsoft Excel
= − 2 Cv 2 g h
dt D Worksheet

Copyright  2003, by G.F Rosala


Emptying a tank – further work
2. Tanks with feed-
feed-back / return flow Q
Q
For non-zero return flows the mass balance equation
needs adjusting.
The mass balance: A1
h
A1 hnew ρ = A1 hold ρ − A2 v δ t ρ + Q δ t ρ A2
v
hnew − hold A Q dh A Q
=− 2 v+ → =− 2 v+
δt A1 A1 dt A1 A1

The energy balance: mv2


mg h = → v = 2gh
2
dh A2 Q
The mathematical model: = − 2gh +
dt A1 A1
DIRECTED STUDY 3
Develop a model for emptying a tank with return flow and exit pipe with friction using
the framework in the workbook “1.3_Empty_tank.xlsm”, worksheet “Directed Study”.

Copyright  2003, by G.F Rosala


Appendix: The fourth-order Runge-Kutta formulation

The fundamental theorem of calculus:


xn+1
'
y ( xn +1 ) − y (xn ) = ∫ y (x ) dx
xn

Simpson’s formula gives:

h ' ' h ' 


y ( xn +1 ) − y (xn ) ≈ y ( x n ) + 4 y  x n +  + y ( x n +1 )
6   2 

To approximate the slope y’(x+1/2h) at midpoint we split the midterm in two,


h ' ' h ' h ' 
y ( xn +1 ) − y (xn ) ≈ y ( x n ) + 2 y  x n +  + 2 y  x n +  + y ( x )
n +1 
6   2  2 
and replace the true slopes with the following approximations:

 h  1 1 
y '  xn +  ≈
y ' ( xn ) ≈ f ( xn , yn ) = k1 f  xn + h, yn hk1  = k 2
 2  2 2 
 h  1 1 
y '  xn +  ≈ f  xn + h, yn hk 2  = k3 y ' ( xn +1 ) ≈ f (xn +1 , yn hk3 ) = k 4
 2  2 2 

Copyright  2003, by G.F Rosala

Você também pode gostar