fork download
  1. program esfera
  2. implicit none
  3.  
  4. integer :: i, nc
  5. real :: xi, xf, tp, y, x, n, k, dydx
  6.  
  7. xi=0.0
  8. xf=5.0
  9. tp=0.1
  10. y=0.0
  11. x=xi
  12. n=2.0
  13. k=-0.5
  14.  
  15. nc=20
  16.  
  17.  
  18. print*,x,y
  19.  
  20. do i=1,nc
  21.  
  22. dydx=9.81-9.81*k*(y**n)
  23. y=y+tp*dydx
  24. x=x+tp
  25.  
  26. Print *, x, y
  27.  
  28. enddo
  29.  
  30. end program esfera
Success #stdin #stdout 0.01s 2620KB
stdin
Standard input is empty
stdout
  0.00000000E+00  0.00000000E+00
  0.10000000      0.98100007    
  0.20000000       2.4340384    
  0.30000001       6.3210268    
  0.40000001       26.900141    
  0.50000000       382.81558    
  0.60000002       72265.477    
  0.70000005      2.56161024E+09
  0.80000007      3.21858609E+18
  0.90000010      5.08123514E+36
   1.0000001           +Infinity
   1.1000001           +Infinity
   1.2000002           +Infinity
   1.3000002           +Infinity
   1.4000002           +Infinity
   1.5000002           +Infinity
   1.6000003           +Infinity
   1.7000003           +Infinity
   1.8000003           +Infinity
   1.9000003           +Infinity
   2.0000002           +Infinity