Harj. 11 LV

19.4.02 HA ja JP

Alustukset

> restart:
with(plots):with(plottools): with(linalg):
setoptions3d(axes=boxed,orientation=[-30,50]):

Warning, the name changecoords has been redefined

Warning, the protected names norm and trace have been redefined and unprotected

1.

> restart:
with(plots):with(plottools):with(linalg):
setoptions3d(axes=boxed,orientation=[-30,50],scaling=constrained):

Warning, the name changecoords has been redefined

Warning, the protected names norm and trace have been redefined and unprotected

Torus

> x:=cos(u)*(a+b*cos(v));
y:=sin(u)*(a+b*cos(v));
z:=b*sin(v);a:=2:b:=1/2:
u:=0: plot([x,z,v=0..2*Pi],-(a+b)..a+b,scaling=constrained);

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

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

z := b*sin(v)

[Maple Plot]

Tämä ympyrä, kun pyörähtää z-akselin ympäri, syntyy torus:

> u:='u':x;

cos(u)*(2+1/2*cos(v))

> u:='u':plot3d([x,y,z],u=0..2*Pi,v=0..2*Pi);

[Maple Plot]

Katsotaan toruksen sisään jättämällä parametrialueet vajaiksi.

> plot3d([x,y,z],u=0..4*Pi/3,v=-Pi/2..Pi-0.2,axes=none);

[Maple Plot]

Kokeillaan "kiellettyä" tubeplottia.

> tubeplot([cos(t),sin(t),0],t=0..2*Pi,radius=0.3);

[Maple Plot]

> a:='a':b:='b':u:='u':v:='v':

> R:=[x,y,z];

