Vous êtes sur la page 1sur 19

Pemodelan dan Metode Numerik

(Modeling and Numerical Methods)


http://www.unhas.ac.id/amil/S2TE/pmn_2014/

L #2 Roots of Equations
Amil Ahmad Ilham

Review: Error Definitions


True error:
True percent relative error:

Approximate percent relative error:

Roots of Equations

Roots of Equations

Roots of Equations

THE BISECTION METHOD


In general, if f (x) is real and continuous in the
interval from xl to xu and f (xl) and f (xu) have
opposite signs, that is, f(xl) f(xu) < 0, then
there is at least one real root between xl and
xu.

THE BISECTION METHOD

THE BISECTION METHOD


Velocity v = the dependent variable,
time t = the independent variable,
the gravitational constant g = the forcing function,
the drag coefficient c
mass m = parameters.
If the parameters are known, it can be used to predict the
parachutists velocity as a function of time
Suppose we had to determine the drag coefficient for a
parachutist of a given mass to attain a prescribed velocity
in a set time period.
There is no way to rearrange the equation so that c is isolated on
one side of the equal sign. In such cases, c is said to be implicit.

THE BISECTION METHOD


The solution to the dilemma is provided by numerical
methods for roots of equations.

The value of c that makes f (c) = 0 is, therefore, the


root of the equation. This value also represents the
drag coefficient that solves the design problem.
9

THE BISECTION METHOD


Use the bisection method to determine the drag coefficient c
needed for a parachutist of mass m = 68.1 kg to have a velocity of
40 m /s after free-falling for time t = 10 s. Note: The acceleration
due to gravity is 9.8 m/s2. Perform the computation until the
approximate error (a) falls below a stopping criterion of s = 0.5%.

10

THE BISECTION METHOD


The first step in bisection is to guess two values of the unknown that
give values for f (c) with different signs.

After six iterations a finally falls below s = 0.5%, and the computation
can be terminated.

11

Bisection
Algorithm (1)

12

Bisection
Algorithm (2)

13

THE FALSE-POSITION METHOD

14

THE FALSE-POSITION METHOD


Use the false-position method to determine the drag coefficient c
needed for a parachutist of mass m = 68.1 kg to have a velocity of
40 m /s after free-falling for time t = 10 s. Note: The acceleration
due to gravity is 9.8 m/s2. Perform the computation until the
approximate error (a) falls below a stopping criterion of s = 0.5%.

15

THE FALSE-POSITION METHOD


Initiate the computation with guesses of xl = 12 and xu = 16.

16

False Position
Algorithm

17

Group Assignments
1.
2.

Compare and analyze Bisection Algorithm 1 and Bisection Algorithm 2.


The velocity v of a falling parachutist is given by:

where g = 9.8 m/s2. For a parachutist with a drag coefficient c = 15 kg/s,


compute the mass m so that the velocity is v = 35 m/s at t 9 s. Perform
the computation until the approximate error (a) falls below a stopping
criterion of s = 0.1%.
a.
b.
c.

Write a program to compute mass m using Bisection Algorithm.


Write a program to compute mass m using False-position Algorithm.
Compare and analyze the results between (a) and (b)

Note: Provides output in the form of Table, thinks flexibility and validation.
18

Group Assignments
Work in pairs (1 group = 2 members)
Print out the results, No. 1 and of No. 2 (in the
form of Table).
Prepare for Demo!

19

Vous aimerez peut-être aussi