Sie sind auf Seite 1von 8

UNIVERSIDAD NACIONAL DE INGENIERIA P.A.

2015-3
FACULTAD DE INGENIERIA MECANICA 01/03/2016
DACIBAHCC

EXAMEN FINAL DE METODOS NUMERICOS (MB536A)

DURACION: 110 MINUTOS


SOLO SE PERMITE EL USO DE UNA HOJA DE FORMULARIO A4
ESCRIBA CLARAMENTE SUS PROCEDIMIENTOS

Problema 1
Sea el sistema de ecuaciones no lineales:
x2+2x+y2+4y=4
x2+2x-y-5=0
a) (1.0 P) Bosquejar a mano alzada la solucin del sistema e indique valores
cercanos a las races con una aproximacin al entero ms prximo.
b) (2.0 P) Determinar la raz ms cercana al origen de coordenadas usando 03
iteraciones del Mtodo de Newton-Raphson para sistemas y muestre el error
usando norma Infinita. Inicialice en el valor obtenido en a).
c) (2.0 P) Encuentre un algoritmo de punto fijo para la raz buscada en b)
verificando la condicin de convergencia y luego realice 03 iteraciones. Inicialice
en el valor obtenido en a). y muestre el error.

Problema 2
Se tiene los siguientes datos experimentales en un proceso trmico:
Tiempo (min) = t 0 0.2 0.4 0.6 0.8 1.0
Temperatura Media (C)= 5 8 15 30 70 230

b et c t 2
Se puede aproximar por una funcin de la forma:
ae , para lo cual se pide:
a) (2.5 P) Determine a, b y c mediante ajuste por mnimos cuadrados usando la ecuacin
normal.
b) (1.5 P) Determine el factor de regresin.
c) (1.0 P) Escriba un programa MATLAB para evaluar el factor de regresin de este problema.

Problema 3
Una partcula se desplaza con el siguiente modelo matemtico que describe su
t
e sen t
v t
velocidad en cada instante de tiempo: 1 t2
, se desea conocer la
distancia recorrida entre el instante 0 s y 3 s, para ello:
a) (2.0 P) Determine la distancia, usando el mtodo de Newton-Cotes cerrado de
grado 3 con 10 puntos y su respectivo error, sabiendo que el valor exacto es
2.88163727.
b) (2.0 P) Determine la distancia, usando el mtodo de Gauss-Legendre con 4 puntos y
su respectivo error.
c) (1.0 P) Desarrolle un script para que calcule la distancia recorrida por el mtodo de
trapecio abierto usando 3000 particiones.
UNIVERSIDAD NACIONAL DE INGENIERIA P.A. 2015-3
FACULTAD DE INGENIERIA MECANICA 01/03/2016
DACIBAHCC

Problema 4
Considere una ecuacin diferencial de segundo orden de un sistema de masa y resorte
d 2x dx
m 2
c kx 0
vibratorio dt dt . Las Unidades estn en el SI. Las condiciones iniciales son
x(0) =5 y x(0) =0, donde c=12 y m=4 y k=9:
a) (2.0 P) Estime la posicin y velocidad para t=0.2, usando Taylor 2 con h=0.1

b) (2.0 P) Estime la posicin y velocidad para t=0.2 seg, usando RK2 con h=0.1
c) (1.0 P) Halle la solucin analtica y determine el error para a) y b) y comente sus
resultados.

El profesor
UNIVERSIDAD NACIONAL DE INGENIERIA P.A. 2015-3
FACULTAD DE INGENIERIA MECANICA 01/03/2016
DACIBAHCC

Problema 1

% problema1a.m
format long
clc
clear all
x1=-5:0.1:3; y1=-7:0.1:2;
[x,y]=meshgrid(x1,y1);
f1=(x+1).^2+(y+2).^2-9;
contour(x1,y1,f1,[0 0],'r')
f2=(y+6)-(x+1).^2;
hold on, grid
contour(x1,y1,f2,[0 0],'b')
hold off
% Aproximaciones iniciales: (0,-5) (1,0) (-3,0) (-2,-5)

