Nothing Special   »   [go: up one dir, main page]

Como Usar Los Programas

Descargar como txt, pdf o txt
Descargar como txt, pdf o txt
Está en la página 1de 3

GAUSS LEGENDRE

-la funcion "gale" sirve para hallar cualquier integral


>> gale('1-exp(-1*12.5/68.1*x)',0,10)
Puntos Integral error
2 5.4320 -0.200159288
3 5.4212 -0.001438780
4 5.4211 -0.000006368
5 5.4211 -0.000004879
6 5.4211 0.000000524
integral exacta= 5.4211
>>

-la funcion "galep1" sirve solo para el ejemplo 22.5 del Chapra pag. 662
>> galep1('1-exp(-1*12.5/68.1*x)',0,10)
Puntos Integral erro
2 290.014477840 -0.200159288
3 289.439310847 -0.001438780
4 289.435164941 -0.000006368
5 289.435160633 -0.000004879
6 289.435144995 0.000000524
integral exacta= 289.4351
>>

ELIMINACION DE GAUSS CON PIVOTEO PARCIAL


ejemplo 9.5 del Chapra pag.258

>> a=[3 -0.1 -0.2;0.1 7 -0.3;0.3 -0.2 10];


>> b=[7.85 -19.3 71.4];
>> [x,mafac,mts,mo,msv]=eligauss3m1(a,b,0.00001)
Se ha pivoteado 0 veces

x =

3.0000 -2.5000 7.0000

mafac =

0 0 0
0.0333 0 0
0.1000 -0.0271 0

mts =

3.0000 -0.1000 -0.2000


0 7.0033 -0.2933
0 0 10.0120

mo =

3.0000 -0.1000 -0.2000


0.1000 7.0000 -0.3000
0.3000 -0.2000 10.0000
msv =

3.0000
-2.5000
7.0000

>>

ECUACIONES DIFERENCIALES- EULER


EJEMPLO 25.1 DEL CHAPRA pag. 721

>> eulern2
Ingrese la funcion problema: -2*x^3+12*x^2-20*x+8.5
Ingrese el valor inicial variable dependiente: 1
Ingrese el valor inicial variable independiente: 0
Ingrese el valor final variable independiente: 4
Ingrese el tama�o de paso: 0.5
Ingrese el intervalo de salida: 0.5
x y euler yver ever
0.000000000 1.000000000 1.000000000 0.000000000
0.500000000 5.250000000 3.218750000 -63.106796117
1.000000000 5.875000000 3.000000000 -95.833333333
1.500000000 5.125000000 2.218750000 -130.985915493
2.000000000 4.500000000 2.000000000 -125.000000000
2.500000000 4.750000000 2.718750000 -74.712643678
3.000000000 5.875000000 4.000000000 -46.875000000
3.500000000 7.125000000 4.718750000 -50.993377483
4.000000000 7.000000000 3.000000000 -133.333333333
>>

SISTEMAS DE ECUACIONES DIFERENCIALES (2 ecuaciones) - RUNGE-KUTTA 4TO ORDEN


Este programa resuelve con las variables 'x','y1','y2'
EJEMPLO 25.10 DEL CHAPRA pag. 754

>> rk4sis2valerr
Ingrese la funcion problema 1: -0.5*y1
Ingrese la funcion problema 2: 4-0.3*y2-0.1*y1
Ingrese los valores iniciales variables dependientes: [4,6]
Ingrese el valor inicial variable independiente: 0
Ingrese el valor final variable independiente: 2
Ingrese el tama�o de paso: 0.5
Ingrese el intervalo de salida: 0.5
x y1 y2 y1ver y2ver
err1 err2
0.0000 4.000000000 6.000000000 4.000000000 6.000000000
0.000000000 0.000000000
0.5000 3.115234375 6.857670312 3.115203132 6.857660453
-0.001002911 -0.000143776
1.0000 2.426171303 7.632105673 2.426122639 7.632091260
-0.002005832 -0.000188856
1.5000 1.889523061 8.326885977 1.889466211 8.326870357
-0.003008763 -0.000187581
2.0000 1.471576798 8.946865100 1.471517765 8.946850279
-0.004011704 -0.000165658
>>
SISTEMAS DE ECUACIONES DIFERENCIALES (3 ecuaciones) - RUNGE-KUTTA 4TO ORDEN
Este programa resuelve con las variables 'x','y1','y2','y3'

Este es un problema creado por mi y que no tiene mucha complejidad

dy1/dx=x^2
dy2/dx=exp(x)
dy3/dx=2*exp(x)
y1(0)=0
y2(0)=1
y3(0)=2
Integrar de 0 a 5 con un tama�o de paso de 1

>> rk4sis3valerr
Ingrese la funcion problema 1: x^2
Ingrese la funcion problema 2: exp(x)
Ingrese la funcion problema 3: 2*exp(x)
Ingrese los valores iniciales variables dependientes: [0,1,2]
Ingrese el valor inicial variable independiente: 0
Ingrese el valor final variable independiente: 5
Ingrese el tama�o de paso: 1
Ingrese el intervalo de salida: 1
x y1 y2 y3 y1ver y2ver
y3ver err1 err2 err3
0.0000 0.000000000 1.000000000 2.000000000 0.000000000 1.000000000
2.000000000 0.000000000 0.000000000 0.000000000
1.0000 0.333333333 2.718861152 5.437722304 0.333333333 2.718281828
5.436563657 0.000000000 -0.021312118 -0.021312118
2.0000 2.666666667 7.391210187 14.782420373 2.666666667 7.389056099
14.778112198 -0.000000000 -0.029152407 -0.029152407
3.0000 9.000000000 20.091971664 40.183943328 9.000000000 20.085536923
40.171073846 0.000000000 -0.032036689 -0.032036689
4.0000 21.333333333 54.616220796 109.232441592 21.333333333 54.598150033
109.196300066 -0.000000000 -0.033097757 -0.033097757
5.0000 41.666666667 148.462859852 296.925719705 41.666666667 148.413159103
296.826318205 -0.000000000 -0.033488102 -0.033488102
>>

También podría gustarte