      program disk ! BB Nov 22 2011. PHY 49346.
C Velocity versus theta for disk of problem 29, 31, 32.
C v^2=r^2\dot\theta^2=2*[E-m*g*r*(1-4*cos(theta)/(9*pi)]/
C                        m*[3/2-8*cos(theta)/(9*pi)]
C (A.) E=m*g*R:
C v^2=2*g*r*4*cos(theta)/(9*pi)]/[3/2-8*cos(theta)/(9*pi)].
      parameter(r=1.0,g=9.81,n=180)
      pi=acos(-1.0)
      pi9=9*pi
      dtheta=(pi/2)/n
      open(8,file="diskA.d",form='formatted',status='unknown')
      do i=-n,n
        theta=i*dtheta
        costh=cos(theta)
        v2=8.0*g*r*costh/pi9/(1.5-8.0*costh/pi9)
        if(v2.lt.0.0) v2=0.0
        vp=+sqrt(v2)
        vm=-sqrt(v2)
        write(8,'(4F12.4)') theta,vp,vm,costh
      enddo
      close(8)
      dtheta=(pi/4)/n
      a=1.0/(pi9*sqrt(2.0))
      open(8,file="diskB.d",form='formatted',status='unknown')
      do i=-n,n
        theta=i*dtheta
        costh=cos(theta)
        v2=8.0*g*r*(costh/pi9-a)/(1.5-8.0*costh/pi9)
        if(v2.lt.0.0) v2=0.0
        vp=+sqrt(v2)
        vm=-sqrt(v2)
        write(8,'(4F12.4)') theta,vp,vm,costh
      enddo
      close(8)
      stop
      end