-1

-2

-3

-4

-5

-6

-7
-5 -4 -3 -2 -1 0 1 2 3

% Hallar la raiz mas cercana al origen de coordenadas


x=1; y=0; acum=[x y NaN];
for i=1:3
f1=x.^2+y.^2+2*x+4*y-4;
f2=x.^2+2*x-y-5;
J=[2*x+2 2*y+4;2*x+2 -1];
dxy=J\[-f1;-f2];
UNIVERSIDAD NACIONAL DE INGENIERIA P.A. 2015-3
FACULTAD DE INGENIERIA MECANICA 01/03/2016
DACIBAHCC

x=x+dxy(1);
y=y+dxy(2);
err=norm(dxy,Inf);
acum=[acum; x y err];
end
disp(acum)

1.000000000000000 0 NaN
1.450000000000000 -0.200000000000000 0.450000000000000
1.406898846495120 -0.208695652173913 0.043101153504880
1.406509505305120 -0.208712152462668 0.000389341190000

% Iteracin de Punto Fijo


x=1; y=0; acum=[x y NaN];
for i=1:3
xn=(4*x^2+y^2-2*y+1)/8;
yn=(-x^2-2*x-4*y^2-1)/8;
err=norm([xn-x yn-y],Inf);
x=xn; y=yn;
acum=[acum;xn yn err];
end
disp(acum)
El error es decreciente.

Problema 2
% problema2b.m
% y =a*exp(b*exp(x)+c*x*x)
clc
clear all
x=(0:0.2:1)'
y=2*exp(exp(x)+2*x.*x)
y=[5 8 15 30 70 230]'
X=x
Y=log(y)
M=[ones(6,1) exp(X) X.^2]
MM=M'*M
MY=M'*Y
p=MM\MY
a=exp(p(1))
b=p(2)
c=p(3)
ys=a*exp(b*exp(x)+c*x.*x)
plot(x,y,'d',x,ys,'*'), grid
UNIVERSIDAD NACIONAL DE INGENIERIA P.A. 2015-3
FACULTAD DE INGENIERIA MECANICA 01/03/2016
DACIBAHCC

ym=mean(y)
r2=sum((ys-ym).^2)/sum((y-ym).^2)

x= 0
0.200000000000000
0.400000000000000
0.600000000000000
0.800000000000000
1.000000000000000
y = 1.0e+002 *
0.054365636569181
0.073488948304877
0.122432146597407
0.254131302885392
0.665989032073356
2.239513876803937
y =5
8
15
30
70
230
X= 0
0.200000000000000
0.400000000000000
0.600000000000000
0.800000000000000
1.000000000000000
Y = 1.609437912434100
2.079441541679836
2.708050201102210
3.401197381662156
4.248495242049359
5.438079308923196
M =1.000000000000000 1.000000000000000 0
1.000000000000000 1.221402758160170 0.040000000000000
1.000000000000000 1.491824697641270 0.160000000000000
1.000000000000000 1.822118800390509 0.360000000000000
1.000000000000000 2.225540928492468 0.640000000000000
1.000000000000000 2.718281828459046 1.000000000000000
MM = 6.000000000000000 10.479169013143462 2.200000000000000
10.479169013143462 20.379571072196054 5.086138852783819
2.200000000000000 5.086138852783819 1.566400000000000
MY = 19.484701587850857
38.624027625148372
9.898013015076710

p =-0.458776920728485
UNIVERSIDAD NACIONAL DE INGENIERIA P.A. 2015-3
FACULTAD DE INGENIERIA MECANICA 01/03/2016
DACIBAHCC

2.073944903511522
0.229156338353191
a = 0.632056227816586
b = 2.073944903511522
c = 0.229156338353191
ys = 1.0e+002 *
0.050287325930179
0.080326248759745
0.144667125199317
0.300449129584149
0.739605913496836
2.231727559866342
ym = 59.666666666666664
r2 = 0.943088344192234

