Documentos de Académico
Documentos de Profesional
Documentos de Cultura
CI171 Unidad 6 Integración Numerica 2022 01
CI171 Unidad 6 Integración Numerica 2022 01
MÉTODOS
COMPUTACIONALES
CI 171
TEMARIO
5. CUADRATURA DE GAUSS
INTRODUCCIÓN Y APLICACIÓN EN LA INGENIERÍA
Ingeniería Estructural:
Ingeniería Hidráulica: cálculo determinar la fuerza neta,
del área de la sección no uniforme, que ejerce el
transversal de un río. viento al soplar un lado de
un edificio.
MÉTODOS DE INTEGRACIÓN NUMÉRICA
Forma
cerrada
REGLA DEL TRAPECIO: SIMPLE
Aproximar el
área del trapecio
bajo la línea
recta f(a) – f(b)
REGLA DEL TRAPECIO: SIMPLE
REGLA DEL TRAPECIO: SIMPLE
REGLA DEL TRAPECIO: SIMPLE
Solución:
REGLA DEL TRAPECIO: SIMPLE
fprintf('\t\tTRAPECIO SIMPLE\n')
f=input('ingrese la funcion \n f(x)=');
b=input('ingrese el limite superior de la integral\n');
a=input('ingrese el limite inferior de la integral\n');
f=inline(f);
n=input('ingresar el numero de intervalos n=');
h=(b-a)/n;
%Formula del trapecio Simple
s=h*(f(a)+f(b))/2;
fprintf('El valor aproximado es: %10.15f\n',s)
% Còdigo Graficar
TrapecioSimple('0.2+25*x-200*x.^2+675*x.^3-900*x.^4+400*x.^5',0,0.8,1)
REGLA DEL TRAPECIO: SIMPLE
%Graficando
x=linspace(a,b,n+1);
y=f(x);
plot(x,y,'o')
hold on
%para las curvas
x1=linspace(a,b);
y1=f(x1);
plot(x1,y1,'r','lineWidth',2)
hold on
stem(x,y,'b')
hold on
y2=interp1(x,y,x1,'linear');
plot(x1,y2,'k');
title('TRAPECIO SIMPLE')
xlabel(sprintf('El valor de la Integral es: %7.7f',s));
REGLA DEL TRAPECIO: SIMPLE
SOLUCIÓN:
REGLA DEL TRAPECIO: MÚLTIPLE
Representación
general.
REGLA DEL TRAPECIO: MÚLTIPLE
Ejemplo:
Utilizar la Regla del Trapecio para integrar f(x), con n = 4.
Solución:
REGLA DEL TRAPECIO: MÚLTIPLE
REGLA DEL TRAPECIO: MÚLTIPLE
f=input('Ingresar la Función f=');
% f='0.2+25*x-200*x.^2+675*x.^3-900*x.^4+400*x.^5'
a=input('Ingresar el limite inferior a=');
b=input('Ingresar el limite superior b=');
n=input('ingresar el numero de intervalos n=');
h=(b-a)/n;
f=inline(f);
s=0;
for i=1:n
s=h*(f(a+(i-1)*h)+f(a+(i)*h))/2 + s;
end
fprintf('el area integral aproximada es:%10.15f\n\n',s);
% Còdigo Graficar
TrapecioMultiple('0.2+25*x-200*x.^2+675*x.^3-900*x.^4+400*x.^5',0,00.8,8)
REGLA DEL TRAPECIO: MÚLTIPLE
SOLUCIÓN:
REGLA DE SIMPSON 1/3 y 3/8 SIMPLE
Mejor estimación de una integral se logra utilizando polinomios de orden
superior, para unir los puntos. Las fórmulas resultantes de calcular la
integral bajo estos polinomios se conoce como REGLAS DE SIMPSON.
Ejemplo:
Utilizar la Regla de Simpson 1/3 para integrar:
SimpsonS13('0.2+25*x-200*x.^2+675*x.^3-900*x.^4+400*x.^5',0,0.8,2)
REGLA DE SIMPSON 1/3 SIMPLE
SOLUCIÓN:
REGLA DE SIMPSON 1/3 MULTIPLE
Ejemplo:
Utilizar la Regla de Simpson 1/3 de aplicación múltiple para integrar f(x), con n
= 4.
Solución:
REGLA DE SIMPSON 1/3 MULTIPLE
function [s] = SimpsonM13(f,a,b,n)
%n=4 minimo y tiene que ser par
h=(b-a)/n;
f=inline(f);
x=linspace(a,b,n+1);
s=f(a)+f(b);
for i=2:2:n
s=s+4*f(x(i));
end
for i=3:2:n-1
s=s+2*f(x(i));
end
s=s*h/3;
SimpsonM13('0.2+25*x-200*x.^2+675*x.^3-900*x.^4+400*x.^5',0,0.8,4)
REGLA DE SIMPSON 1/3 MULTIPLE
SOLUCIÓN:
REGLA DE SIMPSON 3/8 SIMPLE
Ejemplo:
Utilizar la Regla de Simpson 3/8 para integrar de a=0 hasta b=0.6:
REGLA DE SIMPSON 3/8 SIMPLE-MULTIPLE
function [s] = SimpsonSM38(f,a,b,np)
% np=Numero de particiones
f=inline(f);
h=(b-a)/(3*np);
x=a:h:b;
m=length(x);
j=1;
s=0;
for i=1:3:m-1
I(j)=(f(x(i))+3*f(x(i+1))+3*f(x(i+2))+f(x(i+3)))*h*3/8;
s=s+I(j);
j=j+1;
end
SimpsonSM38('0.2+25*x-200*x.^2+675*x.^3-900*x.^4+400*x.^5',0,0.8,1)
REGLA DE SIMPSON 3/8 MULTIPLE
VR: 1.640533
Método Integral Aprox
Trapecio Simple 0.1728
Trapecio Múltiple 1.6008
Simpson 1/3 Simple 1.0939
Simpson 1/3 Múltiple 1.6394
Simpson 3/8 Simple 1.5191
Simpson 3/8 Múltiple 1.64033
SimpsonSM38('0.2+25*x-200*x.^2+675*x.^3-900*x.^4+400*x.^5',0,0.8,4)
REGLA DE SIMPSON 3/8 SIMPLE
SOLUCIÓN:
INTEGRACIÓN CON SEGMENTOS DESIGUALES
Ejemplo:
Se cuenta con el siguiente conjunto de datos, resultado de
evaluar el polinomio que se integrará entre 0 y 0.8:
x F(x) x F(x)
0 0.2000 0.44 2.8430
0.12 1.3097 0.54 3.5073
0.22 1.3052 0.64 3.1819
0.32 1.7434 0.70 2.3630
0.36 2.0749 0.80 0.2320
0.40 2.4560
INTEGRACIÓN CON SEGMENTOS DESIGUALES
INTEGRACIÓN CON SEGMENTOS DESIGUALES
Combinación de Reglas:
Es posible aplicar una combinación de las reglas del Trapecio y de
Simpson, apropiadamente en grupos de segmentos.
RPTA: 87.0578
x f(x) x f(x)
0 10.00 3.20 5.82
0.20 10.35 5.55 15.84
0.40 10.79 6.15 11.42
0.60 11.25 7.45 1.69
1.60 11.76 8.75 15.17
2.40 8.50 9.00 18.04
INTEGRACIÓN CON SEGMENTOS DESIGUALES
51
INTEGRACIÓN CON SEGMENTOS DESIGUALES
SUMA = 83.841
EJERCICIO
https://velardebarret.wordpress.com/2016/04/01/regla-del-trapecio/
ALGORITMO DE INTEGRACIÓN DE ROMBERG
Demostración:
Suponemos que es el valor de la integral que aproxima a , a
través de sub-intervalos de longitud y utilizando la Regla del
Trapecio. Entonces:
− (𝑏 − 𝑎) 2 ′ ′
h1 𝑓
𝐸 (h1 ) 12 h1 2
≈ ≈
𝐸 (h 2) − (𝑏 − 𝑎) 2 ′ ′ h22
h2 𝑓
12
( )
2
h1
𝐼 ( h 1 ) − 𝐼 ( h2 ) ≈ 𝐸 ( h2 ) − 𝐸 ( h2 )
h2
4 1
𝐼≈ 𝐼 ( h2 ) − 𝐼 ( h1 )
3 3
ALGORITMO DE INTEGRACIÓN DE ROMBERG
SOLUCIÓN:
= 0.0135
= 0.0067
= 0.0035
= 0.0021
CUADRATURA DE GAUSS
𝟏𝑰𝒏𝒕𝒆𝒓𝒗.
4 1
𝐼 ( h 2 ) − 𝐼 ( h1 )
3 3
𝟐 𝑰𝒏𝒕𝒆𝒓𝒗 .
4
3
1
𝐼 ( h 3 ) − 𝐼 ( h2 )
3
...
𝟒 𝑰𝒏𝒕𝒆𝒓𝒗.
4 1
𝐼 ( h 4 ) − 𝐼 ( h3 )
3 3
𝟖𝑰𝒏𝒕𝒆𝒓𝒗.
CUADRATURA DE GAUSS
𝟏𝑰𝒏𝒕𝒆𝒓𝒗.
𝟐 𝑰𝒏𝒕𝒆𝒓𝒗 .
𝟒 𝑰𝒏𝒕𝒆𝒓𝒗.
𝟖𝑰𝒏𝒕𝒆𝒓𝒗.
CUADRATURA DE GAUSS
Resultando:
Y, sustituyendo, resulta:
𝑰 ≅ 𝒄𝟎∗ 𝒇
( )
−𝟏
√𝟑
+ 𝒄𝟏 ∗ 𝒇
( )
𝟏
√𝟑
CUADRATURA DE GAUSS
𝑰 ≅ 𝒄 𝟎 𝒇 ( 𝒙 𝟎 ) +𝒄 𝟏 𝒇 ( 𝒙 𝟏 ) +𝒄 𝟐 𝒇 ( 𝒙 𝟐 ) +… +𝒄𝒏 − 𝟏 𝒇 ( 𝒙 𝒏 − 𝟏)
CUADRATURA DE GAUSS
RPTA: 0.0872
SOLUCIÓN:
CUADRATURA DE GAUSS
RPTA: 0.0872
SOLUCIÓN:
CUADRATURA DE GAUSS
( ) ( )
𝒃 𝟏
𝒃− 𝒂 ( 𝒃− 𝒂 ) 𝒕+(𝒃+𝒂)
∫ 𝒇 ( 𝒙 ) 𝒅𝒙= 𝟐 ∗ ∫ 𝒇 𝟐
𝒅𝒕
𝒂 −𝟏
CUADRATURA DE GAUSS
( )
𝟏𝟎
𝒔𝒆𝒏 ( 𝒙 ) +𝒄𝒐𝒔 (𝟑 𝒙 )
𝑰 =∫ 𝟐
𝒅𝒙
𝟒 𝒙 +𝟓
SOLUCIÓN:
I =
I =
I =
I =
CUADRATURA DE GAUSS
( )
𝟏𝟎
𝒔𝒆𝒏 ( 𝒙 ) +𝒄𝒐𝒔 (𝟑 𝒙 )
𝑰 =∫ 𝟐
𝒅𝒙RPTA: -0.0221
𝟒 𝒙 +𝟓
SOLUCIÓN:
I =
I =
I =
I =
CUADRATURA DE GAUSS - EJEMPLO
Respuesta:
Estimación con dos puntos: 290.0145
Estimación con tres puntos: 289.4393
Estimación con cuatro puntos: 289.4352
Estimación con cinco puntos: 289.4351
Estimación con seis puntos: 289.4351
ACTIVIDAD DE APRENDIZAJE TA-04
x=[0 2 4 6 8 10 12 14 16 18 20];
y=[0 1.8 2 4 4 6 4 3.6 3.4 2.8 0];
https://ayudasingenieria.com/files/METODOS_NUMERICOS/chapra.pdf
Cap 24 – pag 552