How can I use Maxima to obtain individual iterations of Newton's method?

604 Views Asked by At

I'm using Maxima with the following calculation:

mnewton([
        (x-15600)^2+(y-7540)^2+(z-20140)^2-((2.998*10^5)*(-t+0.07074))^2,
        (x-18760)^2+(y-2750)^2+(z-18610)^2-((2.998*10^5)*(-t+0.07220))^2,
        (x-17610)^2+(y-14630)^2+(z-13480)^2-((2.998*10^5)*(-t+0.07690))^2,
        (x-19170)^2+(y-610)^2+(z-18390)^2-((2.998*10^5)*(-t+0.07242))^2
    ], [x,y,z,t],[1,1,1,1]);

This completes the iterations successfully and stabilises after about 10. This is great, but I want to be able list each iteration until it stabilises for a report I'm doing.

I tried changing the newtonmaxiter variable to 1, but it just comes up with the following when I put in the above calculation:

"mnewton: the process doesn't converge or it converges too slowly."

It also does this for 5, but at 10 is gives me the answer. Is there a way I can get the iterations BEFORE they converge?

1

There are 1 best solutions below

1
On BEST ANSWER

Reading https://github.com/andrejv/maxima/blob/master/share/mnewton/mnewton.mac you will find that there is a parameter newtondebug, setting it to true$ will print out the information you required.