V2 välikoe 3, ratkaisuja

ma 7.5.2001 HA

> restart:
with(plots):with(LinearAlgebra):with(linalg):
#read("c:\\opetus\\k01\\v201.mpl"):
read("/home/apiola/opetus/peruskurssi/v2-3/201/maple/v201.mpl");
#read("/p/edu/mat-1.414/maple/v201.mpl")

Warning, the name changecoords has been redefined

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

1.

> f:=(x,y)->4*x^2-4*x*y+2*y^2;g:=[D[1](f),D[2](f)];hessian(f(x,y),[x,y]);eigenvalues(%);evalf(%);plot3d(f(x,y),x=-1..2,y=-1..2);
contourplot(f(x,y),x=-1..2,y=-1..2);

f := proc (x, y) options operator, arrow; 4*x^2-4*y...

g := [proc (x, y) options operator, arrow; 8*x-4*y ...

matrix([[8, -4], [-4, 4]])

6+2*sqrt(5), 6-2*sqrt(5)

10.47213596, 1.527864044

[Maple Plot]

[Maple Plot]

Tässä nähtiin, että O on minimipiste (tätä ei kysytty).

Operoidaan pisteillä p0,p1,p2 ja vastaavilla vektoreiksi muutetuilla: p0v, p1v, p2v.

Määrittelimme yllä gradienttifunktion g, siispä voimme ryhtyä laskemaan:

> p0:=1,1: p0v:=<p0>:

> u:=-Normalize(Vector(g(p0)));

u := _rtable[136790556]

v2l tarkoitti "vector-2-list" (two = to, "slangi-ilmaus")

> jana:=v2l(evalm(p0v+t*u));phi:=unapply(simplify(f(op(jana))),t);

jana := [-t+1, 1]

phi := proc (t) options operator, arrow; 4*t^2-4*t+...

> diff(phi(t),t);tmin:=solve(%=0,t);

8*t-4

tmin := 1/2

> p1v:=p0v+tmin*u;p1:=op(v2l(p1v));

p1v := _rtable[138161428]

p1 := 1/2, 1

> u:=-Normalize(Vector(g(p1)));

u := _rtable[136802768]

> jana:=v2l(evalm(p1v+t*u));phi:=unapply(simplify(f(op(jana))),t);

>

jana := [1/2, -t+1]

phi := proc (t) options operator, arrow; 1-2*t+2*t^...

>

> diff(phi(t),t);tmin:=solve(%=0,t);

-2+4*t

tmin := 1/2

> p2v:=p1v+tmin*u;p2:=op(v2l(p2v));
jana:=v2l(evalm(p1v+t*u));
diff(phi(t),t);

p2v := _rtable[138280600]

p2 := 1/2, 1/2

jana := [1/2, -t+1]

-2+4*t

> <p0>,<p1>,<p2>;

_rtable[138702688], _rtable[136730692], _rtable[136...

> f(p0),f(p1),f(p2);

2, 1, 1/2

> plot3d(f(x,y),x=-1..1,y=-1..1);

[Maple Plot]

> display(plot([[p0],[p1],[p2]],x=0..1.2,y=0..1.2),plot([[p0],[p1],[p2]],x=0..1.2,y=0..1.2,style=point,symbol=circle,symbolsize=20,color=black),implicitplot(f(x,y)=f(p0),x=0.8..1.2,y=0.8..1.2,color=blue),implicitplot(f(x,y)=f(p1),x=0.4..0.6,y=0.8..1.2,color=gold),implicitplot(f(x,y)=f(p2),x=0.4..0.6,y=0.3..0.65,color=black));

[Maple Plot]

2.

> display(plot([[0,0],[cos(Pi/3),sin(Pi/3)],[0,0],[cos(-Pi/4),sin(-Pi/4)]]),plot([cos(t),sin(t),t=-Pi/4..Pi/3]),scaling=constrained);

[Maple Plot]

> display(plot3d([r*cos(Theta),r*sin(Theta),1-r^2],r=0..1,Theta=-Pi/4..Pi/3),plot3d([t,-t,z],t=0..1/sqrt(2),z=0..1-2*t^2),plot3d([t,sqrt(3)*t,z],t=0..1/2,z=0..1-4*t^2));

[Maple Plot]

> massa=Int(rho(x,y,z),V);

massa = Int(rho(x,y,z),V)

> rho:=(x,y,z)->a*x*z;

rho := proc (x, y, z) options operator, arrow; a*x*...

> x:=r*cos(Theta):y:=r*sin(Theta):
Int(Int(Int(rho(x,y,z)*r,z=0..1-r^2),r=0..1),Theta=-Pi/4..Pi/3):massa:=%=value(%);

massa := Int(Int(Int(a*r^2*cos(Theta)*z,z = 0 .. 1-...

3.

> restart:

Warning, the name changecoords has been redefined

> with(plots):with(LinearAlgebra):with(linalg):
#read("c:\\opetus\\k01\\v201.mpl"):
read("/home/apiola/opetus/peruskurssi/v2-3/201/maple/v201.mpl");
#read("/p/edu/mat-1.414/maple/v201.mpl")

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

>

> F:=[2*x*y*z^2,x^2*z^2 + z*cos (y*z),2*x^2*y*z+y*cos( y*z)];

F := [2*x*y*z^2, x^2*z^2+z*cos(y*z), 2*x^2*y*z+y*co...

> curl(F,[x,y,z]);

vector([0, 0, 0])

> F:=map(unapply,F,x,y,z);

F := [proc (x, y, z) options operator, arrow; 2*x*y...

> f:=potentiaali(F);

f := proc (x, y, z) options operator, arrow; x^2*y*...

> A:=0,0,1 ; B:=1,Pi/4,2;

A := 0, 0, 1

B := 1, 1/4*Pi, 2

> f(B)-f(A);

Pi+1

>

4.

> x:=a*cos(t)^3; y:=b*sin(t)^3;

x := a*cos(t)^3

y := b*sin(t)^3

> alpha(D)=int(x*diff(y,t),t=0..2*Pi);

alpha(D) = 3/8*Pi*a*b

>