Upload
others
View
8
Download
0
Embed Size (px)
Citation preview
Metode Komputasi Numerik
L #2
Amil Ahmad Ilham
http://www.unhas.ac.id/amil/S1TIF/MKN2020/
Review: Error Definitions
• True error:
• True percent relative error:
• Approximate percent relative error:
2
Roots of Equations
Roots of Equations
4
Roots of Equations
5
Roots of Equations
6
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.
7
THE BISECTION METHOD
8
THE BISECTION METHOD
9
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 parachutist’s 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.
10
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.
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%.
11
THE BISECTION METHOD
12
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.
Bisection Algorithm
13
THE FALSE-POSITION METHOD
14
THE FALSE-POSITION METHOD
15
• 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%.
THE FALSE-POSITION METHOD
16
Initiate the computation with guesses of xl = 12 and xu = 16.
False PositionAlgorithm
17
Assignment #11. The velocity v of a falling parachutist is given by:
18
where g = 9.8 m/s2. For a parachutist with a drag coefficient c = 25 kg/s, compute the mass m so that the velocity is v = 45 m/s at t 15 s. Perform the computation until the approximate error (εa) falls below a stopping criterion of εs = 0.1%.
a. Write a program to compute mass m using Bisection Algorithm.b. Write a program to compute mass m using False-position Algorithm.c. Compare and analyze the results between (a) and (b)
Note: Provides output in the form of Table, thinks flexibility and validation.
Assignment #1
• Print out: • the results in the form of Table (Screenshots).
• Part of the source code that performing the calculation.
• Prepare for Demo!
19