7.105 bug in Maple V.5 affecting Newton in share lib. (4.3.98)

7.105.1 Ross Taylor
7.105.2 Joe Riel (5.3.98)
7.105.3 Robert Israel (5.3.98)

7.105.1 Ross Taylor

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)

7.105.2 Joe Riel (5.3.98)

Concerning Ross’s fix to his Newton package in the share library. To get everything properly updated, you should do the following.

  1. Open the Newton.mpl file and modify per Ross’s instructions.
  2. Go to the bottom of the file and remove the # sign in front of the savelib statement.
  3. Add the line savelibname := sharename: just above the savelib statement.
  4. It’s a good idea to put a comment statement in Newton.mpl indicating that you’ve changed it.
  5. While you’re at it, you might want to open the Newton.msl file and correct the typo in the "Description = ... " statement; there should be a space just before the backslash at the end of the line.
  6. Save the files and open a Maple worksheet. Execute the following commands,
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.

7.105.3 Robert Israel (5.3.98)

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