Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program ex625
- !Enrique Ch Gabrick
- !Resolver a integral de e^-x nos intervalos [0,1]
- IMPLICIT NONE
- DOUBLE PRECISION :: y, h, f
- !INTEGER i
- real x, dx, a, b, m, m0, i, g, x0, x1, x2, x3, y0, y1, y2, y3, d0, d1, d2, d3
- real,parameter :: exp = 2.718281828
- print *, 'Entre com o intervalo b e a'
- read *, a,b
- print *, 'Entre com o valor de m'
- read *,m
- if(m .eq. 0.00) stop 'valor ilegal de m'
- open(unit=11,file='ex625.dat')
- h = (b - a)/2
- x0 = 0.25
- x1 = 0.50
- x2 = 0.75
- x3 = 1.00
- y0 = exp**(-x0)
- y1 = exp**(-x1)
- y2 = exp**(-x2)
- y3 = exp**(-x3)
- d0 = 1
- d1 = 2
- d2 = 2
- d3 = 1
- g = h/2*(d0*y0 + d1*y1 + d2*y2 + d3*y3)
- write(11,*)g,y0,y1,y2,y3
- close(11)
- end program ex625
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement