You are on page 1of 28

208271

ComputerMethodsforMechanicalEngineering
By S. Tachasomboonsuk

Chapter 1
Mathematical Modeling, Numerical
Methods, and Problem Solving

1
2
1.1 A SIMPLE MATHEMATICAL MODEL

A mathematical model can be broadly defined as a formulation or


equation that expresses the essential feature of a physical system
or process in mathematical term.
Dependent independent forcing
f , parameters, (1.1)
variable variable functions

The dependent variable is a characteristic that usually reflects the


behavior or state of the system.
The independent variable are usually dimension, such as time and
space.
The parameters are reflective of the systems properties or composition.
The forcing functions are external influences acting upon system.
3
Characteristics of Mathematical Models of the physical
world
It describes a natural process or system in mathematical
terms.
It represents an idealization and simplification of reality.
Finally, it yields reproducible results and, consequently,
can be used for predictive purposes.

4
Forcesactingonafreefallingbungeejumper.
Figure1.1 Mathematical Model

dv cd 2
g v
dt m
where v = vertical velocity (m/s)
t = time (s)
g = the acceleration due to gravity
9.81 m/s2
cd = a second order drag coefficient (kg/m)
m = the jumpers mass (kg)

This is a differential equation, the


calculus might be used to obtain an
analytical or exact solution for v as function
of t.
5
PROOF From the newtons second law

F ma (1.2)

Where F is the net force acting on the body (N, or kg m/s2)


m is the mass of the object (kg)
a is its acceleration (m/s2)

Can be rewritten as
F (1.3)
a
m
Where F is the forcing function
m is a parameter
a is the dependent variable reflecting the systems
6
behavior
Because the acceleration as the time rate of change of the
velocity dv / dt ,so
dv F (1.4)

dt m
Where v is velocity (m/s)

The net force is compose of two opposing force: the


downward pull of gravity FD and the upward force of air
resistance FU .
(1.5)
F FD FU
FD mg The force due to gravity (1.6)

Where g is the acceleration due to gravity (9.81 m/s2)

7
FU c d v 2 air resistance (1.7)

Where cd is a proportionality constant called the drag


coefficient (kg/m).

Therefore Eqs. (1.4) through (1.7) can be combined to


yield
dv cd 2
g v (1.8)
dt m
It is a differential equation because it is written in terms of
the differential rate of change (dv/dt). If the jumper is
initially at rest (v = 0 at t = 0), calculus can be used to solve.
Eq (1.8) for
gm gc d (1.9)
v t tanh t
cd m
8
Where tanh is the hyperbolic tangent that can be either
compute directly or via the more elementary exponential
function as in
e x ex
tanh x x (1.10)
e e x

Note Eq. (1.9) is cast in the general form of Eq. (1.1) where
v(t) is the dependent variable, t is the independent variable,
cd and m are parameters, and g is the forcing function.

9
EXAMPLE 1.1 Analytical (close- form) Solution to the
Bungee Jumper Problem

Problem Statement. A bungee jumper with a mass of 68.1 kg


leaps from a stationary hot air balloon. Use Eq(1.9) to compute
velocity for the first 12 s of free fall. Also determine the
terminal velocity that will be attained for an infinitely long
cord. Use a drag coefficient of 0.25 kg/m.

Solution. Inserting the parameters into Eq.(1.9) yields

9.81 68.1 9.81 0.25


v(t ) tanh t 51.6938 tanh 0.18977t
0.25 68.1

10
Which can be used to compute
t, s v, m/s
0 0
2 18.7292
4 33.1118
6 42.0762
8 46.9575
10 49.4214
12 50.6175
51.6938

11
TheanalyticalsolutionforthebungeejumperproblemascomputedinExample1.1.Velocityincreaseswith
timeandasymptoticallyapproachesaterminalvelocity.
Figure1.2

Note after a sufficiently long time , a constant velocity , called


the terminal velocity , of 51.6983 m/s (115.6 mi/h)
12
Numerical Methods
Numerical Methods are those in which the mathematical
problem is reformulated so it can be solved by arithmetic
operations.

The time rate of change of velocity can be approximated


by (Fig. 1.3)
dv v v t i 1 v t i (1.11)

dt t t i 1 t i

Where v andt are differences in velocity and time


