Professional Documents
Culture Documents
UNMSM
UNMSM
UNMSM
B. (BxCxA)
C. (AxBxC)
UNMSM
2.-Dado el siguiente sistema resolver por el mtodo de CHOLESKY verificando sus condiciones
3X1 3X2 + 3X3 = 9 -3X1 + 4X2 4X3 = 12 3X1 4 X2 + 5X3 = 15 Las matrices que se obtienen del sistema son:
3 3 3 A = 3 4 4 3 4 5
9 , b = 12 15
X =
UNMSM
Utilizamos un if para saber si la matriz A es simetrica El resultado de nuestro if es verdadero por lo que imprime lo que esta dentro del if. La matriz A debe ser positiva, entonces cada determinante de sus submatrices debe ser positiva.
En matlab:
UNMSM
b). Si cumple (a) resolver el sistema por el mtodo de Cholesky con Matlab. Sean las matrices triangular inferior y superior L y Lt respectivamente. Entonces: A = L x Lt Lt se puede obtener fcilmente en matlab con la funcin chol: En matlab:
UNMSM
Ahora de nuestro sistema : AX = b -> (L . Lt) X = b Sea : y = Lt . X -> L. y = b
En matlab:
En matlab:
2;
=1
7
UNMSM
En matlab:
2 cos( ) ;
=1
En matlab:
| |
4 ;
= 1
En matlab:
UNMSM
( )=
3 4 ( 3)
+3 +1
( )
5.-Grafique las siguientes funciones, usando subplot, donde (i)Cada uno con color trazo, etiquetas diferentes (ii)Cada uno con ttulo y leyenda diferentes (iii)Cada uno con nombre eje x, eje y. ( ) ( ) ( ) = + 2; [1,2]
UNMSM
( ) ( ) ( )
cos( ) 1 ; ;
( )2 +1;
[2 , 2 ]
( )
() = 4 cos( ) 1 + 2 ;
+2
11.5 ;
[2, 2 ]
[2, 2]
(2 );
3;
[2,2 ]
[3,3]
[3,3 ] [2, 2 ]
>> x1=1:0.2:2; >> subplot(2,4,1) >> y1=exp(-x1)+x1-2; >> plot(x1,y1,'y.-') >> title('Grfico Numero 1'); >> xlabel('eje x');ylabel('eje y'); >> legend(exp(-x)+x-2')
10
UNMSM
>> subplot(2,4,2) >> x2=6.283:0.2:-6.283; >> y2=exp(-x2)*cos(x2)-1; >> plot(x2,y2,'mo:') >> title('Grfico Numero 2'); >> xlabel('eje x');ylabel('eje y'); >> legend(exp(-x)*cos(x)-1')
LABORATORIO DE METODOS NUMERICOS 11
UNMSM
>> subplot(2,4,3) >> x3=-2:0.2:2; >> y3=x3.^2*log(x3)-2*x3+1; >> plot(x3,y3,'cx-.') >> title('Grfico Numero 3'); >> xlabel('eje x');ylabel('eje y'); >> legend(x^2*log(x)-2*x+1') >> subplot(2,4,4) >> x4=-2:0.2:2; >> y4=exp(x4)-3*x4^2; >> plot(x4,y4,'r+--') >> title('Grfico Numero 4'); >> xlabel('eje x');ylabel('eje y'); >> legend(exp(x)-3*x^2') >> subplot(2,4,5) >> x5=-2:0.2:2; >> y5=exp(x5-1)-11.5*x5; >> plot(x5,y5,'gs:') >> title('Grfico Numero 5'); >> xlabel('eje x');ylabel('eje y'); >> legend(exp(x-1)-11.5*x) >> subplot(2,4,6) >> x6=-3:0.2:3; >> y6=exp(-x6)+2*x6^2-3; >> plot(x6,y6,'bd--') >> title('Grfico Numero 6');
LABORATORIO DE METODOS NUMERICOS 12
>> xlabel('eje x');ylabel('eje y'); >> legend(' exp(-x)+2*x^2-3') >> subplot(2,4,7) >> x7=-2:0.2:2; >> y7=x7+ln(2-x7); >> plot(x7,y7,'cx-.') >> title('Grfico Numero 7'); >> xlabel('eje x');ylabel('eje y'); >> legend(' x+ln(2-x);') >> subplot(2,4,8)
UNMSM
13