Académique Documents
Professionnel Documents
Culture Documents
(Numerical Computing)
Referensi:
1. Applied Numerical Methods with MATLAB For Engineers and Scientists 4th Edition,
2018 - Steven C. Chapra
2. Numerical Computing with MATLAB Revised Reprint Edition 2004 – Cleve B Moler
3. Introduction to Scientific Computing and Data Analysis 2016 - Mark H. Holmes
Topik:
1. Modeling, Computers, and Error Analysis
2. Roots and Optimization
3. Linear Systems
4. Curve Fitting
5. Integration and Differentiation
6. Ordinary Differential Equations
Kriteria Penilaian:
1. UTS
2. UAS
3. Quiz & Tugas
4. Absensi (?)
Mathematical Modeling, Numerical Methods, and Problem Solving
Newton’s Law:
…. Note: m is the mass of the object (constant)
…differential equation
exact solution,
analytical or closed-form solution:
υ = 0 at t = 0
Unfortunately, there are many mathematical models that cannot be solved exactly. In many
of these cases, the only alternative is to develop a numerical solution that approximates the
exact solution
the time rate of change of velocity can be approximated by:
…………finite-difference approximation
or ………Euler’s method
υo = 0 at to = 0
Drag Force
function dv = deriv(v)
dv = 9.81 - (0.25 / 68.1) * v*abs(v);
end
Test:
>> velocity1(0.5,0,12,0)
ans =
50.9259
>> velocity1(0.001,0,12,0)
ans =
50.6181
it will not work if the computation interval is not evenly divisible by the time step.
Test:
>> velocity2(0.35,0,12,0)
ans =
?
Solution:
function dv = deriv(v)
dv = 9.81 - (0.25 / 68.1) * v*abs(v);
end
Test:
>> velocity2(0.35,0,12,0)
ans =
50.8348
Roundoff and Truncation Errors
True Error (Absolute Error):
Approximate Error:
For Iterative methods, the computation is repeated until the absolute value of
the percent relative error is lower than a prespecified tolerance s
stopping criterion
If the following criterion is met, it can be assured that the result is correct to at
least n significant figures
The total numerical error is the summation of the truncation and roundoff
errors.
Roundoff error: digital computers have magnitude and precision limits
on their ability to represent numbers.
Truncation errors are those that result from using an approximation in
place of an exact mathematical procedure.
For example,
ROUNDOFF ERRORS:
Examples:
function sout = sumdemo()
s = 0;
for i = 1:10000
s = s + 0.0001;
end
sout = s;
the result is
>> format long
>> sumdemo
ans =
0.99999999999991
TRUNCATION ERRORS:
Truncation errors are those that result from using an approximation in place of
an exact mathematical procedure.
Numerical Differentiation:
finite difference
in general:
Forward Difference Approximation, because it utilizes data at i and i+1 to estimate the
derivative