c  19. 2$B3,@~7AHyJ,J}Dx<0$N2rK!(B
c     $B?9@n(B $BLwBg(B , 22980138
c
      program ex19
c
      implicit none
      integer :: n 
      real :: x0,y0,dy0,h
c
      n=10
      h=0.1e0
      x0 =1.0e0
      y0 =2.0e0
      dy0=0.0e0
 
      write(6,*)'19. 2$B3,@~7AHyJ,J}Dx<0$N2rK!(B'
      write(6,*)''
      call Runge_Kutta19  (x0,y0,dy0,h,n)   

      stop 
      end
      
c-----$B%k%s%2!&%/%C%?K!$r4^$`(B2$B3,@~7AHyJ,J}Dx<0$N%5%V%k!<%A%s(B
      subroutine Runge_Kutta19(x0,y0,dy0,h,n)      
      implicit none
      integer :: n,i
      real :: h,xj,yj1,yj2,zj1,zj2,x0,y0,dy0,f,
     -        k1,k2,k3,k4,m1,m2,m3,m4
      
      xj =x0
      yj1=y0
      zj1=dy0
      write(6,200)
      write(6,100) 1.0,2.0e0
      do i=1,n
         k1=h*zj1
         m1=h*f(xj,yj1,zj1)
         k2=h*(zj1+(m1/2.0e0))
         m2=h*f(xj+(h/2.0e0),yj1+(k1/2.0e0),zj1+(m1/2.0e0))
         k3=h*(zj1+(m2/2.0e0))
         m3=h*f(xj+(h/2.0e0),yj1+(k2/2.0e0),zj1+(m2/2.0e0))
         k4=h*(zj1+m3)
         m4=h*f(xj+h,yj1+k3,zj1+m3)

         yj2=yj1+(k1+2.0e0*k2+2.0e0*k3+k4)/6.0e0
         zj2=zj1+(m1+2.0e0*m2+2.0e0*m3+m4)/6.0e0
         xj =xj+h
         write(6,100) xj,yj2
         yj1=yj2
         zj1=zj2
      enddo
      
      return
  100 format(1x,f4.1,1x,e18.9) 
  200 format(4x,'x',4x,'y') 
      end

c-----$B4X?t(B f=-(1/x)z-(-4/x)y $B$N%U%!%s%/%7%g%sJ8(B
      function f(x,y,z)
      implicit none
      real :: f,x,y,z

      f=-(1.0/x)*z-(-4.0/x**2)*y

      return
      end
