Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Ejemplos:
∂ u ∂u
+ =0u=f ( x , y )
∂x ∂ y
27
3.1.1 Método Numérico de Euler
{ y =f(x,y)¿¿¿¿
La idea de este método es aproximar la curva y(x) sobre [ x n , x n+1 ] por una
línea recta de pendiente:
∆ y y n+ 1− y n
s= = =f ´( x , y)
∆x h
y n+ 1= y n +h f ´ (x , y)
28
Solución: En la hoja de cálculo creamos una tabla con el número de intervalos, el
tamaño del intervalo, el valor xi, yi, f(xi,yi) y el valor real de la función.
Para ver la aproximación del método comparamos el valor aproximado con el valor
exacto mediante un gráfico.
Método de Euler
4,0000
3,5000
3,0000
2,5000
y_i
y(x)
2,0000
2exp(x)-x-1
1,5000
1,0000
0,5000
0,0000
0,0 0,2 0,4 0,6 0,8 1,0 1,2
x
El método de Euler es uno de los métodos más sencillos para resolver ecuaciones
diferenciales de primer orden. Sin embargo no es el más preciso, uno de los
esquemas de iteración más utililzados, por ser más preciso, es el esquema de
29
iteración de Runge-Kutta. Aunque parece ser más complicado, se basa
simplementer en la regal de Simpson para integración numérica. Si recordamos que
si aproximamos el gráfico de u(x) sobre el intervalo [ 0 0 ] por una parábola que
x , x +h
pasa por tres puntos: u(x0), u(x0+h/2) y u(x0+h) tenemos:
∫x
x 0 +h
0
u ( x ) dx≈
h
6 [ ( h
)
u ( x 0 ) +4 u x 0 + + u ( x0 +h )
2 ]
Supongamos que deseamos aproximar la solución del siguiente problema de valor
inicial:
{
dy
dx
=f(x, y) ¿ ¿¿¿ ¿
Teniendo en cuenta la ¿ anterior,
ecuación si hacemos u(x)=y`(x) y x0+h=x1
tendríamos:
h
[ h h
]
x
y ( x 1 )− y (x 0 )=∫x1 y ( x )dx≈ y ( x 0 )+2 y ( x0 + )+2 y ( x 0 + )+ y ( x 1 )
0 6 2 2
30
celda B3 y copiamos hasta la celda B4.
3. En la columna yn ingresmos 1 en la celda C2, lo que representa la
condición inical Y(0)=1 y en la celda C3 digitamos:
C2+0.5*(D2+2*E2+2*F2+G2)/6. Luego copiamos este valor en C4.
4. Para asignar los valores de k1, k2, k3 y k4 ingresamos lo siguiente:
B2+C2 en la celda D2
B2+0.25+C2+0.25*D2 en la celda E2
B2+0.25+C2+0.25*E2 en la celda F2
B3+C2+0.5*F2 en la celda G2
n xn yn k1 k2 k3 k4 2exp(x)-x-1
0 0 1 1 1,5 1,6250 2,3125 1,0000
1 0,5 1,7969 2,2969 3,1211 3,3271 4,4604 1,7974
2 1 3,4347 4,4347 5,7934 6,1330 6,5012 3,4366
Método de Runge-Kutta
4
3,5
3
2,5
Runge-Kutta
y(x)
2
S. Exacta
1,5
1
0,5
0
0 0,2 0,4 0,6 0,8 1
x
31
Aquí la solución analítica es . Podemos entonces definir la variable
intermedia z(t) como:
Podemos aplicar el mismo proceso para ecuaciones diferenciales de un orden mayor haciendo, v
= du/dt = d2y/dt2, puesto que d3y/dt3 = dv/dt, etc.
Ejemplo 3: Considere una masa vibrando como un péndulo con la siguiente
ecuación:
d2 y
+ y =0 y ( 0 ) y y ( 0 )=1
dt 2
{
dy
dt
=u ¿ ¿¿¿¿
Si resolvemos el sistema utilizando el ¿esquema de iteración de Euler tendremos lo
siguiente:
ui+1=ui −Δt y i
y +1= y i + Δt u i
32
Al implementar la solución en la hoja de cálculo Excel tenemos que crear 6
columnas: n, ti, du/dt, dy/dt, ui y yi.
Para ver la precisión del método graficamos la solución exacta versus la solución
aproximada dada por Euler.
1,20
1,00
0,80
Euler
y(t)
0,60
Sol._Exacta
0,40
0,20
0,00 33
0 2
t
Ejercicios para resolver:
2. A human population containing 1000 people at time t=0 grows at a rate given
by:
Estimate the rate constant a from what you know about human behavior and
then use it to calculate the population after 30 years. Use Runge-Kutta.
3. The impala population in a national park in South Africa grows at a rate given
by:
with the initial condition y(0)=1. Determine the time step necessary to achieve
an accuracy of at least at t=10 seconds using the Runge-Kutta solution
technique. The analytical solution is .
34
5. Consider a target heating problem such as Professor Conrad deals with in his
PSII process. This is a case where an object is placed in a plasma and heated
by ions. The governing equation for the temperature of this object as a
function of time is:
where p is the density of the target, is the heat capacity of the target, V is
the volume of the target, q is the heat flux applied to the target, A is the
surface area of the target, is the target emissivity, is the Stefan-Boltzmann
constant, and is the temperature of the PSII chamber. Determine the target
temperature of a spherical copper target of radius 2 cm is heated by a heat
flux of . Use the following properties for copper: p = 8950
, = 385 J/kg K, and = 0.2. The Stefan-Boltzmann constant is
. Assume that the cahmber temperature is = 30 C
and that the initial target temperature is the same as the chamber
temperature.
Note that this analytical solution is only valid for small angles, so the
comparison is not expected to be good for this problem.
35
where c is a constant. Determine the rotation angle of the pendulum as a
function of time for and
8. If you're looking for a little challenge, try this: Lorenz simplified a complicated
model of the weather down to a system of three equations:
o Calculate these parameters for 0 < t < 50 and plot them vs. time, for r =
17, x(0) = 0, y(0) = 1, and z(0) = 0.
o Calculate these parameters for 0 < t < 50 and plot them vs. time, for r =
26, x(0) = 0, y(0) = 1, and z(0) = 0.
y = 0.7
Solve this equation using Euler's method, the Modified Euler method, and 4th
order Runge-Kutta integration and compare the results to the analytical
solution. For the same time step, which of these methods is most accurate?
36
y(0) = 0
Solve this equation using any technique you choose and check your answer.
where m is the mass, v is the velocity, g is the acceleration due to gravity, and
c is the drag coefficient.
o Plot the diver's velocity vs. time, assuming whe weights 55 kg and the
drag coefficient is 11 kg/s. Assume the initial velocity of the skydiver is
0.
o Suppose the drag on the skydiver increases with the square of the
velocity. This would give us an equation of the following form:
Now plot the velocity for the skydiver, assuming k = 0.25 kg/m.
37
This equation models a damped oscillator with an applied, oscillatory force.
Plot the solution as a function of time.
Plot the number of rabbits and number of foxes vs. time for a case where we
start with 80 rabbits and 10 foxes. Plot a phase portrait for this system by
plotting the number of foxes vs. the number of rabbits.
Plot the number of rabbits and number of foxes vs. time for a case where we
start with 80 rabbits and 10 foxes. Plot a phase portrait for this system by
plotting the number of foxes vs. the number of rabbits.
Hiperbólicas
Las ecuaciones estándar hiperbólicas incluyen la ecuación de onda:
2 2 2 2
∂u ∂ u ∂u ∂ u
= + + 3D
∂t 2 ∂ x 2 ∂ y 2 ∂ z 2
Y la ecuación de convección o de transporte
38
∂u ∂u
= 1D
∂t ∂ x
Parabólica
Las ecuaciones elípticas se utilizan por lo general para modelas fenómenos de tipo
estacionarios. Por ejemplo, la ecuación de onda o la de difusión se reducen a las
ecuaciones de Poisson o Laplace cuando se remueve la variable tiempo. La
ecuación de Laplace es:
2 2 2
∂u ∂ u ∂ u
+ + =0 3 D
∂ x 2 ∂ y 2 ∂ z2
Solución Computacional
Los ejemplos del acápite anterior se han referido a Problemas de Valor Inicial,
donde todas las condiciones se conocen en un punto inicial particular. En la práctica
39
hay muchos problemas que tienen condiciones de contorno no precisamente en un
punto. A estos problemas se les conoce como Problemas de Condiciones o Valores
de Contorno.
40
podemos referirnos a los valores de y en cada malla de puntos como .
Nuestro objetivo es encontrar los valores de y en cada uno de los puntos de la malla.
En este ejemplo son 6.
41
Solución: Utilizando Excel para resolver problemas de condiciones de contorno
Note que hemos anulado el cálculo automático debido a que varias de las celdas
dependen unas de otras. Es decir que la celda C4 contiene a D4 en su fórmula,
mientras que D4contiene a C3 en su fórmula. Esto se conoce como referencia
circular y solamente puede ser resuelto por iteración. La solución en la hoja de
cálculo EXCEL se muestra a continuación:
1 1
0.8 0.8
Diferencias Finitas
0.6 0.6 Solución exacta
42
0.4 0.4
0 0
0 0.5 1 1.5 2 2.5
∂T ∂2 T
ρcp =k
∂t ∂ x2
43
Introduciendo estas representaciones en la ecuación diferencial orginal obtenemos
la siguiente ecuación:
donde
Este esquema puede utilizarse para resolver para todas las temperaturas en el paso
de tiempo j+1, conociendo las temperaturas en el tiempo j. No se requiere del cálculo
iterativo. Desafortunadamente, este método tiene una desventaja; puede ser
inestable si no se escoge adecuadamente el paso del tiempo (Δt). Para evitar dicha
inestabilidad debemos escoger un paso de tiempo igual a:
44
combnación de las técnicas explícitas e implícitas. En este caso se escribe la
derivada espacial como:
dando
x( a
través)
t 0 0,25 0,5 0,75 1
(abajo)
0,00 0 0 0 0 0
0,05 100 23,4398 5,47945 1,21765 0
8 2 6
0,10 100 37,9632 12,2349 3,39535 0
5 4 1
0,15 100 47,4656 18,6871 6,03899 0
1 5
0,20 100 53,9982 24,3283 8,76128 0
9 5
0,25 100 58,6820 29,0735 11,3281 0
6 5 7
0,30 100 62,1549 32,9919 13,6249 0
1 5 7
0,35 100 64,7966 36,1977 15,6133 0
45
7 6 7
0,40 100 66,8444 38,8082 17,2981 0
2 1 4
0,45 100 68,4532 40,9287 18,7053 0
8 5
0,50 100 69,7293 42,6490 19,8694 0
8 1 2
0,55 100 70,7482 44,0437 20,8260 0
7 5 6
0,60 100 71,5655 45,1741 21,6087 0
1 4 3
0,65 100 72,2230 46,0901 22,2471 0
9 2
0,70 100 72,7533 46,8322 22,7666 0
4 9 8
0,75 100 73,1815 47,4336 23,1889 0
4 5
0,80 100 73,5277 47,9207 23,5318 0
8 2
0,85 100 73,8077 48,3154 23,8100 0
2 8 1
0,90 100 74,0343 48,6352 24,0356 0
5 6 2
0,95 100 74,2178 48,8943 24,2185 0
2 3 3
1,00 100 74,3664 49,1042 24,3667 0
3 9
46
where is a constant and x is measured from the center of the plate. Calculate
the center-line temperature of this slab as a function of time, if the
temperatures of the plate boundaries are held at T=0. Assume that the thermal
diffusivity (k/-cp) is 7*10-6 m2/s and that L=20 cm and that =500 K/m2.
3. Consider an annular nuclear reactor fuel pellet, which has an inner radius of
0.1 cm and an outer radius of 0.6 cm. The pellet is initially at 1000 C, there is
no heat flow into the center of the pellet, and the outside surface temperature
of the pellet is held at 1000 C. Determine the centerline pellet temperature as
a function of time if the thermal conductivity is 3 W/m-K, the heat capacity is
320 J/kg-K, the density is 0.011 kg/cm 3, and the volumetric heating is 300
W/cm3. The governing equation for the temperature in a cylinder (ignoring
axial variations) is
Use the following material properties: =20,000 kg/m 3, cp=140 J/kg-K, and k=39
W/m-K.
47
donde T es la temperatura, Q es el flujo de calor volumétrico, y k es la conductividad
térmica del sólido. En coordenadas cartesiana la ecuación se puede expresar como:
Ejemplo:
48
dado por h y el espaciamiento en la dirección y está dado por s. Dado este modelo,
entonces podemos aproximar la segunda derivada de la temperatura respecto a x
como:
Ti-1,j
49
Solución: Las condiciones de contorno para el problema son las siguientes:
a=1
b=2 T4
T1=100 oC b T1 T3
T2=T3=T4=0 T2
h=0,1 a
s=0,2
En la hoja de cálculo creamos una tabla de doble entrada para las coordenadas
x e y. En la celda clave ingreseamos la fórmula del esquema de aproximación y no
olvidemos que al implementar la fórmula se originan referencias circulares, las
cuales evitamos yendo al menú Herramientas-Opciones-Calcular y cambiando
automático por Manual e Iteración.
y(0) y(0,1 y(0,2 y(0,3 y(0,4 y(0,5 y(0,6 y(0,7 y(0,8 y(0,9 y(1,0
) ) ) ) ) ) ) ) ) )
x(0) 0 0,1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 0,9 1
x(0,2 0,2 100 0 0 0 0 0 0 0 0 0
)
x(0,4 0,4 100 66,6 46,4 33,2 24,1 17,4 12,1 7,70 3,74 0
) 5 0 7 8 6 5
x(0,6 0,6 100 80,9 64,2 50,4 38,9 29,2 20,8 13,4 6,58 0
) 0 8 2 1 3 8 5
x(0,8 0,8 100 85,2 71,1 58,1 46,3 35,6 25,9 16,9 8,33 0
) 0 2 4 6 8 4 0
x(1,0 1 100 86,6 73,5 61,0 49,3 38,4 28,1 18,4 9,12 0
) 0 4 9 8 3 6 5
x(1,2 1,2 100 86,6 73,5 61,0 49,3 38,4 28,1 18,4 9,12 0
) 0 4 9 8 3 6 5
x(1,4 1,4 100 85,2 71,1 58,1 46,3 35,6 25,9 16,9 8,33 0
) 0 2 4 6 8 4 0
x(1,6 1,6 100 80,9 64,2 50,4 38,9 29,2 20,8 13,4 6,58 0
) 0 8 2 1 3 8 5
x(1,8 1,8 100 66,6 46,4 33,2 24,1 17,4 12,1 7,70 3,74 0
) 5 0 7 8 6 5
x(2,0 2 100 0 0 0 0 0 0 0 0 0
)
1. Find the maximum temperature in a square (2m by 2m) plate in which the
sides are held at 0 degrees, the thermal conductivity is 30 W/mK, and there is
50
a volumetric heating rate of 10 kW/m 3. Do this for two different mesh spacings
and compare the errors. The analytical solution to this problem is
where Q is the volumetric heating rate, L is the plate width, and k is the
thermal conductivity.
2. Find the central temperature in the plate from problem 1, assuming there is no
heat generation, three sides are held at 0 degrees and the fourth side is held
at 100 degrees. Do this with and without SOR and compare the errors after
100 iterations.
3. Find the maximum deflection in a square (2m by 2m) plate which has a
thickness of 3 cm, an elastic modulus of 220 GPa, a Poisson's ratio of 0.33,
and is loaded by a transverse pressure of 0.05 MPa. The plate is pinned on all
four sides.
4. Find the maximum temperature in the plate shown below, assuming that the
thermal conductivity is 30 W/mK, the volumetric heating rate is 1 MW/m 3, and
that all the edges are held at 0 degrees. Note that this geometry consists of 4
square (10cm by 10cm) square "pieces."
51