Lösungsalgorithmus zu ALR-23
-----------------------------------
Code
WindowTitle "ALR-23 Löser MITTELS NEWTON-RAPHSON"
WindowStyle 24:cls:font 2:declare x!,xn!,e!,vz!,rs!
e!=val("1e-15"):rs!=240.25 '<Rechte Seite hier
vz!=(rs!>=0)-(rs!<0):xn!=vz!*sqrt(rs!)
If between(xn!,-1/12,1) or (xn!>18)
print "\n Iteration in diesem Bereich nicht stabil!"
goto "exit":endif
repeat:x!=xn!:xn!= x! - \
(2^x!-2*x!+2/x!-rs!)/(2^(x!-1)-2+(-1)*1/sqr(x!))
until abs(xn!-x!)<=e!
print "\n\n\n x = "+format$("%g",xn!)
exit:
WaitInput 20000:END
Alles anzeigen