Documente Academic
Documente Profesional
Documente Cultură
INTRODUCCIN
Tanto la ciencia y la tecnologa nos describen los fenmenos reales
mediante modelos matemticos. El estudio de estos modelos permite un
conocimiento ms profundo del fenmeno, as como de su evolucin
futura.
Desafortunadamente, no siempre es posible aplicar mtodos analticos
clsicos por diferentes razones: La solucin formal es tan complicada
que hace imposible cualquier interpretacin posterior; simplemente no
existen mtodos analticos capaces de proporcionar soluciones al
problema; no se adecuan al modelo concreto; o su aplicacin resulta
excesivamente compleja.
Para este tipos de casos
son tiles las tcnicas numricas, que
mediante una labor de clculo ms o menos intensa, conducen a
soluciones aproximadas que son siempre numricos.
La importante del clculo radica en que implica la mayora de estos
mtodos hacen que su uso est ntimamente ligado al empleo de
computadores, que mediante la programacin nos permite la solucin de
problemas matemticos.
Para la realizacin de este trabajo se utiliz el programa MATLAB.
| Clculo numrico
CAPITULO I:
f (a)f (b)<0
x n=( a+b)/2
< 0 Entonces
f (a)f (x n)>0
f (a)f (x n)=0
Entonces
Entonces
xn
b=x n
a=x n
Es la Raz
x n+1=( a+b)/2
| Clculo numrico
( x n +1x n )/x n +1 E
No. (Falso) Repetir el paso 3, 4 y 5
S. (Verdadero) Entonces
x n+1
Es la Raz
| Clculo numrico
| Clculo numrico
f=get(handles.edit1,'string');
f=inline(f);
a=str2double(get(handles.edit2,'string'));
b=str2double(get(handles.edit3,'string'));
E=str2double(get(handles.edit4,'string'));
if f(a)*f(b)< 0
while abs(b-a)>E
x=(a+b)/2;
if f(a)*f(x)==0
a=b;
else
if f(a)*f(x)<0
b=x;
else
a=x;
end
| Clculo numrico
6
end
set(handles.edit5,'string',x);
end
else
set(handles.edit5,'string','No existe la raiz en el intervalo');
end
CDIGO EN EL BOTN GRAFICAR:
function varargout
handles, varargin)
pushbutton2_Callback(h,
eventdata,
f=get(handles.edit1,'string');
f=inline(f);
ezplot(f), grid on
CDIGO EN EL BOTN SALIR:
function pushbutton6_Callback(hObject, eventdata, handles)
close
| Clculo numrico
aproximacin
x 1=g (x 0).
y calculamos una
Reemplazamos
el
nuevo
la
solucin
del
problema.
y=x
x1
ms prximo a la
solucin final.
Sin embargo, el mtodo puede divergir fcilmente. Es fcil
comprobar que el mtodo slo podr converger si la derivada
g ' (x) es menor en valor absoluto que la unidad (que es la
pendiente de la recta definida por
y=x .
Un ejemplo de este
| Clculo numrico
6
De forma que tomando un
valor de
g (x )
adecuado, siempre
CONVERGENCIA:
El mtodo
g ' ( x) 1
de
aproximaciones
sucesivas
converge
si
Co
Convergencia Montona
Montona
Divergencia
| Clculo numrico
| Clculo numrico
| Clculo numrico
| Clculo numrico
x1
x0
y obtiene
f ( x0 )
f ' (x 0 )
f (xi)
hace que
presente,
esto
puede
| Clculo numrico
| Clculo numrico
| Clculo numrico
| Clculo numrico
4. MTODO DE LA SECANTE:
4.1. TEORA:
| Clculo numrico
x
f ( x i1 ) f ( i)
f ( xi )(x i1 xi )
x i+1=x i
| Clculo numrico
CDIGO EN EL BOTN6CALCULAR:
function varargout = pushbutton3_Callback(h, eventdata,
handles, varargin)
f=inline(get(handles.edit1,'string'));
x0=str2double(get(handles.edit2,'string'));
x1=str2double(get(handles.edit3,'string'));
E=str2double(get(handles.edit4,'string'));
while abs(x1-x0)>E
x2=x1-(((x1-x0)*f(x1))/(f(x1)-f(x0)));
x0=x1;
x1=x2;
end
set(handles.edit5,'string',x2)
CDIGO EN EL BOTN GRAFICAR:
function varargout = pushbutton4_Callback(h, eventdata,
handles, varargin)
f=get(handles.edit1,'string');
f=inline(f);
ezplot(f), grid on
CDIGO EN EL BOTN SALIR:
function pushbutton3_Callback(hObject, eventdata, handles)
close(secante)
| Clculo numrico
5. MTODO DE LIN:
5.1. TEORA:
Dada la ecuacin
n
P ( x )=a0 x + a1 x
n1
P( x)=0
+a2 x
n2
++ an1 x + an ; a0 0 (1)
Rx+ S
es el residuo
Polinomio reducido
Multiplicando
P( x)
P ( x )=( b0 x n + p b0 x n1 +q b 0 x n2 ) + ( b1 x n1 + p b1 xn 2 +q b1 x n3 ) + ( b2 x n2 + p b2 x n3+ q b2 x n4 ) ++ ( b n3
Igualando coeficientes de la misma potencia
a0 =b0 b0 =a0
| Clculo numrico
a1= p b 0+ b1 b1=a 1 p b0
a2=q b0 + p b1 +b 2 b 2=a2q b0 p b 1
a3 =q b1 + p b2 +b 3 b 3=a3 q b1 p b 2
.
.
an1=q bn3 + p bn2 + R R=an1q bn2 p bn3
an =q b n2 + S S=anq bn2
En general:
Para que
ser cero.
R=an1 p bn2q bn3=0 entonces p=
an1q bn3
bn2
an
bn 2
Se define:
Entonces
Si
p=
R
b n2
y q=
S
b n2
| Clculo numrico
k=n:1:-1
b(n+1)=0
b(n+2)=0
b(k)=a(k)-p*b(k+1)-q*b(k+2)
p=p+P;
q=q+Q;
k=n:1:-1
b(k)=a(k)-p*b(k+1)-q*b(k+2);
b(n+1)=0;
b(n+2)=0;
i=n:1:-1
c(n+1)=0;
c(n+2)=0;
c(i)=b(i)-p*c(i+1)-q*b(i+2)
i=n:1: -1
c(i)=b(i)-p*c(i+1)-q*b(i+2);
c(n+1)=0;
c(n+2)=0;
P=(b(1)*c(4)-b(2)*c(3))/(c(2)*c(4)-(c(3))^2);
Q=(b(2)*c(2)-b(1)*c(3))/(c(2)*c(4)-(c(3))^2);
P=(b(1)*c(4)-b(2)*c(3))/(c(2)*c(4)-(c(3))^2);
Q=(b(2)*c(2)-b(1)*c(3))/(c(2)*c(4)-(c(3))^2
p=p+P;
q=q+Q;
x1=(-p+sqrt(p^2-4*q))/2;
x2=(-p-sqrt(p^2-4*q))/2;
ESCRIBIR
X1, X2
FIN
| Clculo numrico
function
pushbutton1_Callback(hObject,
eventdata,
handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see
GUIDATA)
a=str2num(get(handles.edit1,'string'));
p=str2double(get(handles.edit2,'string'));
q=str2double(get(handles.edit3,'string'));
E=str2double(get(handles.edit4,'string'));
n=length(a);
for k=n:-1:1
b(n+1)=0;
b(n+2)=0;
b(k)=a(k)-p*b(k+1)-q*b(k+2);
end
for i=n:-1:1
c(n+1)=0;
c(n+2)=0;
c(i)=b(i)-p*c(i+1)-q*b(i+2);
end
| Clculo numrico
6
P=(b(1)*c(4)-b(2)*c(3))/(c(2)*c(4)-(c(3))^2);
Q=(b(2)*c(2)-b(1)*c(3))/(c(2)*c(4)-(c(3))^2);
while P>E & Q>E
p=p+P;
q=q+Q;
for k=n:-1:1
b(k)=a(k)-p*b(k+1)-q*b(k+2);
b(n+1)=0;
b(n+2)=0;
end
for i=n:-1:1
c(i)=b(i)-p*c(i+1)-q*b(i+2);
c(n+1)=0;
c(n+2)=0;
end
P=(b(1)*c(4)-b(2)*c(3))/(c(2)*c(4)-(c(3))^2);
Q=(b(2)*c(2)-b(1)*c(3))/(c(2)*c(4)-(c(3))^2);
end
p=p+P;
q=q+Q;
x1=(-p+sqrt(p^2-4*q))/2;
x2=(-p-sqrt(p^2-4*q))/2;
set(handles.edit5,'string',x1);
set(handles.edit6,'string',x2);
function
handles)
close
pushbutton2_Callback(hObject,
eventdata,
| Clculo numrico
CAPITULO II
SISTEMA DE ECUACIN LINEAL
6. MTODO DE GAUSS - JORDAN
6.1. TEORA:
Sea un sistema de ecuaciones lineales de la forma:
a 11
a21
a31
a 11
a12
a22
a32
a12
a13
a23
a33
a13
Es decir
a1 n
a2 n
a3 n
a1 n
x1
b1
)( ) ( )
x2
b2
x3 = b3
xn
bn
A X=B
| Clculo numrico
6
Donde A es la matriz de coeficientes,
X es el vector incgnitas y
B es el vector trminos independientes.
PROCEDIMIENTO:
Crear la matriz cuyos elementos son los de la matriz A y el
vector B. A es la matriz se le denomina la matriz aumentada.
a11
a21
a31
a n1
a 12
a 22
a 32
an 2
a13
a23
a33
an3
|)
a 1n b1
a 2 n b2
a 3 n b3
ann bn
Matriz aumentada
( |)
1
0
0
0
1
0
0
0
1
0b1
0b2
0 b 3
1 b n
Matriz transformada
El proceso, requiere de
n3 2 n
+n
2
2
multiplicaciones y
n3 n
2 2
sumas.
| Clculo numrico
| Clculo numrico
pivote = A(k,i); 6
for j=i:n
A(k,j)=A(k,j)- pivote*A(i,j);
end
end
end
end
for i=1:m
x(i)=A(i,n);
end
x=x';
t=1:m;
t=t';
cadena='';
for t=1:m
cad=sprintf('x%d=%6.2f',t,x(t));
cadena=[cadena;cad];
end
set(handles.edit2,'string',cadena);
CDIGO EN EL BOTN SALIR:
function varargout = pushbutton3_Callback(h, eventdata,
handles, varargin)
close
| Clculo numrico
como
X=B,
x 1=b1 /a11
x 2=( b 2a21 ( b1 /a11 ) ) /a 22
x 3=( b3a31 ( b 1 /a11 )a32 ( b2a21 ( b 1 /a11 ) ) /a22) /a 33
..
Los
6
La convergencia puede definirse
mediante
Ex =
i
x i xi
xi j
j1
100<T
Dnde:
Ex
xi
raz
j : Iteracin actual
j1 : Iteracin anterior
T : Tolerancia prefijada
RE ARREGLO DE ECUACIONES
El proceso de gauss - Seidel converge si la matriz coeficientes
cada elemento de la diagonal es el mayor en valor absoluto
que la suma de todos los dems elementos de la misma fila o
columna .Es decir se asegura la convergencia s.
n
i=1
ji
i=1
j i
| Clculo numrico
| Clculo numrico
CDIGO EN EL BOTN6CALCULAR:
function varargout = pushbutton1_Callback(h, eventdata,
handles, varargin)
maxite=str2double(get(handles.edit1,'string'));
v=str2num(get(handles.edit2,'string'));
a=str2num(get(handles.edit3,'string'));
b=str2num(get(handles.edit4,'string'));
[n,n]=size(a);
cad1='';
for k=1:maxite
for i=1:n
x(i)=v(i);
end
for i=1:n
s=0;
for j=1:n
if j~=i
s=s+a(i,j)*x(j);
end
end
v(i)=(b(i)-s)/a(i,i);
x(i)=v(i);
end
for t=1:n
cad2=sprintf('x%d=%10.8f ',t,x(t));
cad1=[cad1,cad2];
end
cad2=sprintf('\n',t);
cad1=[cad1,cad2];
end
set(handles.edit5,'string',cad1);
CDIGO EN EL BOTN SALIR:
function varargout = pushbutton3_Callback(h, eventdata,
handles, varargin)
close(gauusseidel)
INTERPOLACIN
8. INTERPOLACIN LINEAL:
8.1. TEORA:
[a ,b ] ,
dicho intervalo.
Supongamos que disponemos de las siguientes parejas de
datos:
x x0 x1 x2 xn
| Clculo numrico
y y0 y1 y2
yn
( x i )= y i(0 i n)
Se dice entonces que la funcin
f ( x)
definida por la
| Clculo numrico
8.2.
DIAGRAMA DE
FLUJO:
| Clculo numrico
6
8.3. CDIGO DE PROGRAMA:
| Clculo numrico
6
INTERPOLACIN
POLINMICA
9. POLINOMIO DE LAGRANGE:
9.1. TEORA:
Si
x0 , x1 , x2 , , xn
n+1
son
puntos distintos y
f ( x)
es una
P ( x )= f ( x k ) Ln ,k (x ) polinomio de lagrange
k=0
Dnde:
n
Ln ,k ( x )=
i=0
ik
xxi
x k x i
xx1
xx 0
; L1,1 (x)=
x 0x 1
x 1x 0
Entonces:
P ( x )=
xx 1
xx 0
f ( x0 ) +
f ( x1 )
x 0x 1
x 1x 0
| Clculo numrico
6
P ( x )=f ( x 0 ) L2,0 ( x ) +f ( x 1 ) L2,1 ( x ) +f ( x 2 ) L2,2 ( x)
Dnde:
xx 1 xx 2
L1,0 ( x )=
x 0x 1 x 0 x2
L2,1 ( x )=
L2,2 ( x )=
(
(
(
xx 0
x1 x0
xx 0
x2 x0
)(
)(
)(
xx 2
x 1x 2
xx 1
x 2x 1
)
)
)
xx 1
x 0x 1
)(
xx 2
xx 0
f ( x0 )+
x 0 x2
x 1x 0
)(
xx 2
xx 0
f ( x1 )+
x 1x 2
x 2x 0
)(
xx 1
f ( x2 )
x2 x1
| Clculo numrico
| Clculo numrico
| Clculo numrico
6
function pushbutton3_Callback(hObject,
eventdata, handles)
f=inline(get(handles.edit2,'string'));
ezplot(f),grid on
| Clculo numrico
6
AJUSTES POLINOMIALES
10.REGRESIN POLINOMIAL :
10.1. TEORA:
Supongamos que se conocen los datos
x
, ..
,y
con
,x
, .., x n
,y
x
,
nmeros
,y
reales
k 0
Sea mnima.
p
(x)
se puede escoger
a
S
,a
, .., a
una condicin
S
2 a 0 a 1 x k a 2 x 2k ..... a m x mk y k 0
necesaria
la existencia de un mnimo relativo de esta
a 0para
k 0
,a
, .., a
2 a 0 a 1 x k a 2 x k ..... a m x y0 k x k1 0
k 0
1
con respecto
a
n
a ,
j
j=0,1, 2, , m
m
S
k
sean cero.
S
2 a 0 a 1 x k a 2 x 2k ..... a m x mk y k x 2k 0
a 2 k 0 las siguientes m+1 ecuaciones lineales en las
Resultanentonces
a
..........
incgnitas
,a
, .., a
n
S
2 a 0 a 1 x k a 2 x 2k ..... a m x mk y k x kj 0
a j k 0
| Clculo numrico
............
n
S
2 a 0 a 1 x k a 2 x 2k ..... a m x mk y k x mk 0
a m k 0
k 0
n 1 a 0
Obtenemos:
n 1 a 0 x k a 1 x 2k a 2 ..... x mk a m
n
x
k 0
n
x
k 0
a0
k
2
k
k 0
n
k 0
n
a0
k 0
a1
k
3
k
a1
x kj a 0
k 0
x mk a 0
k 0
k 0
n
x
k 0
n
x
k 0
.
.
4
k
a 2 .....
a 2 .....
k 0
n
k 0
n
x
k 0
m 1
k
m2
k
am
am
x 2k j a 2 .....
k 0
x mk j a m
k 0
x 1k m a 1
k 0
x 2k m a 2 .....
k 0
x mk m a m
k 0
k 0
n
k 0
n
k 0
...
x 1k j a 1
k 0
yk
2
k
yk
...
:::
x
k 0
n
x
k 0
j
k
yk
m
k
yk
i 0
k 0
k 0
a i x ik j x kj y k
con j 0,1,....,.m
p m x k a 0 a 1 x k a 2 x 2k ,....., a m x mk y k
i
x j , j=0, 1, , m,
a 0 x kj a 1 x k x kj a 2 x 2k x kj ,....., a m x mk x kj y k x kj
a 0 x kj a 1 x 1k j a 2 x 2k j ,....., a m x mk j x kj y k
Sumando sobre k
n
k 0
k 0
k 0
k 0
k 0
a 0 x kj a 1 x 1k j a 2 x 2k j ..... a m x mk j x kj y k
10.2.
con j 0,1,2,....., m
DIAGRAMA DE FLUJO:
| Clculo numrico
| Clculo numrico
6
yy=a*xx+b;
ezplot(x,y,'or',xx,yy),grid on
CAPITULO - III
INTEGRACIN NUMRICA
11.
11.1.
TEORA:
Este mtodo resulta de sustituir la funcin
polinomio de primer grado
P ( x )=a0 +a1 x
en
y=f ( x)
por un
[ a , b ] =[ x 0 , x 1 ]
al
polinomio
P( x)
polinomio
P( x)
6
x1
P ( x ) dx=
x0
( x x1 )
( xx 0 )
f ( x0 ) +
f ( x1 ) dx
( x 0x 1 )
( x 1x 0 )
x1
f ( x ) dx=
x0
Resolviendo:
f ( x ) dx=
h
[ f (x 0)f (x 1) ] , donde h=x 1x 0
2
b
Generalizando:
x2
x1
xn
f ( x ) dx+ f ( x ) dx ++ f ( x ) dx= f ( x ) dx
x1
x0
x n1
x1
f ( x ) dx+
x0
f ( x ) dx=lim
f (x n) x k
n
a
11.2.
k=1
DIAGRAMA DE FLUJO:
| Clculo numrico
| Clculo numrico
TEORA:
En el intervalo
[ a , b ] =[x 0 , x2 ]
al polinomio
P (x )
se le puede
x1
f ( x ) dx
a
x0
[( )( ) ( )( ) ( )( ) ]
xx 1
x 0x 1
xx 2
xx 0
f ( x0 )+
x 0 x2
x 1x 0
xx 2
xx 0
f ( x1 )+
x 1x 2
x 2x 0
xx 1
f ( x 2 ) dx
x2 x1
| Clculo numrico
6
Resolviendo la integral se obtiene:
b
f ( x ) dx h3 [ f ( x 0 ) +4 f ( x 1 ) +f ( x 2 ) ] , donde h=
a
x 2x 0
2
x4
x6
xn
x2
x4
x n2
Aplicando la regla
tiene:
f ( x ) dx h3 [ f ( x 0 ) +4 f ( x 1 ) +2 f ( x 2 )+ 4 f ( x 3 )+ 2 f ( x 4 ) ++ 2 f ( xn2 ) + 4 f ( x n1 ) + f ( xn ) ]
a
Dnde:
ba x nx 0
h=
=
; donde n es multiplo de 2
n
n
x i=x 0+ ih; i=1,2,3 n
12.2.
DIAGRAMA DE FLUJO:
| Clculo numrico
| Clculo numrico
eventdata,
eventdata,
| Clculo numrico
TEORA:
La regla de Simpson de 3/8 resulta cuando se sustituye la funcin
y=f (x) por un polinomio de tercer grado es decir:
b
En el intervalo
[ a , b ] =[x 0 , x2 ]
P (x )
al polinomio
se le puede
b =x 3
a =x 0
x2 x0
3
| Clculo numrico
| Clculo numrico
function varargout
handles, varargin)
pushbutton3_Callback(h,
eventdata,
f=inline(get(handles.edit1,'string'))
a=str2double(get(handles.edit2,'string'))
b=str2double(get(handles.edit3,'string'))
n=str2double(get(handles.edit4,'string'))
h=(b-a)/n
for i=1:n+1
x(i)=a+(i-1)*h
end
if rem(n,3)==0
s=0
for i=3:n+1:3
s=s+f(x(i-2))+3*f(x(i-1))+3*f(x(i))+f(x(i-1))
end
I=((3*h)/8)*s;
set(handles.edit5,'string',I)
end
CDIGO EN EL BOTN GRAFICAR:
6
s=f(a)+f(b)
for i=1:n+1
x(i)=a+((i-1)*h)
y(i)=f(x(i));
end
x=[x,b,a,a]
y=[y,0,0,f(a)]
fill(x,y,[0.6 0.8 0.4])
for i=1:n+1
x(i)=a+((i-1)*h)
y(i)=f(x(i));
line([x(i),x(i)],[0,f(x(i))])
end
hold on
ezplot(f,[min(x):0.2:max(x)]);
13.4.
14.
INTEGRALES MLTIPLES
| Clculo numrico
14.1.
TEORA:
f ( x , y ) dA
R
Dnde:
R= { ( x , y ) /a x b ; c y d }
R= { ( x , y ) /a x b ; c g ( x ) d }
Para aproximar la solucin de la integral
b g2 ( x )
f ( x , y ) dy dx
a g1 ( x )
x 2x 0
g 2( x )g1 (x )
; h 2=
2
2
Por lo tanto:
b g2 ( x )
x2
f ( x , y ) dy dx= w ( x ) dx= 31 [ w ( x 0 ) + 4 w ( x 1 ) + w ( x2 ) ]
a g1 ( x )
x0
Dnde:
w ( x )=
h2
[ f (x , g1 ( x ))+ 4 f (x , g1 ( x ) +h2 (x ))+ f (x , g2 ( x ))]
3
| Clculo numrico
I=(h/3)*(w(1)+4*w(2)+w(3))
ESCRIBIR
I
FIN
| Clculo numrico
ezmesh(f1);
grid on
CAPITULO - IV
ECUACIONES DIFERENCIALES
ORDINARIAS
15.METODO DE EULER:
| Clculo numrico
15.1.
TEORA:
Este mtodo
los
n+
x i=x 0+ ih ; i=1,2,3 n
puntos
la
h=
( ba )
n
[a ,b ]
x 0 , x 1 , x 2 , .. , x n =x f
condicin
P0=(x 0 , y 0 )
en n
inicial
por donde
donde
y ( x0 ) = y 0
pasa
la
( x 0 , y0 )
=f ( x 0 , y 0 )
FORMULA DE EULER
y i+1= yi +h ( x i , y i) , i=1,2,3 n
Es decir, se genera una sucesin de aproximacin:
y 1= y 0 +h f ( x 0 , y 0 )
| Clculo numrico
y 2= y 1 +h f ( x 1 , y 1 )
y 3= y 2 +h f ( x 2 , y 2)
y n= y n1 +h f ( x n1 , y n1)
15.2.
DIAGRAMA DE FLUJO:
| Clculo numrico
| Clculo numrico
15.3.
CDIGO DE PROGRAMA:
pushbutton6_Callback(h,
eventdata,
f1=get(handles.edit1,'string'); f=inline(f1,'x','y');
x(1)=str2double(get(handles.edit2,'string'));
y(1)=str2double(get(handles.edit3,'string'));
n=str2double(get(handles.edit4,'string'));
b=str2double(get(handles.edit5,'string'));
h=(b-x(1))/n;
| Clculo numrico
6
cad1=sprintf('Iter. x %d. %8.4f
%8.4f\n',1,x(1),y(1));
for i=1:n
y(i+1)=y(i)+h*f(x(i),y(i));
x(i+1)=x(i)+h;
cad2=sprintf('%d. %8.4f
%8.4f\n',i+1,x(i+1),y(i+1));
cad1=[cad1,cad2];
end
set(handles.edit7,'string',cad1);
CDIGO EN EL BOTN GRAFICAR:
function varargout
handles, varargin)
pushbutton2_Callback(h,
eventdata,
f1=get(handles.edit1,'string');
f=inline(f1,'x','y');
ezmesh(f);
grid on
CDIGO EN EL BOTN SALIR:
15.4.
| Clculo numrico
TEORA:
condiciones iniciales
entonces por el
segundo
xn
[ x n , x n+1 ]
se le
h /2 '
h
y ( x n ) + 4 y ' x n+ + y ' ( x n+1 )
3
2
xn+ 1
xn
Al
trmino
2 y' x n +
h
h
+2 y ' x n+
2
2
) (
4 y' x n +
h
2
se
le
expresa
como:
)
| Clculo numrico
para
aproximar
la
pendiente
de
y ' x n+
h
2
en
el
punto
( x + h2 )
promedio
y ( xn +1 )= y ( x n ) +
h '
h
h
y ( x n ) +2 y' x n + +2 y ' x n+ + y ' ( x n+1 )
6
2
2
) (
Pero
y ' =f ( x n , y n )
y ( xn +1 )= y ( x n ) +hf ( x n , y n )
k 1= y ' ( x n )
entonces
k 1=f ( x n , y n )
x
Hagamos
y xn +
h
k 2= y ' x n +
2
h
y ( n+ )
2
h
xn + ,
2
k 2=f
entonces
h
h
= y ( xn )+ f ( xn , yn )
2
2
por euler :
entonces
h
h
k 2=f x n + , y n + k 1
2
2
)
x
Hagamos
y xn +
k 3 = y ' xn +
h
2
h
h
= y ( xn )+ y' ( xn , yn )
2
2
entonces
h
y ( n+ )
2
h
xn + ,
2
k 3=f
por euler
entonces:
| Clculo numrico
h
h
k 3 =f x n + , y n + k 2
2
2
x
Hagamos
'
k 4= y ( xn +1 )
y ( xn +1 ) = y ( x n) + h y ' x n +
h
2
entonces
h
y ( n+ )
2
h
xn + ,
2
k 4=f
por euler
entonces:
k 4=f ( xn +1, y 0 +h k 3 )
Por lo tanto:
y ( xn +1 ) = y n +
h
[ k +2 k 2 +3 k 3+ k 4 ]
6 1
Dnde:
x x
h= n+1 n ; mes el numero de intervalos .
m
16.2.
DIAGRAMA DE FLUJO:
| Clculo numrico
| Clculo numrico
16.3.
CDIGO DE PROGRAMA:
close(kutta1)
16.4.
| Clculo numrico