# Løsninger til 2-timers prøven, Matematik 1, december 2001 # Til illustration - opgaverne er beregnet på løsning i hånden # BEMÆRK: Der er her ingen forklarende tekst. # # 14.12.01 # Opgave 1 > restart;with(linalg): Warning, the protected names norm and trace have been redefined and unprotected > A:= array([[1,2],[0,2]]); [1 2] A := [ ] [0 2] > eigenvectors(A); [1, 1, {[1, 0]}], [2, 1, {[2, 1]}] > jordan(A, 'V'); [1 0] [ ] [0 2] > evalm(V); [-2 2] [ ] [ 0 1] > # # # Opgave 2 > restart;with(linalg): Warning, the protected names norm and trace have been redefined and unprotected > hoj:= diff(x(t), t) - x(t); /d \ hoj := |-- x(t)| - x(t) \dt / > dsolve(hoj=exp(2*t), x(t)); x(t) = (exp(t) + _C1) exp(t) > dsolve(hoj=1, x(t)); x(t) = -1 + exp(t) _C1 > dsolve(hoj= 7-2*exp(2*t), x(t)); x(t) = -7 - 2 exp(2 t) + exp(t) _C1 > # # # Opgave 3 > restart;with(linalg): Warning, the protected names norm and trace have been redefined and unprotected > P:= x-> (x-(2-I))*(x-(2+I)); P := x -> (x - 2 + I) (x - 2 - I) > expand(P(x)); 2 x - 4 x + 5 # # # # Opgave 4 > restart;with(linalg): Warning, the protected names norm and trace have been redefined and unprotected > cFa:= array([[2, -1],[-1, -2]]); [ 2 -1] cFa := [ ] [-1 -2] > aMb:= array([[1,1],[1,-1]]); [1 1] aMb := [ ] [1 -1] > cFb:= evalm(cFa&*aMb); [ 1 3] cFb := [ ] [-3 1] # # Opgave 5 > restart;with(linalg):with(plots): Warning, the protected names norm and trace have been redefined and unprotected Warning, the name changecoords has been redefined > P:= (x,y)->abs(((x+I*y)-2+I)); P := (x, y) -> | x + I y - 2 + I | > P(x,y); | x + I y - 2 + I | > contourplot(P(x,y), x=-1...5, y=-4...2, contours=[1], > filled=true, coloring=[gray, white], scaling=constrained); > # # # # Opgave 6 > restart;with(linalg): Warning, the protected names norm and trace have been redefined and unprotected > V:= array([[1,1],[0,1]]); [1 1] V := [ ] [0 1] > inverse(V); [1 -1] [ ] [0 1] > Lambda:= array([[2, 0],[0, -1]]); [2 0] Lambda := [ ] [0 -1] > A:= evalm(V&*Lambda&*inverse(V)); [2 -3] A := [ ] [0 -1] > eigenvectors(A); [-1, 1, {[1, 1]}], [2, 1, {[1, 0]}] > > # ALTERNATIV > restart;with(linalg): Warning, the protected names norm and trace have been redefined and unprotected > A:= array([[a11,a12],[a21,a22]]); [a11 a12] A := [ ] [a21 a22] > v1:=vector([1,0]);v2:=vector([1,1]); v1 := [1, 0] v2 := [1, 1] > eqn1:=evalm(A&*v1-2*v1)[1]=0; > eqn2:=evalm(A&*v1-2*v1)[2]=0; > eqn3:=evalm(A&*v2+1*v2)[1]=0; > eqn4:=evalm(A&*v2+1*v2)[2]=0; > eqn1 := a11 - 2 = 0 eqn2 := a21 = 0 eqn3 := a11 + a12 + 1 = 0 eqn4 := a21 + a22 + 1 = 0 > sol:=solve({eqn1,eqn2,eqn3,eqn4}, {a11,a12,a21,a22}); sol := {a21 = 0, a22 = -1, a12 = -3, a11 = 2} #  # # Opgave 7 > restart;with(linalg):with(plots): Warning, the protected names norm and trace have been redefined and unprotected Warning, the name changecoords has been redefined > f:= (x,y)-> arctan(x^2 + y^2); 2 2 f := (x, y) -> arctan(x + y ) > contourplot(f(x,y), x=-1...3, y=-3...2, contours=10, > filled=true, coloring=[gray, white], scaling=constrained); > grad:= (x,y)-> array([D[1](f)(x,y), D[2](f)(x,y)]); grad := (x, y) -> array([D[1](f)(x, y), D[2](f)(x, y)]) > grad(x,y); [ x y ] [2 --------------, 2 --------------] [ 2 2 2 2 2 2] [ 1 + (x + y ) 1 + (x + y ) ] > grad(-1,0); [-1, 0] > e:= (1/sqrt(2))*array([1,1]); e := 1/2 sqrt(2) [1, 1] > dotprod(grad(-1,0), e); - 1/2 sqrt(2) >