:

## A crossprod problem

Maple

I want to plot the normal vector of the Mobius strip represented by the parametric equations:
x=(2+u*cos(v/2))*cos(v):

y=(2+u*cos(v/2))*sin(v):

z=u*sin(v/2):

It is well-known that the normal vector is the crossproduct of [diff(x(u,v),u),diff(y(u,v),u),diff(z(u,v),u)] and [diff(x(u,v),v),diff(y(u,v),v),diff(z(u,v),v)].

So I want Maple to calculate the partial derivatives and the crossproduct for me.

with(plots):with(linalg):

a:=2:b:=0.5:

x:=(u,v)->(a+u*cos(b*v))*cos(v):

y:=(u,v)->(a+u*cos(b*v))*sin(v):

z:=(u,v)->u*sin(b*v):

N:=crossprod([diff(x(u,v),u),diff(y(u,v),u),diff(z(u,v),u)],[diff(x(u,v),v),diff(y(u,v),v),diff(z(u,v),v)]):

surface:=plot3d([x(u,v),y(u,v),z(u,v)],u=-1..1,v=0..2*Pi):

curve:=spacecurve([x(0,v),y(0,v),z(0,v)],v=0..2*Pi,

thickness=2,color=red):

M1:=(u,v)->N[1](u,v): M2:=(u,v)->N[2](u,v): M3:=(u,v)->N[3](u,v):
M1(u,v);M2(u,v):M3(u,v);

K:=40:

for i from 1 to K do ti:=i*4*Pi/K:

normal_vector[i]:=spacecurve([x(0,ti)+s*M1(0,ti),y(0,ti)+s*M2(0,ti),z(0,ti)+s*M3(0,ti)],s=0..1,color=blue,thickness=4):

od:

A:=display(seq(normal_vector[i],i=1..K),insequence=true):

display(A,surface,curve,scaling=constrained);

It can be seen that the crossproduct N is OK, but the normal vector does not appear.

Then I calculate the partial derivatives and the crossproduct by hand.  ( N=[M1,M2,M3] below is the normal vector )

with(plots):

a:=2:b:=0.5:

x:=(u,v)->(a+u*cos(b*v))*cos(v):

y:=(u,v)->(a+u*cos(b*v))*sin(v):

z:=(u,v)->u*sin(b*v):
surface:=plot3d([x(u,v),y(u,v),z(u,v)],u=-1..1,v=0..2*Pi):

curve:=spacecurve([x(0,v),y(0,v),z(0,v)],v=0..2*Pi,

thickness=2,color=red):

M1:=(u,v)->b*cos(b*v)^2*sin(v)*u-sin(b*v)*(-b*u*sin(b*v)*sin(v)+(a+u*cos(b*v))*cos(v)):

M2:=(u,v)->sin(b*v)*(-b*u*sin(b*v)*cos(v)-(a+u*cos(b*v))*sin(v)-b*cos(b*v)^2*u*cos(v)):

M3:=(u,v)->cos(b*v)*cos(v)*(-b*u*sin(b*v)*sin(v)+(a+u*cos(b*v))*cos(v))-cos(b*v)*sin(v)*(-b*u*sin(b*v)*cos(v)-(a+u*cos(b*v))*sin(v)):

K:=40:

for i from 1 to K do ti:=i*4*Pi/K:

normal_vector[i]:=spacecurve([x(0,ti)+s*M1(0,ti),y(0,ti)+s*M2(0,ti),z(0,ti)+s*M3(0,ti)],s=0..1,color=blue,thickness=4) od:

A:=display(seq(normal_vector[i],i=1..K),insequence=true):

display(A,surface,curve,scaling=constrained);

And the normal vector appears.

I don't know what is wrong with the first program and how to solve the problem.

﻿