ANALISIS NUMERIK
DIBUAT OLEH:
FAKULTAS TEKNIK
UNIVERSITAS HASANUDDIN
GOWA
2021/2022
1. Problem Description
Penerjun payung memiliki massa = 69,7 kg. Jika setelah 21 detik, kecepatan si penerjun
payung mencapai 35 m/s dengan intitial guesses Xl = 0,2 s, dan Xu = 0,3 s. Hitunglah
drag coefficient (c), algoritma newton raphson, dan secant. Buatlah dalam M-File di
Matlab dengan iterasi di terminasi relative error <2%.
2. Syntax
Metode Newton Rhapson
%Ingredients
f = @(x) 48^x - 72.4*x + 35;
df = @(x) log(48)*(48^x) - 72.4;
e = 2*10^-4;
x0 = 0.2;
n = 10;
%processing
if df(x0)~=0
for i=1:n
x1 = x0 - f(x0)/df(x0)
x0 = x1;
end
else
disp('Newton Raphson failed');
end
Metode Secant
%Ingredients
f = @(x) 48^x -72.4*x + 35;
x0 = 0.2;
x1 = 0.3;
e = 2*10^-2;
n = 10;
%Processing
for i=1:n
x2 = (x0*f(x1)-x1*f(x0))/(f(x1)-f(x0));
fprintf('x%d = %.50f\n' ,i,x2)
if abs(x2-x1)<e
break
end
x0 = x1;
x1 = x2;
end
3. Screen Shoot MATLAB
Metode Secant