Harj. 3 LV

pe 4.10.02 HA

Alustukset

>    restart:with(linalg):
with(LinearAlgebra):
alias(rref=ReducedRowEchelonForm):alias(ref=GaussianElimination):

Warning, the name changecoords has been redefined

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

Warning, the assigned name GramSchmidt now has a global binding

1.

>    cos(2*t): %=expand(%);
cos(3*t): %=expand(%);
cos(4*t): %=expand(%);
cos(5*t): %=expand(%);
cos(6*t): %=expand(%);

cos(2*t) = 2*cos(t)^2-1

cos(3*t) = 4*cos(t)^3-3*cos(t)

cos(4*t) = 8*cos(t)^4-8*cos(t)^2+1

cos(5*t) = 16*cos(t)^5-20*cos(t)^3+5*cos(t)

cos(6*t) = 32*cos(t)^6-48*cos(t)^4+18*cos(t)^2-1

>    B:=[x[0]=1,seq(x[k]=cos(t)^k,k=1..6)];

B := [x[0] = 1, x[1] = cos(t), x[2] = cos(t)^2, x[3] = cos(t)^3, x[4] = cos(t)^4, x[5] = cos(t)^5, x[6] = cos(t)^6]

>    C:=[y[0]=1,seq(y[k]=cos(k*t),k=1..6)];

C := [y[0] = 1, y[1] = cos(t), y[2] = cos(2*t), y[3] = cos(3*t), y[4] = cos(4*t), y[5] = cos(5*t), y[6] = cos(6*t)]

B:n LRT:

Merk. s=cos(t),  jolloin B:n funktiot ovat s:n monomeja välillä [-1,1]. Nehän nyt taatusti tiedetään LRT:ksi, joten

yhtälöstä

>    sum(c[k]*cos(t)^k,k=0..6)=0;

c[0]+c[1]*cos(t)+c[2]*cos(t)^2+c[3]*cos(t)^3+c[4]*cos(t)^4+c[5]*cos(t)^5+c[6]*cos(t)^6 = 0

seuraa

>    sum(c[k]*s^k,k=0..6)=0;

c[0]+c[1]*s+c[2]*s^2+c[3]*s^3+c[4]*s^4+c[5]*s^5+c[6]*s^6 = 0

kaikilla s välillä [-1,1], joten

>    seq(c[k]=0,k=0..6);

c[0] = 0, c[1] = 0, c[2] = 0, c[3] = 0, c[4] = 0, c[5] = 0, c[6] = 0

C on kanta:

Koska B  on kanta, niin kuvaus

>    f->[f][B];

proc (f) options operator, arrow; [f][B] end proc

on isomorfismi. Kuvauksessa LRT siten säilyy, joten riittää osoittaa, että koordinaattivektorit

>    seq([y[k]]['B'],k=0..6);

[y[0]][B], [y[1]][B], [y[2]][B], [y[3]][B], [y[4]][B], [y[5]][B], [y[6]][B]

ovat LRT.

>    S:=<<1,0,0,0,0,0,0>|<0,1,0,0,0,0,0>|<-1,0,2,0,0,0,0>|<0,-3,0,4,0,0,0>|<1,0,-8,0,8,0,0>|<0,5,0,-20,0,16,0>|<-1,0,18,0,-48,0,32>>;

S := Matrix(%id = 138734508)

Tälle ei tarvitse tarjoilla ref:fiä, sillä se on jo valmiiksi ref-muodossa.

Kaikki sarakkeet pivot-sarakkeita, joten S:n sarakkeet ovat LRT ja siten siis myös   y[k]  - vektorit.

Tässä tehtävässä ei Maplea tarvittu mitenkään olennaisesti (paitsi trig. kaavojen generoimiseen ja matemaattiseen tekstinkäsittelyyn).

Kynä/paperi ja taulukkokirja olisivat toimineet myös aivan hyvin.

2.

a)

>    P:=S; PI:=MatrixInverse(P); # Siinä kaikki.

P := Matrix(%id = 138734508)

PI := Matrix(%id = 138036892)

Koska C-kanta saadaan B-kannassa lausuttuna matriisin P^T  avulla, niin B-koordinaatit saadaan C-koordinaateista

kertomalla matriisilla P. Siten C-koordinaatit saadaan B-koordinaateista kertomalla P^(-1) :llä.

>    f:=5*cos(t)^3-6*cos(t)^4+5*cos(t)^5-12*cos(t)^6;

f := 5*cos(t)^3-6*cos(t)^4+5*cos(t)^5-12*cos(t)^6

>    ['f']['B']=[seq(coeff(f,cos(t),k),k=0..6)];

[f][B] = [0, 0, 0, 5, -6, 5, -12]

>    fB:=Vector(rhs(%));

fB := Vector(%id = 135562144)

>    fC:=PI.fB;

fC := Vector(%id = 134660656)

>    g:=add(fC[k]*cos((k-1)*t),k=1..7);

g := -6+55/8*cos(t)-69/8*cos(2*t)+45/16*cos(3*t)-3*cos(4*t)+5/16*cos(5*t)-3/8*cos(6*t)

>    combine(f);

-6+55/8*cos(t)-69/8*cos(2*t)+45/16*cos(3*t)-3*cos(4*t)+5/16*cos(5*t)-3/8*cos(6*t)

>    expand(g);

5*cos(t)^3-6*cos(t)^4+5*cos(t)^5-12*cos(t)^6

Kerrassan vaikuttavaa, lineaarialgebrassa on taikuutta!

4.

>    restart:

Warning, the name changecoords has been redefined

>    y(k+1)=1.01*y(k)-450;

y(k+1) = 1.01*y(k)-450

>    Y[0]:=10000;

Y[0] := 10000

