Jump to content

Steffensen's method: Difference between revisions

Line 101:
Use the methods described above to try to find intersection points of the two parabolas. For initial estimates, use <math>{\it pinit}=t_{0}=0.0,0.1,0.2,\cdots,0.9,1.0</math>. Choose reasonable settings for tolerance and maximum iterations. (The [[#ATS|ATS]] example has 0.00000001 and 1000, respectively.) For each initial estimate, if tolerance was not met before maximum iterations was reached, print that there was no answer. On the other hand, if there was an answer, plug the resulting value of <math>t</math> into <math>x(t)</math> and <math>y(t)</math> to find the intersection point <math>(x,y)</math>. Check that that this answer is correct, by plugging <math>(x,y)</math> into the implicit equation. If it is not correct, print that Steffensen's method gave a spurious answer. Otherwise print the value of <math>(x,y)</math>.
 
(''The [[#ATS|ATS]] example has purposely been written in a fashion to be readable as if it were pseudocode. However, because it is written in an essentially frozen programming language, ATS version 2, it is, unlike pseudocode, unambiguous, in that it can be compiled and run and will do something specific. You may use it as a reference implementation. ATS can be installed on a POSIX system, requiring only the C compiler, or [[GCC]] if that does not work.'')
 
=={{header|ATS}}==
1,448

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.