!   TITLE:  band_modal.mac (AAAV)
!
!-----------------------------------------------------------------------
!       Rev -   01/10/2003      J. Judd
!       Rev A   01/31/2003      D. Edwards
!               Added special case of zero torque
!-----------------------------------------------------------------------
!
!   Find the normal modes of the unsupported length of the band drive 
!   using a supplied band thickness and torque on the .138-32 UNC screw
!   which puts the band in tension.
!   
!
!-----------------------------------------------------------------------
! COMMAND SYNTAX
!
!  band_modal,Torque,thick
!
!     Torque = Torque on screw which puts band in tension
!      thick = The thickness of the band
!
!-----------------------------------------------------------------------

Torque=arg1
thick=arg2

band_mdl,Torque,thick

!--- Static analysis ---
T=Torque
th=thick*10000
th=chrval(th)

*if,Torque,ne,0,then

    /title,Band Drive Prestressed Modal Analysis (Torque=%Torque%, thick=%thick%)
    ! Initially solve the static case with the band in tension
    bc1             ! Fix all translations at one and Y & Z at other + Fx
    fini

    /solu
    antype,static
    pstres,on
    solve
    fini

    ! Re-enter the solution processor with prestress effects included
    /solu
    antype,modal
    pstres,on
    modopt,lanb,4,10,10000
    solv

!   mdl_solve, SolnOpt_,'outfile_','infile_','extfile_',ARG5, ARG6, ARG7, ARG8
!   mdl_solve,2.001001,'m_%T%_%th%2','s_%T%_%th%','bc2',4,10,10000
*else
    /title,Band Drive Modal Analysis (thick=%thick%)

    bc2         ! Fix tanslations at both ends

    fini
    /solu
    antype,modal
    modopt,lanb,4,10,10000
    solv
*endif

fini

/post1

*get,f1,MODE,1,freq
*get,f2,MODE,2,freq
*get,f3,MODE,3,freq
*get,f4,MODE,4,freq

/nopr
/out,band_modal,out,,append
*vwrite,thick,Torque,Tension,f1,f2,f3,f4
(F8.4,6F18.4)
/out
/gopr

set,first

*do,nmode,1,4
    pldi
    plnsol,u,sum
    create_image
    set,next
*enddo