Escolar Documentos
Profissional Documentos
Cultura Documentos
clear
clc
H=[2;1]
erro=1
c=0
while erro>0.0001
h1=H(1)
h2=H(2)
f1=0.6-((h1-h2)^0.5)/2
f2=(h1-h2)^0.5/4-(2.04*h2^0.5)/10
F=[f1;f2]
J11=-1/(4*((h1-h2)^0.5))
J12=1/(4*((h1-h2)^0.5))
J21=1/(8*((h1-h2)^0.5))
J22=-1/(8*((h1-h2)^0.5))-51/(500*(h2^0.5))
J=[J11 J12;J21 J22]
H=H-inv(J)*F
erro=sum(abs(F))
c=c+1
end
disp(H)
disp(c)
O programa retornou :
h1 = 3.6026298
h2 = 2.1626298
O número de iterações é 4