The R5 version of Newton, an implementation of Newton’s method for systems of nonlinear equations, does not work.
As far as I can determine this is due to a bug in linalg[norm] which no longer is able to compute ’1’ norms (even though the help page says it can).
As a work around until linalg[norm] is fixed you can edit Newton.mpl in /share/newton
.
There are two lines of code that need to be changed. The lines that contain the
command:
norm(something,1)
should be changed to read
norm(something,2)
This change in the type of norm used in the calculation does not have any real effect on the way Newton behaves.
If you do carry out this edit you may find (as I did) that with(share) etc. no longer is able to
load Newton.mpl
.
In that case you will need to load Newton using a standard read command.
My thanks to George Luna for telling me of this problem and I hope that this workaround helps other Newton users out there.
The bug is removed with the Library Update of Maple V.5. (U. Klein)
Concerning Ross’s fix to his Newton package in the share library. To get everything properly updated, you should do the following.
:= sharename:
just above the savelib statement.
"Description = ... " statement;
there should be a space just
before the backslash at the end of the line.
restart: with(share): currentdir("".sharename."/Newton"): read "Newton.mpl":
That should do it. Restart maple and load the package using
with(share): with(Newton):
You might consider write protecting the share libary (along with your main maple library) so you that cannot accidentally write to it.
A temporary fix for the ’1’ norm problem is to set _Envsignum0:= 1
.
Of course this won’t work very well if you want to use some other setting of _Envsignum0
(i.e. you want signum(0)
to return something other than 1). But you can do the
following:
> with(linalg): > oldnorm:= eval(norm): > unprotect(norm): > norm:= proc() _Envsignum0 := 1; oldnorm(args) end: > protect(norm):
And now
> norm([1,2,3],1); 6
and this won’t affect signum outside of norm:
> signum(0); 0