Multidimensional Newton-Raphson method: Difference between revisions
Multidimensional Newton-Raphson method (view source)
Revision as of 10:02, 29 July 2019
, 4 years ago→{{header|Phix}}: simplified exit condition
m (→{{header|Phix}}: simplified exit condition) |
|||
Line 674:
atom tol := 1e-8
while true do
gu1 := gu2
g := matrix_transpose({gu1})
t := repeat(0, size)
for i=1 to size do
t[i] := call_func(fs[i],{gu1})
end for
f := matrix_transpose({t})
for i=1 to size do
for j=1 to size do
jac[i][j] := call_func(jacob[i][j],{gu1})
end for
end for
g1 := sq_sub(g,matrix_mul(inverse(jac),f))
gu2 := vslice(g1,1)
iter += 1
bool any :=
if not any or iter >= maxIter then exit end if
end while
|