mnewton



Here newton method code I wrote for my class this past spring. It was
good enough for student homework, but I doubt it is as sturdy as it should
be for non-homework use. Maybe the ideas in this code might help somebody
to write "the" newton method.

(%i1) load("newton.mac")$

Since tol is a double, use complexfield:
(%i2) newton([x^2 + y^2 + 11/3 = 0, y + x = 1],[x,y],[1.0 - %i,10.0], tol =
1.0d-14);

When tol is a big float, use bfloatfield:

(%o2) [x=1.443375672974064*%i+0.5,y=0.5-1.443375672974064*%i]
(%i3) newton([x^2 + y^2 + 11/3 = 0, y + x = 1],[x,y],[1.0 - %i,10.0], tol =
1.0b-42), fpprec
  : 50;
(%o3)
[x=1.4433756729740644112728719512548936391190043781753b0*%i+5.0b-1,y=5.0b-1-

1.4433756729740644112728719512548936391190043781753b0*%i]



Barton



-----maxima-bounces at math.utexas.edu wrote: -----

>To: "Barton Willis" <willisb at unk.edu>
>From: "Andrej Vodopivec" <andrej.vodopivec at gmail.com>
>Sent by: maxima-bounces at math.utexas.edu
>Date: 07/17/2007 09:40AM
>cc: Maxima - list <maxima at math.utexas.edu>, sen1 at math.msu.edu
>Subject: Re: [Maxima] mnewton
>
>The patch uses complexfield (which is the field of complex floating
>point numbers of the type double). To support bigfloats other parts of
>mnewton should also be modified, so I didn't do that (it wouldn't be
>hard). I guess there could be a switch which would control which field
>should be used.
>
>Andrej

(See attached file: newton.mac)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: newton.mac
Type: application/octet-stream
Size: 2097 bytes
Desc: not available
Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20070717/ed0dc159/attachment.obj