Arias Ronny, Valverde Daniela
Analisis Numerico
GR2
04 de Julio del 2017
ESCUELA POLITECNICA NACIONAL
FACULTAD DE INGENIERIA MECANICA
ANALISIS NUMERICO
1 Tema: Metodo de Euler
Este metodo se aplica para encontrar la solucion a ecuaciones diferenciales ordinarias (EDO),
cuando la funcion involucra solo una variable independiente.
dy/dx = f (x, y)
El metodo se basa de forma general en la pendiente estimada de la funcion para extrapolar desde un
valor anterior a un nuevo valor.
El compilador usado para este ejercicio es el siguiente:
Fortran2 w64
1.1. Algorithm en Fortran
!This is the euler method to solve differential equation
program eulermethod
implicit none
real:: x, y, xp, h, dy, f
integer:: n, int, i
write(*,*) 'input values of x and y'
read(*,*) x,y
write(*,*) 'input value of x at wich y is required'
read(*,*) xp
write(*,*) 'input size h'
read(*,*) h
!Compute number of steps
n = int((xp-x)/h)
!Calculate y recurcively at each step
do i = 1, n
dy = h*f(x,y)
x = x + h
y = y+dy
write(*,*) i,x,y
end do
!Write the final result
write(*,*) 'Value of y at x=',x,'is',y
end program
!function subroutine
real function f(x,y)
real:: x,y
f = (7.0/2.0)*(3*x**3-y**2)
end function
1
Arias Ronny, Valverde Daniela
Analisis Numerico
GR2
04 de Julio del 2017
Figura 1: Consola ejecutable del codigo escrito
2 Referencias
1. Chavez, M. A. (s.f.). Metodo de Euler. Recuperado el 04 de Julio de 2017, de
htt p : //[Link]/ mcruz/cursos/mn/[Link] f