R := [cos(u)*(a+b*cos(v)), sin(u)*(a+b*cos(v)), b*s...

> Ru:=map(diff,R,u);Rv:=map(diff,R,v);

Ru := [-sin(u)*(a+b*cos(v)), cos(u)*(a+b*cos(v)), 0...

Rv := [-cos(u)*b*sin(v), -sin(u)*b*sin(v), b*cos(v)...

> n:=crossprod(Ru,Rv);

n := vector([cos(u)*(a+b*cos(v))*b*cos(v), sin(u)*(...

> normi2:=n[1]^2+n[2]^2+n[3]^2:normi2:=simplify(%);

normi2 := b^2*(a^2+2*a*b*cos(v)+b^2*cos(v)^2)

> normi:=sqrt(normi2); normi:=simplify(%,symbolic);

normi := sqrt(b^2*(a^2+2*a*b*cos(v)+b^2*cos(v)^2))

normi := b*(a+b*cos(v))

> ala:=int(int(normi,u=0..2*Pi),v=0..2*Pi);

ala := 4*a*Pi^2*b

>

>

2. (AV 4)

> restart: with(plots): with(linalg):setoptions3d(axes=boxed,orientation=[-30,50]):

Warning, the name changecoords has been redefined

Warning, the protected names norm and trace have been redefined and unprotected

> S:=[3*cos(u),3*sin(u),v];

S := [3*cos(u), 3*sin(u), v]

> pinta:=plot3d(S,u=0..Pi/2,v=0..2,labels=["x","y","z"]):

>

> F:=[exp(2*y),exp(-2*z),exp(2*x)];

F := [exp(2*y), exp(-2*z), exp(2*x)]

> kentta:=fieldplot3d(F,x=0..3,y=0..3,z=0..2):

> display(kentta,pinta);

[Maple Plot]

> r:=S;

r := [3*cos(u), 3*sin(u), v]

> ru:=map(diff,r,u);

ru := [-3*sin(u), 3*cos(u), 0]

> rv:=map(diff,r,v);

rv := [0, 0, 1]

> N:=crossprod(ru,rv);

N := vector([3*cos(u), 3*sin(u), 0])

> intf:=innerprod(subs(x=3*cos(u),y=3*sin(u),z=v,F),N);

intf := 3*exp(6*sin(u))*cos(u)+3*exp(-2*v)*sin(u)

> Int(Int(intf,u=0..Pi/2),v=0..2);

Int(Int(3*exp(6*sin(u))*cos(u)+3*exp(-2*v)*sin(u),u...

> tulos:=value(%);

tulos := 1/2+exp(6)-3/2*exp(-4)

> evalf(tulos),evalf(2*sinh(6));

403.9013200, 403.4263148

Ei siitä aivan samaa tule kuin vastauksessa. Tehtävä ja vastaus ovat KRE-kirjasta. Yllä oleva lasku on kyllä oikein, en usko mitenkään, että Maplekaan tällaisissa

rutiinilaskuissa voisi möhliä.

Maagista kylläkin, likiarvot ovat 3:lla numerolla samat, mutta ei tämä silti mikään pyöristysvirhe ole!

3. LV pinta [u*cos(v),u*sin(u),3*v]

> restart: with(plots): with(linalg):setoptions3d(axes=boxed,orientation=[-30,50]):

Warning, the name changecoords has been redefined

Warning, the protected names norm and trace have been redefined and unprotected

> F:=[x^2,y^2,z^2];

F := [x^2, y^2, z^2]

> r:=[u*cos(v),u*sin(u),3*v];

r := [u*cos(v), u*sin(u), 3*v]

> pinta:=plot3d(r,u=0..1,v=0..2*Pi):

> kentta:=fieldplot3d(F,x=-1..1,y=-1..1,z=0..3*2*Pi):

> display(pinta,kentta);

[Maple Plot]

> ru:=map(diff,r,u);

ru := [cos(v), sin(u)+u*cos(u), 0]

> rv:=map(diff,r,v);

rv := [-u*sin(v), 0, 3]

> N:=crossprod(ru,rv);

N := vector([3*sin(u)+3*u*cos(u), -3*cos(v), (sin(u...

> intf:=innerprod(subs(x=u*cos(v),y=u*sin(u),z=3*v,F),N);intf:=simplify(%);

intf := 3*u^2*cos(v)^2*sin(u)+3*u^3*cos(v)^2*cos(u)...

intf := 3*u*(u*cos(v)^2*sin(u)+u^2*cos(v)^2*cos(u)-...

> Int(Int(intf,u=0..1),v=0..2*Pi);

Int(Int(3*u*(u*cos(v)^2*sin(u)+u^2*cos(v)^2*cos(u)-...

> tulos:=value(%);

tulos := -6*cos(1)*Pi-9*sin(1)*Pi-36*cos(1)*Pi^2+12...

Mikäpä siinä, pintahan se on tuollainenkin.

Tarkoitukseni oli kuitenkin laittaa ruuvipinta, eli kierreporras (Helicon). Lasketaan nyt sekin:

>

3 LV pinta [u*cos(v),u*sin(v),3*v] eli ruuvipinta

> restart: with(plots): with(linalg):setoptions3d(axes=boxed,orientation=[-30,50]):

Warning, the name changecoords has been redefined

Warning, the protected names norm and trace have been redefined and unprotected

> F:=[x^2,y^2,z^2];

F := [x^2, y^2, z^2]

> r:=[u*cos(v),u*sin(v),3*v];

r := [u*cos(v), u*sin(v), 3*v]

> pinta:=plot3d(r,u=0..1,v=0..2*Pi):

> kentta:=fieldplot3d(F,x=-1..1,y=-1..1,z=0..3*2*Pi):

> display(pinta,kentta);

[Maple Plot]

> ru:=map(diff,r,u);
rv:=map(diff,r,v);

ru := [cos(v), sin(v), 0]

rv := [-u*sin(v), u*cos(v), 3]

> N:=crossprod(ru,rv);

N := vector([3*sin(v), -3*cos(v), cos(v)^2*u+sin(v)...

> intf:=innerprod(subs(x=u*cos(v),y=u*sin(v),z=3*v,F),N);intf:=simplify(%);

intf := 3*u^2*cos(v)^2*sin(v)-3*u^2*sin(v)^2*cos(v)...

intf := 3*u*(u*cos(v)^2*sin(v)-u*cos(v)+u*cos(v)^3+...

> Int(Int(intf,u=0..1),v=0..2*Pi);

Int(Int(3*u*(u*cos(v)^2*sin(v)-u*cos(v)+u*cos(v)^3+...

> tulos:=value(%);

tulos := 12*Pi^3

Saatiin ainakin sievempi tulos.

4 LV

> restart: with(plots): with(linalg):

Warning, the name changecoords has been redefined

Warning, the protected names norm and trace have been redefined and unprotected

> r:=[(2+cos(v))*cos(u),(2+cos(v))*sin(u),sin(v)];

r := [(2+cos(v))*cos(u), (2+cos(v))*sin(u), sin(v)]...

> pinta:=plot3d(r,u=0..2*Pi,v=0..Pi,scaling=constrained,axes=frame):

> display(pinta);

[Maple Plot]

Tässä on siis toruksen puolikas, kun b=1 ja a=2 (vrt. teht. 1)

>

> Ru:=map(diff,r,u);Rv:=map(diff,r,v);

Ru := [-(2+cos(v))*sin(u), (2+cos(v))*cos(u), 0]

Rv := [-sin(v)*cos(u), -sin(v)*sin(u), cos(v)]

> N:=crossprod(Ru,Rv);

N := vector([(2+cos(v))*cos(u)*cos(v), (2+cos(v))*s...

> normi2:=N[1]^2+N[2]^2+N[3]^2:normi2:=simplify(%);

normi2 := 4+4*cos(v)+cos(v)^2

> normi2:=sqrt(normi2);

normi2 := sqrt(4+4*cos(v)+cos(v)^2)

> Ala:=int(int(normi2,u=0..2*Pi),v=0..Pi); # Teht. 1:ssä laskettiin: Toruksen ala=4Pi^2 ab, puolikkaaksi tulee siis juuri tämä:

Ala := 4*Pi^2

> Int(Int(sin(v)*normi2,v=0..Pi),u=0..2*Pi);

Int(Int(sin(v)*sqrt(4+4*cos(v)+cos(v)^2),v = 0 .. P...

> Mz:=value(%); Mz/Ala=evalf(Mz/Ala);

Mz := 8*Pi

2*1/Pi = .6366197722

Tässä on z-koordinaatti, joka on se kiinnostava. x0 ja y0 ovat tietysti = 0. Lasketaan nyt nekin:

> Int(Int((2+cos(v))*sin(u)*normi2,v=0..Pi),u=0..2*Pi);

Int(Int((2+cos(v))*sin(u)*sqrt(4+4*cos(v)+cos(v)^2)...

> My:=value(%);

My := 0

> Int(Int((2+cos(v))*cos(u)*normi2,v=0..Pi),u=0..2*Pi);Mx:=value(%);

Int(Int((2+cos(v))*cos(u)*sqrt(4+4*cos(v)+cos(v)^2)...

Mx := 0

> keskio:=[Mx/Ala,My/Ala,Mz/Ala];evalf(keskio);

keskio := [0, 0, 2*1/Pi]

[0., 0., .6366197722]

5. AV

> restart: with(plots): with(linalg):

Warning, the name changecoords has been redefined

Warning, the protected names norm and trace have been redefined and unprotected

> g:=sqrt(4*a^2-x^2-y^2);

g := sqrt(4*a^2-x^2-y^2)

> muuntosuhde:=sqrt(simplify(1+diff(g,x)^2+diff(g,y)^2));

muuntosuhde := 2*sqrt(-a^2/(-4*a^2+x^2+y^2))

> muuntosuhde:=simplify(%,symbolic);

muuntosuhde := 2*a*sqrt(4*a^2-x^2-y^2)/(-4*a^2+x^2+...

> muuntosuhde:=algsubs(x^2+y^2=r^2,%);

muuntosuhde := 2*a*sqrt(4*a^2-r^2)/(-4*a^2+r^2)

> int(int(r*abs(muuntosuhde),r=0..2*a*sin(Theta)),Theta=0..Pi);

4*sqrt(a^2)*a*sqrt(signum(a)^2)*(-2+Pi)/signum(a)

> simplify(%,symbolic);factor(%);

4*a^2*(-2+Pi)

4*a^2*(-2+Pi)

Vaihtoehtoisesti pallopinnan palan voisi vaikka näin:

> x:=v*cos(u):
y:=v*(1+sin(u));

y := v*(1+sin(u))

> z:=sqrt(4*a^2-x^2-y^2);

z := sqrt(4*a^2-v^2*cos(u)^2-v^2*(1+sin(u))^2)

> simplify(z^2,symbolic);

4*a^2-2*v^2-2*v^2*sin(u)

> z:=simplify(sqrt(%),symbolic);

z := sqrt(4*a^2-2*v^2-2*v^2*sin(u))

> r:=[x,y,z];

r := [v*cos(u), v*(1+sin(u)), sqrt(4*a^2-2*v^2-2*v^...

> ru:=map(diff,r,u);

ru := [-v*sin(u), v*cos(u), -v^2*cos(u)/(sqrt(4*a^2...

> rv:=map(diff,r,v);

rv := [cos(u), 1+sin(u), 1/2*(-4*v-4*v*sin(u))/(sqr...

> N:=crossprod(ru,rv);

N := vector([1/2*v*cos(u)*(-4*v-4*v*sin(u))/(sqrt(4...
N := vector([1/2*v*cos(u)*(-4*v-4*v*sin(u))/(sqrt(4...

> N:=map(simplify,%);

N := vector([-v^2*cos(u)*(1+sin(u))/(sqrt(4*a^2-2*v...

> normi2:=norm(N,2)^2;

normi2 := abs(v^2*cos(u)*(1+sin(u))/(sqrt(4*a^2-2*v...

> simplify(%,symbolic);

2*v^2*a^2*(cos(u)^2-2*sin(u)-2)/(-2*a^2+v^2+v^2*sin...

> muunto:=sqrt(%);

muunto := sqrt(2)*sqrt(v^2*a^2*(cos(u)^2-2*sin(u)-2...

> Int(Int(muunto,u=0..2*Pi),v=0..a);

Int(Int(sqrt(2)*sqrt(v^2*a^2*(cos(u)^2-2*sin(u)-2)/...

> evalf(%);

Error, (in evalf/int) unable to handle singularity

>

Tätä ei Maple pysty integroimaan, edes numeerisesti. (Voisihan tuohon soveltaa noita Gauss-kapineitamme.)