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);
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)));
v2l tarkoitti "vector-2-list" (two = to, "slangi-ilmaus")
> jana:=v2l(evalm(p0v+t*u));phi:=unapply(simplify(f(op(jana))),t);
> diff(phi(t),t);tmin:=solve(%=0,t);
> p1v:=p0v+tmin*u;p1:=op(v2l(p1v));
>
u:=-Normalize(Vector(g(p1)));
> jana:=v2l(evalm(p1v+t*u));phi:=unapply(simplify(f(op(jana))),t);
>
>
>
diff(phi(t),t);tmin:=solve(%=0,t);
>
p2v:=p1v+tmin*u;p2:=op(v2l(p2v));
jana:=v2l(evalm(p1v+t*u));
diff(phi(t),t);
> <p0>,<p1>,<p2>;
> f(p0),f(p1),f(p2);
> plot3d(f(x,y),x=-1..1,y=-1..1);
> 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));
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);
> 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));
> massa=Int(rho(x,y,z),V);
> rho:=(x,y,z)->a*x*z;
>
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(%);
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)];
> curl(F,[x,y,z]);
> F:=map(unapply,F,x,y,z);
> f:=potentiaali(F);
> A:=0,0,1 ; B:=1,Pi/4,2;
> f(B)-f(A);
>
4.
> x:=a*cos(t)^3; y:=b*sin(t)^3;
> alpha(D)=int(x*diff(y,t),t=0..2*Pi);
>