Documente Academic
Documente Profesional
Documente Cultură
MTODOS NUMRICOS
UNIDAD 1: Introduccin a los mtodos
numricos
REPORTE DE PRCTICAS
ALUMNO:
SIERRA GONZLEZ FRANCISCO
FACILITADOR:
ING. RUSBEL BERMUDEZ RIVERA
Solucin Analtica
gm c
t
v (t ) 1 e m
c
Solucin Numrica
c
v t i 1 v t i g v t i t i 1 t i
m v ( ti ) es la velocidad en el tiempo inicial t i
Solucin Analtica
Abrimos MS Excel e
introducimos los datos en la hoja
de clculo.
Ahora, desde la misma celda C8, extendemos hacia abajo hasta marcar todos los
valores. De esta manera obtendremos los dems resultados automticamente.
Solucin numrica
En este caso utilizamos la ayuda de Visual Basic for Applications y sus Macros
Una vez abierto el editor de VB, insertamos un nuevo mdulo. En la ventana que
aparece escribimos el cdigo de las funciones:
Option Explicit
Function Euler(dt, ti, tf, yi, m, cd)
Dim h As Single, t As Single, y As Single, dydt As Single
t = ti
y = yi
h = dt
Do
If t + dt > tf Then
h = tf - t
End If
dydt = dy(t, y, m, cd)
y = y + dydt * h
t=t+h
If t >= tf Then Exit Do
Loop
Euler = y
End Function
Para la solucin numrica utilizamos el Editor de Octave (Ventana > Mostrar Editor)
Introducimos el siguiente cdigo en el Editor:
m=input('mass (kg):');
cd=12.5;
Peticin de
ti=0;
entrada
tf=2;
vi=0;
dt=0.1;
t = ti;
v = vi;
h = dt;
while (1)
if t + dt > tf
h = tf - t;
end
dvdt = g - (cd / m) * v;
v = v + dvdt * h; Salida
t = t + h; (Resultado)
if t >= tf, break, end
end
disp('velocity (m/s):')
disp(v)
Guardamos el archivo y procedemos a ejecutar el programa.
Nos pide que insertemos un valor para la masa.