GEOFISIKA
MINGGU KE - 2
MODELING,
COMPUTERS, AND
ERROR ANALYSIS
Motivation
(1)
Besar F dipengaruhi gaya gravitasi (FD) dan gaya resistansi udara (Fu).
c= drag coefficient
A Simple Mathematic Method
(2)
v(t) = dependent variable, t= independent variable, c dan m =parameter,
g= fungsi gaya.
Example: Falling Parachuting Problem
Metode Euler!!!
Example : Falling Parachuting Problem
Solusi numeris untuk problem gerak jatuh bebas parasut dengan menggunakan
metode Euler :
Pada ti=0, v=0, jika ti+1 = 2s, maka v(ti+1) adalah
Characteristics of an algorithm:
• Unambiguous : must lead to only one meaning
• Input : should have 0 or more well defined input
• Output : should have 1 or more well defined
output and match the desired output.
• Finiteness : must terminate after a number of
steps
• Feasibility : must be feasible with the available
resources.
• Independent : should be independent of any
programming code
Structured Programming
Flowchart
Pseudocode
Is a notation system for writing algorithm
The pseudocode notation specifies operations that a
machine can perform in as human-friendly (e.g, easy to
read) way as possible, while avoiding ambiguity.
Pseudocode Conventions:
1. Give a valid name for the pseudocode procedure
2. Use the line numbers for each line of code
3. Use proper indention for every statement in a block structure.
4. For a flow control statements use if-else. Always end an if
statements with an end-if. Both if, else and end-if should be
aligned vertically in same line.
5. Use “=” or “” operator for assignment statements. Example,
i=j or ij; n=2 to length[A] or n2 to length[A]
6. Array elements can be represented by specifying the array
name followed by the index in square brackets.
7. For looping or iteration us “for” (end with end-for) or “while”
(end with end-while) statements
Structured Programming
The count-
controlled
or DOFOR
loop
Dua jenis utama dari error numerik : round-off error dan truncation
error.
Round-off error : error yang diakibatkan oleh keterbatasan digit yang
dapat diakomodasi oleh komputer.
Truncation error : error yang diakibatkan oleh pemotongan digit angka
dalam suatu operasi matematis.
Et = true error
Error estimated for iterative method
For most cases when true value can not be obtained, an approximated error
is obtained instead.
Contoh Soal