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=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.4899620    
  0.30000001       1.3820585    
  0.40000001       1.4261615    
  0.50000000       1.4095155    
  0.60000002       1.4160225    
  0.70000005       1.4135113    
  0.80000007       1.4144853    
  0.90000010       1.4141083    
   1.0000001       1.4142543    
   1.1000001       1.4141978    
   1.2000002       1.4142196    
   1.3000002       1.4142112    
   1.4000002       1.4142145    
   1.5000002       1.4142132    
   1.6000003       1.4142137    
   1.7000003       1.4142135    
   1.8000003       1.4142135    
   1.9000003       1.4142135    
   2.0000002       1.4142135    
   2.1000001       1.4142135    
   2.2000000       1.4142135    
   2.3000000       1.4142135    
   2.3999999       1.4142135    
   2.4999998       1.4142135    
   2.5999997       1.4142135    
   2.6999996       1.4142135    
   2.7999995       1.4142135    
   2.8999994       1.4142135    
   2.9999993       1.4142135    
   3.0999992       1.4142135    
   3.1999991       1.4142135    
   3.2999990       1.4142135    
   3.3999989       1.4142135    
   3.4999988       1.4142135    
   3.5999987       1.4142135    
   3.6999986       1.4142135    
   3.7999985       1.4142135    
   3.8999984       1.4142135    
   3.9999983       1.4142135    
   4.0999985       1.4142135    
   4.1999984       1.4142135    
   4.2999983       1.4142135    
   4.3999982       1.4142135    
   4.4999981       1.4142135    
   4.5999980       1.4142135    
   4.6999979       1.4142135    
   4.7999978       1.4142135    
   4.8999977       1.4142135    
   4.9999976       1.4142135