7.143 Bug VectorCalculus[Jacobian], Maple 8 (17.10.02)

7.143.1 Helmut Jarausch
7.143.2 Robert Israel (20.10.02)
7.143.3 Carl Devore (20.10.02)

7.143.1 Helmut Jarausch

Maple8 does not compute a Jacobian of a mapping of an m-dimensional space into an n-dimensional one with m different from n, although this is mathematically well defined.

> with(LinearAlgebra): 
> fp:=Vector(2,[p[1]*p[2],3*p[3]]); 
 
                                [p[1] p[2]] 
                          fp := [         ] 
                                [ 3 p[3]  ] 
 
> VectorCalculus[Jacobian](fp,[p[1],p[2]]); 
 
                            [p[2]    p[1]] 
                            [            ] 
                            [ 0       0  ] 
 
                          with assumptions on p 
 
> VectorCalculus[Jacobian](fp,[p[1],p[2],p[3]]); 
Error, (in VectorCalculus:-Jacobian) the number of functions must 
equal the number of variable names
 

Is there any workaround?

7.143.2 Robert Israel (20.10.02)

Well, you could simply roll your own:

> MyJacobian:= (F::list, V::list) -> 
     Matrix([seq([seq(diff(f,v),v=V)], f=F)]);
 

Or patch VectorCalculus:-Jacobian to remove the line

if lenf <> lenv then error "the number of functions must equal the number 
of variable names" end if;
 

(although there should still be an error if you ask it to compute the determinant in this case)

7.143.3 Carl Devore (20.10.02)

Yes, this is an oversight. In the small procedure VectorCalculus:-Jacobian, the line

if lenf <> lenv then should be changed to

if computedet and lenf <> lenv then | Is there any workaround?

Yes,

Matrix(linalg[jacobian](fp, [p[1], p[2], p[3]]));