>    n:=50:

>    for k from 0 to n do
  Y[k+1]:=1.01*Y[k]-450:
od:

>    k:='k':

>   

>    Y[1];

9650.00

>    seq(Y[k],k=0..26);

10000, 9650.00, 9296.5000, 8939.465000, 8578.859650, 8214.648246, 7846.794728, 7475.262675, 7100.015302, 6721.015455, 6338.225610, 5951.607866, 5561.123945, 5166.735184, 4768.402536, 4366.086561, 3959....
10000, 9650.00, 9296.5000, 8939.465000, 8578.859650, 8214.648246, 7846.794728, 7475.262675, 7100.015302, 6721.015455, 6338.225610, 5951.607866, 5561.123945, 5166.735184, 4768.402536, 4366.086561, 3959....
10000, 9650.00, 9296.5000, 8939.465000, 8578.859650, 8214.648246, 7846.794728, 7475.262675, 7100.015302, 6721.015455, 6338.225610, 5951.607866, 5561.123945, 5166.735184, 4768.402536, 4366.086561, 3959....

2 vuotta+ 2 kk

>    26*450;

11700

Tämän verran rahaa kuluu (-risat viimeisestä).

>    taulukko:=seq([k,Y[k]],k=0..26);

taulukko := [0, 10000], [1, 9650.00], [2, 9296.5000], [3, 8939.465000], [4, 8578.859650], [5, 8214.648246], [6, 7846.794728], [7, 7475.262675], [8, 7100.015302], [9, 6721.015455], [10, 6338.225610], [1...
taulukko := [0, 10000], [1, 9650.00], [2, 9296.5000], [3, 8939.465000], [4, 8578.859650], [5, 8214.648246], [6, 7846.794728], [7, 7475.262675], [8, 7100.015302], [9, 6721.015455], [10, 6338.225610], [1...
taulukko := [0, 10000], [1, 9650.00], [2, 9296.5000], [3, 8939.465000], [4, 8578.859650], [5, 8214.648246], [6, 7846.794728], [7, 7475.262675], [8, 7100.015302], [9, 6721.015455], [10, 6338.225610], [1...
taulukko := [0, 10000], [1, 9650.00], [2, 9296.5000], [3, 8939.465000], [4, 8578.859650], [5, 8214.648246], [6, 7846.794728], [7, 7475.262675], [8, 7100.015302], [9, 6721.015455], [10, 6338.225610], [1...
taulukko := [0, 10000], [1, 9650.00], [2, 9296.5000], [3, 8939.465000], [4, 8578.859650], [5, 8214.648246], [6, 7846.794728], [7, 7475.262675], [8, 7100.015302], [9, 6721.015455], [10, 6338.225610], [1...

>    plot([taulukko]);

[Maple Plot]

>    matrix([taulukko]);

matrix([[0, 10000], [1, 9650.00], [2, 9296.5000], [3, 8939.465000], [4, 8578.859650], [5, 8214.648246], [6, 7846.794728], [7, 7475.262675], [8, 7100.015302], [9, 6721.015455], [10, 6338.225610], [11, 5...

>    k:='k':yk:=1.01^k*y0-450*(1-1.01^k)/(1-1.01);

yk := 1.01^k*y0+45000.00000-45000.00000*1.01^k

>    y0:=10000:seq(yk,k=0..26);

10000.00000, 9650.00000, 9296.50000, 8939.46500, 8578.85965, 8214.64825, 7846.79471, 7475.26268, 7100.01529, 6721.01545, 6338.22563, 5951.60785, 5561.12395, 5166.73520, 4768.40255, 4366.08657, 3959.747...
10000.00000, 9650.00000, 9296.50000, 8939.46500, 8578.85965, 8214.64825, 7846.79471, 7475.26268, 7100.01529, 6721.01545, 6338.22563, 5951.60785, 5561.12395, 5166.73520, 4768.40255, 4366.08657, 3959.747...
10000.00000, 9650.00000, 9296.50000, 8939.46500, 8578.85965, 8214.64825, 7846.79471, 7475.26268, 7100.01529, 6721.01545, 6338.22563, 5951.60785, 5561.12395, 5166.73520, 4768.40255, 4366.08657, 3959.747...

>   

5.

>    restart:

Warning, the name changecoords has been redefined

>    differy:=y(k+2)-7*y(k+1)+12*y(k)=0;

differy := y(k+2)-7*y(k+1)+12*y(k) = 0

>    Y:=k->r^k:
#Yrite:

>    subs(y=Y,differy);

Y(k+2)-7*Y(k+1)+12*Y(k) = 0

>    vdiffery:=value(%);

vdiffery := r^(k+2)-7*r^(k+1)+12*r^k = 0

>    vdiffery/r^k;simplify(%,symbolic);

1/(r^k)*(r^(k+2)-7*r^(k+1)+12*r^k) = 0

r^2-7*r+12 = 0

>    factor(%);

(r-3)*(r-4) = 0

>    #Siis jonot u,v toteuttavat differy:n, kun

>    u:=k->3^k; v:=k->4^k;

u := proc (k) options operator, arrow; 3^k end proc

v := proc (k) options operator, arrow; 4^k end proc

Ovat LRT (harj. 4), siis muodostavat (HY):n ratkaisukannan.

Tarkistetaan vielä, että toteuttavat:

>    subs(y=u,differy);

u(k+2)-7*u(k+1)+12*u(k) = 0

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

3^(k+2)-7*3^(k+1)+12*3^k = 0

0 = 0

>    subs(y=v,differy);

v(k+2)-7*v(k+1)+12*v(k) = 0

>    value(%);

4^(k+2)-7*4^(k+1)+12*4^k = 0

>    simplify(%,symbolic);

0 = 0

>