format rat % % 'kuupvõrrandi 1 * x^3 - 18 x^2 - 405 x + 4374 = 0 lahend' % roots([1 -18 -405 4374]) ans = -18 27 9 pause % 1. peasuund: sigma1=27 A=[-14 -8; -8 -11], B=[1;7] A = -14 -8 -8 -11 B = 1 7 N1=[inv(A)*B;1] N1 = 1/2 -1 1 % N1 pikkus ja normeerimine norm(N1) ans = 3/2 N1=N1/norm(N1) N1 = 1/3 -2/3 2/3 norm(N1) ans = 1 pause % 2. peasuund: sigma2=9 A=[-5 -8; -8 -2], B=[1;7] A = -5 -8 -8 -2 B = 1 7 N2=[inv(A)*B;1] N2 = -1 1/2 1 % N2 pikkus ja normeerimine norm(N2) ans = 3/2 N2=N2/norm(N2) N2 = -2/3 1/3 2/3 norm(N2) ans = 1 pause % 3. peasuund: sigma3=-18 A=[17 -16; -16 23], B=[2;14] A = 17 -16 -16 23 B = 2 14 N3=[inv(A)*B;1] N3 = 2 2 1 % N3 pikkus ja normeerimine norm(N3) ans = 3 N3=N3/norm(N3) N3 = 2/3 2/3 1/3 norm(N3) ans = 1 % Kontroll: N3=N1xN2 N3=cross(N1,N2) N3 = -2/3 -2/3 -1/3 pause %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % OMAVÄÄRTUSED JA OMAVEKTORID: eig % % % Pingetensor S S=[-1 -16 -2; -16 5 -14; -2 -14 14] S = -1 -16 -2 -16 5 -14 -2 -14 14 % omaväärtused eig(S) ans = -18 9 27 pause % omaväärtused ja omavektorid [V,D]=eig(S) V = -2/3 -2/3 1/3 -2/3 1/3 -2/3 -1/3 2/3 2/3 D = -18 0 0 0 9 0 0 0 27 % omaväärtuste ja omavektorite ümberjärjestamine, antud juhul 3<->1 D(1,1)=27; D(3,3)=-18; NN=V(:,1); V(:,1)=V(:,3); V(:,3)=NN; D,V D = 27 0 0 0 9 0 0 0 -18 V = 1/3 -2/3 -2/3 -2/3 1/3 -2/3 2/3 2/3 -1/3 % Kontroll: N3=N1xN2 cross(V(:,1),V(:,2)) ans = -2/3 -2/3 -1/3 pause %joonistamine h3=plot3([0,V(1,1)],[0,V(2,1)],[0,V(3,1)],'g'); set(h3,'linewidth',2) text(V(1,1),V(2,1),V(3,1),' N1') hold on h3=plot3([0,V(1,2)],[0,V(2,2)],[0,V(3,2)],'b'); set(h3,'linewidth',2) text(V(1,2),V(2,2),V(3,2),' N2') h3=plot3([0,V(1,3)],[0,V(2,3)],[0,V(3,3)],'r'); set(h3,'linewidth',2) text(V(1,3),V(2,3),V(3,3),' N3') plot3([0,0],[0,0],[-1,1],'k') plot3([0,0],[-1,1],[0,0],'k') plot3([-1,1],[0,0],[0,0],'k') xlabel('x'),ylabel('y'),zlabel('z') text(1,0,0,' x'),text(0,1,0,' y'),text(0,0,1,' z') times12, view(110,45) grid on, hold off print -deps2c yl1 pause format short % Pinged kaldpinnal % 1) võrdselt kallutatud kõigi telgede suhtes % pinnanormaal nu1=[1 1 1]/sqrt(3) nu1 = 0.5774 0.5774 0.5774 p1=S*nu1' p1 = -10.9697 -14.4338 -1.1547 p1/sqrt(3) ans = -6.3333 -8.3333 -0.6667 norm(p1) ans = 18.1659 pause % 2) pinnanormaal nu1=[-1 1 1]/sqrt(3) nu1 = -0.5774 0.5774 0.5774 p1=S*nu1' p1 = -9.8150 4.0415 1.1547 p1/sqrt(3) ans = -5.6667 2.3333 0.6667 norm(p1) ans = 10.6771 pause % 3) pinnanormaal nu1=[1 -1 1]/sqrt(3) nu1 = 0.5774 -0.5774 0.5774 p1=S*nu1' p1 = 7.5056 -20.2073 15.0111 p1/sqrt(3) ans = 4.3333 -11.6667 8.6667 norm(p1) ans = 26.2679 pause % 4) pinnanormaal nu1=[-1 -1 1]/sqrt(3) nu1 = -0.5774 -0.5774 0.5774 p1=S*nu1' p1 = 8.6603 -1.7321 17.3205 p1/sqrt(3) ans = 5.0000 -1.0000 10.0000 norm(p1) ans = 19.4422 pause echo off