computed over finite intervals, v(ti) is velocity at an initial
time ti, and v(ti+1) is velocity at some later time ti+1.

13
Theuseofafinitedifferencetoapproximatethefirstderivativeof withrespecttot.
Figure1.3

1-3 14
dv v
From calculus that lim
dt t 0 t

Eq. (1.11) is called a finite divided difference approximation


of the derivative at time ti. It can be substituted into Eq. (1.8)
to give
v t i 1 v t i c
g d v t i
2

t i 1 t i m
And can be rearranged to yield

cd 2
v t i 1 v t i g v t i t i 1 t i (1.12)
m

dv / dt

15
Thus, the equation can be rewritten as
dvi
vi 1 vi t (1.13)
dt
Where vi designates velocity at time ti

t t i 1 t i
Thus, we can see that can be used to determine the velocity
algebraically at ti+1 using the slope and previous values of v
and t. This new value of velocity at ti+1 can in turn be
employed to extend the computation to velocity to velocity at
ti+2 and so on.

16
New value old value slope step size

This approach is formally called Eulers method

17
EXAMPLE 1.2 Numerical Solution to the Bungee Jumper
Problem

Problem Statement. Perform the same computation as in


Example 1.1 but use Eq.(1.13) to compute velocity with
Eulers Method. Employ a step size of 2 s for the
calculation.
Solution. At the start of the computation (ti=0), the velocity of
the jumper is zero. Using this information and the parameter
values from Example 1.1, Eq.(1.13) can be used to compute
velocity at ti+1= 2 s
0.25 2
v 0 9.81 0 2 19.62 m/s
68.1

18
For the next interval (from t = 2 to 4 s), the computation is
repeated, with the result


v 19.62 9.81
0.25
19.62 2 2 36.4137 m/s
68.1
The calculation is continued in a similar fashion to obtain
additional values:

19
t, s v, m/s
0 0
2 19.6200
4 36.4137
6 46.2983
8 50.1802
10 51.3123
12 51.6008
51.6938

20
Comparisonofthenumericalandanalyticalsolutionsforthebungeejumperproblem.
Figure1.4

Note A more accurate numerical result may be done by using


smaller step size, but we must pay a more computational price
too. 21
% step size of 1 s
clear,clf
v(1)=0;t(1)=0
stept=1;
for i=1:12
v(i+1)=v(i)+(9.81-(0.25/68.1)*v(i).^2)*stept;
t(i+1)=t(i)+stept;
end
disp(v');
plot(t,v,'-db')
xlabel('t (s)');ylabel('v (m/s)');
hold on
% step size of 1 s
clear;
v(1)=0;t(1)=0
stept=2;
for i=1:6
v(i+1)=v(i)+(9.81-(0.25/68.1)*v(i).^2)*stept;
t(i+1)=t(i)+stept;
end
disp(v');
plot(t,v,'-dr')
% exact solution
clear;
v(1)=0;t(1)=0
stept=0.5;
for i=1:25
v(i)=51.6938*tanh(0.18977*t(i));
t(i+1)=t(i)+stept;
end
plot(t(1:25),v,'-g');
hold off
22
60

50

40
v (m/s)

30

20

10

0
0 2 4 6 8 10 12
t (s)

23
1.2 CONSERVATION LAWS IN ENGINEERING AND
SCIENCE

the time-variable (or transient) computation.

Change increases decreases (1.14)

the steady-state computation.


Change increases decreases 0
increases decreases (1.15)

For example, steady-state incompressible fluid flow pipes

Flow in flow out

24
Aflowbalanceforsteadyincompressiblefluidflowatthejunctionofpipes.
Figure1.5

The flow out of the fourth pipe must be 60

25
For the bungee jumper, the steady-state condition would
correspond to the case where the net force was zero or dv 0
dt
mg c d v 2 (1.16)

Thus, at steady state, the downward and upward forces are


in balance and the terminal velocity can be find as

gm
v
cd

26
Devicesandtypesofbalancesthatarecommonlyusedinthefourmajorareasofengineering.Foreachcase,
theconservationlawonwhichthebalanceisbasedisspecified.
Table1.1

1-6 27
1.3 NUMERICAL METHOD COVERED IN THIS BOOK

Summaryofthenumerical
methodscoveredinthisbook.
Figure1.6

28

You might also like