#! /usr/bin/calc read "biblioteca.calc" print "Precisão? rode configura()" apeteco(); A = mat[3,3] = { 3 , 4 , 4, 2 , -3 , -5, 0,0,0 } PrintMat(A,3,3); ## print "det(A) =", det(A); apeteco(); T = mat[3,3] = { 3 , 4 , 4, 0, -17/3. , -23/3., 0,0,0 } print "matriz equivalente obtida T " apeteco() PrintMat(T,3,3); apeteco() t = 0; while(t<10) { ## b = mat[3,1] = {8*t/17+11/17, -23*t/17-4/17, t}; b = mat[3,1] = {8*t/17, -23*t/17, t}; print "c = A*b " c = A*b; print "t = ",t, "c = A*b , PrintMat(c,3,1)"; PrintMat(c,3,1); apeteco(); t+=1; } quit x = 11/17.; y = -4/17.0; z =0; print "x = 11/17.; y = -4/17.0; z =0;" print "Valor de (x,y,z) calculado (x,y,z) = ", "(",x,",",y,",",z,")" b = mat[3,1] = {x,y,z} print "b = mat[3,1] = ", "(",x,",",y,",",z,")" PrintMat(b,3,1) print "c = T*b " print "PrintMat(c,3,1) "; print "=========== resultados =============" apeteco(); c = T*b PrintMat(c,3,1) apeteco(); print "Solução particular da equação equivalente é " PrintMat(c,3,1); apeteco() print "Solução geral da homogênea equivalente" t=1; x = -24*t/51.; y = -23*t/17., z=t; b = mat[3,1] = {x,y,z}; c = T*b; print "c = T*b = ", 0; PrintMat(c,3,1) apeteco() quit A1 = mat[2,2] = {3, 4 , 2 , -5} PrintMat(A1,2,2); print "det(A) =", det(A1); apeteco(); A2 = mat[2,2] = {3 , 4 , 2 , -3} PrintMat(A2,2,2); print "det(A) =", det(A2); apeteco(); quit A = mat[4,4] = {3, 1,5,7, 7,-8,3,13, 1, 3,5,-13, 1, 2, 3, 4 }; PrintMat(A,4,4); print "det(A) =", det(A); apeteco(); A = mat[4,4] = {-3, -1, -5,-7, -7, 8, -3,-13, -1, -3, -5, 13, -1, -2, -3, -4 }; PrintMat(A,4,4); print "det(A) =", det(A); apeteco(); a=70;b=6;c=5;d=4;e=3;f=2;g=1; print "O caso 3 x 2 ","Sim(3) ==============================================="; I = mat[3,3] = {1, 0, 0, 0, 1, 0, 0, 0, 1 }; I123 = mat[3,3] = {0, 1, 0, 0, 0, 1, 1, 0, 0 }; I132 = mat[3,3] = { 0, 0, 1, 1, 0, 0, 0, 1, 0 }; I12 = mat[3,3] = { 0, 1, 0, 1, 0, 0, 0, 0, 1 }; I13 = mat[3,3] ={ 0, 0, 1, 0, 1, 0, 1, 0, 0 }; I23 = mat[3,3] = { 1, 0, 0, 0, 0, 1, 0, 1, 0 }; A = mat[5,5] = { 1 , 1 , 1 , 1 , 1 , 1 , 2 , 4 , 8 , 16 , 1 , 3 , 9 , 27 , 81 , 1 , 4 , 16 , 64 , 256 , 1 , 5 , 25 , 125 , 625 }; PrintMat(A, 5,5); apeteco(); print det(A); apeteco(); S = (1-2)*(1-3)*(1-4)*(1-5)*(2-3)*(2-4)*(2-5)*(3-4)*(3-5)*(4-5); print S; apeteco(); A1 = mat[5,5] = { 1 , 1 , 1 , 1 , 0 , 1 , 2 , 4 , 8 , 1 , 1 , 3 , 9 , 27 , 9 , 1 , 4 , 16 , 64 , 36 , 1 , 5 , 25 , 125 , 100 } ; print "PrintMat(A1, 5,5) = " PrintMat(A1, 5,5); apeteco(); print "det(A1) = ", det(A1) apeteco(); R = -1*(1-3)*(1-4)*(1-5)*(3-4)*(3-5)*(4-5) +\ 9*(1-2)*(1-4)*(1-5)*(2-4)*(2-5)*(4-5)-\ 36*(1-2)*(1-3)*(1-5)*(2-3)*(2-5)*(3-5)+\ 100*(1-2)*(1-3)*(1-4)*(2-3)*(2-4)*(3-4); print "det(A1) = ", det(A1), " = det(A1) = ", R; apeteco(); quit(); PrintMat(I23*I23,3,3); apeteco(); PrintMat(I13*I13,3,3); apeteco(); PrintMat(I12*I12,3,3); apeteco(); PrintMat(I123*I123,3,3); PrintMat(I132,3,3); PrintMat(I132*I123,3,3); apeteco(); PrintMat(I132*I132,3,3); apeteco(); print "Trocando as colunas da matriz A "; apeteco(); A = mat[3,3] = { 1,a,a**2, 1,b,b**2, 1,c,c**2 } print "PrintMat(A,3,3); "; PrintMat(A,3,3); apeteco(); print "PrintMat(A*I123,3,3); ";PrintMat(A*I123,3,3); print "-------------------------" apeteco(); print "PrintMat(A*I132,3,3); "; PrintMat(A*I132,3,3); print "-------------------------" apeteco(); print "PrintMat(A*I23,3,3);"; PrintMat(A*I23,3,3); print "-------------------------" apeteco(); print "PrintMat(A*I13,3,3); "; PrintMat(A*I13,3,3); print "-------------------------" apeteco(); print "PrintMat(A*I12,3,3); "; PrintMat(A*I12,3,3); print "-------------------------" apeteco(); print "Trocando as linhas da matriz A "; apeteco(); print "PrintMat(A,3,3); "; PrintMat(A,3,3); apeteco(); print "PrintMat(I123*A,3,3); ";PrintMat(I123*A,3,3); print "-------------------------" apeteco(); print "PrintMat(I132*A,3,3); "; PrintMat(I132*A,3,3); print "-------------------------" apeteco(); print "PrintMat(I23*A,3,3);"; PrintMat(I23*A,3,3); print "-------------------------" apeteco(); print "PrintMat(I13*A,3,3); "; PrintMat(I13*A,3,3); print "-------------------------" apeteco(); print "PrintMat(I12*A,3,3); "; PrintMat(I12*A,3,3); print "-------------------------" apeteco(); S=0; print det(A) B = A; print B[0,0]*B[1,1]* B[2,2]; S+=B[0,0]*B[1,1]* B[2,2]; print "-----------------" B = I123*A; print B[0,0]*B[1,1]* B[2,2]; S+=B[0,0]*B[1,1]* B[2,2]; print "-----------------" B = I132*A; print B[0,0]*B[1,1]* B[2,2]; S+=B[0,0]*B[1,1]* B[2,2]; print "-----------------" B=I23*A;print -B[0,0]*B[1,1]* B[2,2]; S-=B[0,0]*B[1,1]* B[2,2]; print "-----------------" B=I13*A; print -B[0,0]*B[1,1]* B[2,2]; S-=B[0,0]*B[1,1]* B[2,2]; print "-----------------" B=I12*A; print -B[0,0]*B[1,1]* B[2,2]; S-=B[0,0]*B[1,1]* B[2,2]; print "-----------------" print S; ## print 1*5*(-9) + (-4)*8*3 + 7*2*6 - 1*8*6 - 7*5*3 - (-4)*2*(-9) print "Representação matricial de Sim(4) " apeteco(); I = mat[4,4] = {1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1} I_12 = mat[4,4] = {0,1,0,0, 1,0,0,0, 0,0,1,0, 0,0,0,1} I_13 = mat[4,4] = {0,0,1,0, 0,1,0,0, 1,0,0,0, 0,0,0,1} I_14 = mat[4,4] = {0,0,0,1, 0,1,0,0, 0,0,1,0, 1,0,0,0} I_23 = mat[4,4] = {1,0,0,0, 0,0,1,0, 0,1,0,0, 0,0,0,1} I_24 = mat[4,4] = {1,0,0,0, 0,0,0,1, 0,0,1,0, 0,1,0,0} I_34 = mat[4,4] = {1,0,0,0, 0,1,0,0, 0,0,0,1, 0,0,1,0} I_12_34 = mat[4,4] = {0,1,0,0, 1,0,0,0, 0,0,0,1, 0,0,1,0} I_13_24 = mat[4,4] = {0,0,1,0, 0,0,0,1, 1,0,0,0, 0,1,0,0} I_14_23 = mat[4,4] = {0,0,0,1, 0,0,1,0, 0,1,0,0, 1,0,0,0} I_123 = mat[4,4] = {0,0,1,0, 1,0,0,0, 0,1,0,0, 0,0,0,1} I_124 = mat[4,4] = {0,0,0,1, 1,0,0,0, 0,0,1,0, 0,1,0,0} I_132 = mat[4,4] = {0,1,0,0, 0,0,1,0, 1,0,0,0, 0,0,0,1} I_134 = mat[4,4] = {0,0,0,1, 0,1,0,0, 1,0,0,0, 0,0,1,0} I_142 = mat[4,4] = {0,1,0,0, 0,0,0,1, 0,0,1,0, 1,0,0,0} I_143 = mat[4,4] = {0,0,1,0, 0,1,0,0, 0,0,0,1, 1,0,0,0} I_234 = mat[4,4] = {1,0,0,0, 0,0,0,1, 0,1,0,0, 0,0,1,0} I_243 = mat[4,4] = {1,0,0,0, 0,0,1,0, 0,0,0,1, 0,1,0,0} I_1234 = mat[4,4] = {0,0,0,1, 1,0,0,0, 0,1,0,0, 0,0,1,0} I_1243 = mat[4,4] = {0,0,1,0, 1,0,0,0, 0,0,0,1, 0,1,0,0} I_1324 = mat[4,4] = {0,0,0,1, 0,0,1,0, 1,0,0,0, 0,1,0,0} I_1342 = mat[4,4] = {0,1,0,0, 0,0,0,1, 1,0,0,0, 0,0,1,0} I_1423 = mat[4,4] = {0,0,1,0, 0,0,0,1, 0,1,0,0, 1,0,0,0} I_1432 = mat[4,4] = {0,1,0,0, 0,0,1,0, 0,0,0,1, 1,0,0,0} print " (134)(143) = " print "PrintMat(I_134*I_143,4,4) = ", PrintMat(I_134*I_143,4,4); quit;