Beruflich Dokumente
Kultur Dokumente
= p(x) y
(x
i
) =
y(x
i
+ h) y(x
i
h)
2h
y
(x
i
) =
y(x
i
+ h) 2 y(x
i
) + y(x
i
h)
h
2
y
iv)
(x)
y(x
i
2h) 4y(x
i
h) + 6y(x
i
) 4y(x
i
+ h) + y(x
i
+ 2h)
h
4
Esto permite transformar la ecuacion ordinaria en un sistema de ecuaciones al-
gebraicas. Los metodos resultantes se conocen como metodos de diferencias
nitas.
Seccion 1: Problema de contorno 5
1.1. Ejemplo
Ejemplo 1.1. Plantear por diferencias nitas el problema de contorno toman-
do 3 nodos interiores en (1, 1).
y
= xy
y + 2 x
2
x (1, 1)
y(1) = 1 y(1) = 1
Solucion:
y(x
i
+ h) 2 y(x
i
) + y(x
i
h)
h
2
= x
i
y(x
i
+ h) y(x
i
h)
2h
y(x
i
) + 2 x
2
i
Con la notaci on m as comoda y(x
i
) = y
i
tenemos
y
i+1
2 y
i
+ y
i1
h
2
= x
i
y
i+1
y
i1
2h
y
i
+ 2 x
2
i
Multiplicamos por h
2
y reordenando, se tiene
(1 +
1
2
hx
i
)y
i1
+ (2 + h
2
)y
i
+ (1
1
2
hx
i
)y
i+1
= h
2
(2 x
2
i
)
Seccion 1: Problema de contorno 6
i = 1 =
7
8
y
0
7
4
y
1
+
9
8
y
2
=
7
16
i = 2 = y
1
7
4
y
2
+ y
3
=
1
2
i = 3 =
9
8
y
2
7
4
y
3
+
7
8
y
4
=
7
16
Si pasamos al termino independiente los terminos en rojo, se obtiene el sistema
tridiagonal para los nodos interiores y
1
, y
2
, y
3
pues y
0
= 1 e y
4
= 1 son
conocidos en la frontera.
_
_
_
_
_
_
_
7
4
9
8
0
1
7
4
1
0
9
8
7
4
_
_
_
_
_
_
_
_
_
_
_
y
1
y
2
y
3
_
_
_
_
=
_
_
_
_
_
_
_
7
16
1
2
7
16
_
_
_
_
_
_
_
M=diag([-7/4 -7/4 -7/4])+diag([9/8 1],1)+diag([1 9/8],-1)
Obteniendose
y
1
= y(1/2) = 1/4 y
2
= y(0) = 0 y
3
= y(1/2) = 1/4
7
2. Caso Lineal de 2
o
orden.
y
= p(x) y
= y (1 +
2
) sen( x) x (0, 1)
y(0) = 0 y(1) = 0
con el codigo 2.1 de Matlab , para n = 10 puntos interiores.
Solucion:
p=inline(0*x)
q=inline(x.^0)
r=inline(-(1+pi^2)*sin(pi*x))
%[x,y,M]=contorno(a,b,fa,fb,p,q,r,n)
[x,y,M]=contorno(0,1,0,0,p,q,r,10)
(0) = 0 y(L) = 0 y
(L) = 0
(3)
Seccion 2: Caso Lineal de 2
o
orden. 14
y
iv)
(x)
y
i2
4y
i1
+ 6y
i
4y
i+1
+ y
i+2
h
4
=
f
i
E I
Para i = 1, . . . 9 obtenemos el sistema, con h = (L 0)/10:
_
_
y
1
4y
0
+ 6y
1
4y
2
+ y
3
= h
4
f
1
E I
y
0
4y
1
+ 6y
2
4y
3
+ y
4
= h
4
f
2
E I
y
1
4y
2
+ 6y
3
4y
4
+ y
5
= h
4
f
3
E I
. . . = . . .
y
7
4y
8
+ 6y
9
4y
10
+ y
11
= h
4
f
9
E I
y
(0) = 0
y
1
y
1
2h
= y
1
= y
1
y
(L = x
10
) = 0
y
11
y
9
2h
= y
11
= y
9
y
1
= y
1
y
0
= 0 y
10
= 0 y
11
= y
9
Seccion 2: Caso Lineal de 2
o
orden. 15
_
_
_
_
_
_
_
_
_
_
_
_
_
_
7 4 1 0 0 0 0 0 0
4 6 4 1 0 0 0 0 0
1 4 6 4 1 0 0 0 0
0 1 4 6 4 1 0 0 0
0 0 1 4 6 4 1 0 0
0 0 0 1 4 6 4 1 0
0 0 0 0 1 4 6 4 1
0 0 0 0 0 1 4 6 4
0 0 0 0 0 0 1 4 7
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
y
1
y
2
y
3
y
4
y
5
y
6
y
7
y
8
y
9
_
_
_
_
_
_
_
_
_
_
_
_
_
_
=
h
4
E I
_
_
_
_
_
_
_
_
_
_
_
_
_
_
f(x
1
)
f(x
2
f(x
3
)
f(x
4
)
f(x
5
)
f(x
6
)
f(x
7
)
f(x
8
)
f(x
9
)
_
_
_
_
_
_
_
_
_
_
_
_
_
_
Para hallar la solucion para f(x) = 24, se resuelve el sistema con h = L/10
E=1;I=1;L=4;a=0;b=L;n=9;;h=L/(n+1);
x=a+h:h:b-h;x=x;
d0=6*ones(n,1);ds1=-4*ones(n-1,1);ds2=ones(n-2,1);
di1=-4*ones(n-1,1);di2=ones(n-2,1);
M=diag(d0)+diag(ds1,1)+diag(ds2,2)+diag(ds1,-1)+diag(ds2,-2);
M(1,1)=7;M(n,n)=7;
fx=24*x.^0;ti=h^4*fx/(E*I);
y=M\ti;[x y]
Seccion 2: Caso Lineal de 2
o
orden. 16
2.4. Ejercicio propuesto
El desplazamiento respecto a la posicion de equilibrio de un m astil se puede
modelizar mediante la siguiente EDO de cuarto orden:
siendo y: desplazamiento (echa) respecto a la posicion de equilibrio, E: m odu-
lo de elasticidad, I: momento de inercia, f(x): cargas (fuerzas) a lo largo del
eje del m astil.
Seccion 2: Caso Lineal de 2
o
orden. 17
El problema de controno corresponde a:
y
iv)
=
f(x)
E I
x (0, L)
y(0) = 0 y
(L) = 0 y
(L) = 0 y
(0) = 0
(4)
Discretizamos la derivada cuarta con aproximaciones centradas
y
i2
4y
i1
+ 6y
i
4y
i+1
+ y
i+2
h
4
=
f
i
E I
Para i = 1, . . . , 10 se obtiene el sistema:
Seccion 2: Caso Lineal de 2
o
orden. 18
_
_
y
1
4y
0
+ 6y
1
4y
2
+ y
3
= h
4
f
1
E I
y
0
4y
1
+ 6y
2
4y
3
+ y
4
= h
4
f
2
E I
y
1
4y
2
+ 6y
3
4y
4
+ y
5
= h
4
f
3
E I
. . . = . . .
y
7
4y
8
+ 6y
9
4y
10
+ y
11
= h
4
f
9
E I
y
8
4y
9
+ 6y
10
4y
11
+ y
12
= h
4
f
10
E I
(5)
De las condiciones en la frontera, por diferencias nitas se obtiene
y
(0) = 0
y
1
y
1
2h
= y
1
= y
1
y
(x
10
) = 0
y
9
2 y
10
+ y
11
h
2
= y
11
= 2y
10
y
9
y
(x
10
) = 0
y
8
2 y
9
+ 2 y
11
y
12
2h
3
= y
12
= y
8
4y
9
+ 4y
10
Seccion 2: Caso Lineal de 2
o
orden. 19
Sustituyendo en la ecuacion (5)
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
7 4 1 0 0 0 0 0 0 0
4 6 4 1 0 0 0 0 0 0
1 4 6 4 1 0 0 0 0 0
0 1 4 6 4 1 0 0 0 0
0 0 1 4 6 4 1 0 0 0
0 0 0 1 4 6 4 1 0 0
0 0 0 0 1 4 6 4 1 0
0 0 0 0 0 1 4 6 4 1
0 0 0 0 0 0 1 4 5 2
0 0 0 0 0 0 0 2 4 2
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
y
1
y
2
y
3
y
4
y
5
y
6
y
7
y
8
y
9
y
10
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
=
h
4
E I
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
f(x
1
)
f(x
2
f(x
3
)
f(x
4
)
f(x
5
)
f(x
6
)
f(x
7
)
f(x
8
)
f(x
9
)
f(x
10
)
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
Para resolver el problema con Matlab:
1. Denir valores iniciales: E= ;I= ;L= ;a= ;b= ;n= ;h=(b-a)/n;
2. Denir los nodos de 1 a n x= ;x=x; .
3. Denir la matriz M
4. Denir terminos independientes fx= ;ti= h^4*fx/(E*I);
5. Resolver el sistema y=M\ti;[x y]