Problema 3
% integr.m
format long
s='exp(t)*sin(t)/(1+t^2)'
f=inline(vectorize(s))
% Simpson 3/8
h=1/3
I=3*h/8*(f(0)+3*f(1/3)+ 3*f(2/3)+ 2*f(1)+ 3*f(4/3) + 3*f(5/3) +2*f(2)+ 3*f(7/3) + 3*f(8/3)+f(3))
% ISimpson38 = 2.883169348514245
Ie=quad(f,0,3,1e-14)
% Iexacto = 2.881637273055191
Err=abs(Ie-I)
% ESimp38 = 0.001532075459055
% Cuadratura de Gauss N=4
% t=3/2*(x+1)
ss='3/2* exp(3/2*(x+1))*sin(3/2*(x+1))/(1+(3/2*(x+1))^2)'
ff=inline(vectorize(ss))
x1=-0.861136311594053
x2=-0.339981043584856
x3=+0.339981043584856
x4=+0.861136311594053
c1=0.347854845137454
c2=0.652145154862546
c3=0.652145154862546
c4=0.347854845137454
I=c1*ff(x1)+c2*ff(x2)+c3*ff(x3)+c4*ff(x4)
% IGauss = 2.881695213552816
Err=abs(Ie-I)
% errGauss = 5.794049762553044e-005
UNIVERSIDAD NACIONAL DE INGENIERIA P.A. 2015-3
FACULTAD DE INGENIERIA MECANICA 01/03/2016
DACIBAHCC

Problema 4

a) Reemplazando:
4 x"12 x'9 x 0
x 0 5 x' 0 0
Reduciendo a primer orden:
x' v x 0 5
12v 9 x
v' v 0 1
4
Taylor 2 de segundo orden:

t0 0
x0 5
v0 0
h 0.1
tn 1 tn h
h 2 12vn 9 xn
xn 1 xn h * vn *
2 4

12vn 9 xn
12 9vn
12vn 9 xn h
2
vn 1 vn h * 4
*
4 2 4

clc
clear all
t(1)=0
x(1)=5
v(1)=0
h=0.1
for i=1:2
t(i+1)=t(i)+h
a=(-12*v(i)-9*x(i))/4
x(i+1)=x(i)+h*v(i)+h^2/2*a
v(i+1)=v(i)+h*a+h^2/2*((-12*a-9*v(i))/4)
end
disp('t x v ')
disp([t' x' v'])
% t x v
0 5.000000000000000 0
0.100000000000000 4.943750000000000 -0.956250000000000
0.200000000000000 4.806851562500000 -1.647140625000000
% Solucin exacta
X=dsolve('4*D2x+12*Dx+9*x','x(0)=5','Dx(0)=0')
UNIVERSIDAD NACIONAL DE INGENIERIA P.A. 2015-3
FACULTAD DE INGENIERIA MECANICA 01/03/2016
DACIBAHCC

tt=[0 0.1 0.2]


xx=subs(X,tt)
% X=5/exp((3*t)/2) + (15*t)/(2*exp((3*t)/2))
% tt = 0 0.100000000000000 0.200000000000000
%xx = 5.000000000000000 4.949070864444082 4.815318434431166
% problema4a.m
clc
clear all
t(1)=0
x(1)=5
v(1)=0
h=0.1
for i=1:2
t(i+1)=t(i)+h
k1=h*v(i)
l1=h*((-12*v(i)-9*x(i))/4)
k2=h*(v(i)+l1)
l2=h*((-12*(v(i)+l1)-9*(x(i)+k1))/4)
x(i+1)=x(i)+1/2*(k1+k2)
v(i+1)=v(i)+1/2*(l1+l2)
end
disp('t x v ')
disp([t' x' v'])
t x v
0 5.000000000000000 0
0.100000000000000 4.943750000000000 -0.956250000000000
0.200000000000000 4.806851562500000 -1.647140625000000

Das könnte Ihnen auch gefallen