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=1.0
  14.  
  15. nc=50
  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.02s 2620KB
stdin
Standard input is empty
stdout
  0.00000000E+00  0.00000000E+00
  0.10000000      0.98100007    
  0.20000000       1.0179238    
  0.30000001      0.98244208    
  0.40000001       1.0165883    
  0.50000000      0.98377210    
  0.60000002       1.0153530    
  0.70000005      0.98499924    
  0.80000007       1.0142100    
  0.90000010      0.98613191    
   1.0000001       1.0131524    
   1.1000001      0.98717773    
   1.2000002       1.0121738    
   1.3000002      0.98814344    
   1.4000002       1.0112680    
   1.5000002      0.98903561    
   1.6000003       1.0104299    
   1.7000003      0.98985970    
   1.8000003       1.0096542    
   1.9000003      0.99062127    
   2.0000002       1.0089360    
   2.1000001      0.99132514    
   2.2000000       1.0082713    
   2.3000000      0.99197584    
   2.3999999       1.0076561    
   2.4999998      0.99257731    
   2.5999997       1.0070866    
   2.6999996      0.99313343    
   2.7999995       1.0065594    
   2.8999994      0.99364769    
   2.9999993       1.0060713    
   3.0999992      0.99412322    
   3.1999991       1.0056196    
   3.2999990      0.99456292    
   3.3999989       1.0052015    
   3.4999988      0.99496967    
   3.5999987       1.0048144    
   3.6999986      0.99534589    
   3.7999985       1.0044560    
   3.8999984      0.99569374    
   3.9999983       1.0041244    
   4.0999985      0.99601561    
   4.1999984       1.0038174    
   4.2999983      0.99631333    
   4.3999982       1.0035332    
   4.4999981      0.99658877    
   4.5999980       1.0032701    
   4.6999979      0.99684358    
   4.7999978       1.0030267    
   4.8999977      0.99707931    
   4.9999976       1.0028013