Harj. 10 AV

7.4.02 HA

Alustukset

> restart:

Warning, the name changecoords has been redefined

> with(LinearAlgebra): with(plots): alias(Tr=Transpose,Lsolve=LinearSolve):

> with(linalg):with(plottools):

Warning, the previous binding of the name GramSchmidt has been removed and it now has an assigned value

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

Warning, the name arrow has been redefined

> setoptions3d(axes=boxed,orientation=[-30,50]):

> V2L:=vek->convert(vek,list):

> #read("/home/apiola/opetus/peruskurssi/v2-3/maple/v202.mpl");

1.

> f:=x*y^2+y^3;

f := x*y^2+y^3

> pinta:=plot3d(f,x=0..2,y=1..3,view=[0..2,1..3,0..50]):

> Int(Int(f,y=1..3),x=0..2): %=value(%);

Int(Int(x*y^2+y^3,y = 1 .. 3),x = 0 .. 2) = 172/3

Käsin laskien päästiin tähän x-integraaliin, joka annetaan juhlallisesti Maplen laskettavaksi. Saadaan jopa sama tulos!

> int((9-1/3)*x+3^4/4-1/4,x=0..2);

172/3

Voidaan tehdä myös vaiheittain laskemalla ensin integrointi y:n suhteen ja antamalla oikella puolella value-komennon hoitaa myös x-integrointi:

> Int(int(f,y=1..3),x=0..2): %=value(%);

Int(26/3*x+20,x = 0 .. 2) = 172/3

> F:=unapply(f,x,y); fv:=x->F(x[1],x[2]);

F := proc (x, y) options operator, arrow; x*y^2+y^3...

fv := proc (x) options operator, arrow; F(x[1],x[2]...

> pohja:=[[0,1],[2,1],[2,3],[0,3]];pohja3d:=[[0,1,0],[2,1,0],[2,3,0],[0,3,0]];

pohja := [[0, 1], [2, 1], [2, 3], [0, 3]]

pohja3d := [[0, 1, 0], [2, 1, 0], [2, 3, 0], [0, 3,...

> kansiz:=map(fv,pohja);

kansiz := [1, 3, 45, 27]

> kansi3d:=zip((x,y)->[op(x),y],pohja,kansiz); # Eleganttia!

kansi3d := [[0, 1, 1], [2, 1, 3], [2, 3, 45], [0, 3...

> display(polygon(pohja3d),polygon([pohja3d[1],kansi3d[1],kansi3d[2],pohja3d[2]]),polygon([pohja3d[3],kansi3d[3],kansi3d[4],pohja3d[4]]),pinta,axes=none,style=patchnogrid);

[Maple Plot]

2.

> karjet:=[-1,0],[1,0],[0,1]:

> display(polygon([karjet],filled=true,color=yellow));

[Maple Plot]

y-proj: laskettava 2:ssa osassa:

> vasen:=Int(Int(x*y+y^2,y=0..x+1),x=-1..0):

> oikea:=Int(Int(x*y+y^2,y=0..-x+1),x=0..1):

> vasen+oikea=value(vasen+oikea);

Int(Int(x*y+y^2,y = 0 .. x+1),x = -1 .. 0)+Int(Int(...

>

3.

> plot([solve(2*x+2*y=5,y),1/x],x=0..3,y=0..3);

[Maple Plot]

> solve({x+y=5/2,x*y=1},{x,y});

{y = 1/2, x = 2}, {y = 2, x = 1/2}

> hypseina:=plot3d([x,1/x,z],x=0.5..2,z=0..ln(x),labels=[x,y,z]):

> suora:=solve(2*x+2*y=5,y);

suora := -x+5/2

> suoraseina:=plot3d([x,suora,z],x=0.5..2,z=0..ln(x),labels=[x,y,z]):

> display(hypseina,suoraseina,plot3d(ln(x),x=0.5..2,y=1/x..suora),style=patchcontour);

[Maple Plot]

> Int(Int(ln(x),y=1/x..suora),x=1/2..2);

Int(Int(ln(x),y = 1/x .. -x+5/2),x = 1/2 .. 2)

> %=value(%);

Int(Int(ln(x),y = 1/x .. -x+5/2),x = 1/2 .. 2) = 33...

> evalf(rhs(%));

.46732120e-1

Kyseessä on kuvassa näkyvien kuppien tilavuuksien erotus.

4.

> parseina:=plot3d([x,x^2,z],x=0..2,z=0..exp(x^2/x),labels=[x,y,z]):

> suoraseina:=plot3d([x,2*x,z],x=0..2,z=0..exp(2*x/x),labels=[x,y,z]):

> display(parseina,suoraseina,plot3d(exp(y/x),x=0..2,y=x^2..2*x),style=patch);

[Maple Plot]

> plot3d(exp(y/x),x=0..2,y=x^2..2*x,style=patchcontour);

[Maple Plot]

> int(x*(exp(2)-exp(x)),x=0..2);

exp(2)-1

> Int(Int(exp(y/x),x=y/2..sqrt(y)),y=0..4);

Int(Int(exp(y/x),x = 1/2*y .. sqrt(y)),y = 0 .. 4)

> %=value(%);

Int(Int(exp(y/x),x = 1/2*y .. sqrt(y)),y = 0 .. 4) ...

> Int(Int(exp(y/x),y=x^2..2*x),x=0..2);

Int(Int(exp(y/x),y = x^2 .. 2*x),x = 0 .. 2)

> value(%);

exp(2)-1

>

5.

> restart:

Warning, the name changecoords has been redefined

> f:=Theta->2*sqrt(cos(2*Theta));

f := proc (Theta) options operator, arrow; 2*sqrt(c...

>

> plot(f,-Pi/4..Pi/4,labels=['Theta','r']);

[Maple Plot]

> x:=r*cos(Theta);y:=r*sin(Theta);

x := r*cos(Theta)

y := r*sin(Theta)

> r:=f(Theta);

r := 2*sqrt(cos(2*Theta))

> x,y;

2*sqrt(cos(2*Theta))*cos(Theta), 2*sqrt(cos(2*Theta...

> plot([x,y,Theta=-Pi/4..Pi/4]);

[Maple Plot]

> plot([x,y,Theta=-Pi..Pi]);

[Maple Plot]

> f:=Theta->2*sqrt(abs(cos(2*Theta)));

f := proc (Theta) options operator, arrow; 2*sqrt(a...

> plot([x,y,Theta=-Pi/4..Pi/4]);plot([x,y,Theta=-Pi..Pi]);

[Maple Plot]

[Maple Plot]

>

6.

> restart:

Warning, the name changecoords has been redefined

> with(plots):

> z1:=x^2+y^2; z2:=(4-x^2-y^2)/3;

z1 := x^2+y^2

z2 := 4/3-1/3*x^2-1/3*y^2

> x:=r*cos(Theta); y:=r*sin(Theta);

x := r*cos(Theta)

y := r*sin(Theta)

> ala:=plot3d([x,y,z1],r=0..1,Theta=0..2*Pi):

> yla:=plot3d([x,y,z2],r=0..1,Theta=0..2*Pi):

> display(ala,yla,style=patchcontour);

[Maple Plot]

>

>