VM130 Input Listing


/COM,ANSYS MEDIA REL. 2024R2 (05/10/2024) REF. VERIF. MANUAL: REL. 2024R2
/VERIFY,VM130
/TITLE, VM130, FOURIER SERIES GENERATION FOR A SAW TOOTH WAVE
/COM    VIBRATION PROBS. IN ENGR., TIMOSHENKO, 3RD. ED., PAGE 102, PROB. 2
*DIM,COEFF,,24
*DIM,MODE,TABLE,24
*DIM,ISYM,TABLE,24
*DIM,THETA,TABLE,121
*DIM,CURVEI,TABLE,121                  ! CURVE INPUT TO PROGRAM
*DIM,CURVEO,TABLE,121                  ! CURVE WHICH WILL BE DEVELOPED 
!                                        FROM GENERATED COEFFICIENTS
*VFILL,MODE(2),RAMP,1,2                ! ODD MODE NUMBERS
*VFILL,ISYM(2),RAMP,-1,0               ! ISYM = -1 (SINE)
*VFILL,THETA(1),RAMP,0,3               ! THETA VALUES INCREMENT 3 DEGREES
*VFILL,CURVEI(1),RAMP,0,1/30           ! WAVE DATA:  0 TO 90 DEG
*VFILL,CURVEI(31),RAMP,1,-1/30         !             90 TO 270 DEG
*VFILL,CURVEI(91),RAMP,-1,1/30         !             270 TO 360 DEG
!     CALCULATE FOURIER COEFFICIENT
*MFOURI,FIT, COEFF(1),MODE(1),ISYM(1),THETA(1),CURVEI(1)
!     EVALUATE SERIES BASED ON COEFFICIENTS
*MFOURI,EVAL,COEFF(1),MODE(1),ISYM(1),THETA(1),CURVEO(1)

*VWRITE                                ! WRITE OUTPUT IN TABULAR FORMAT
(///T14,'MODE',T24,'COEFF',T34,'ISYM',/)
*VWRITE,  MODE(1),COEFF(1),ISYM(1)
(T10,F10.4,T20,F10.4,T30,F10.4,T40,F10.4)

*VWRITE                                                      
(///T14,'THETA',T23,'CURVE IN',T34,'CURVE OUT',/)               
*VWRITE, THETA(1),CURVEI(1),CURVEO(1)                        
(T10,F10.4,T20,F10.4,T30,F10.4)                              
/GFILE,500
JPEG,QUAL,100
/TRIAD,OFF
/PLOPTS,LOGO,0
/PLOPTS,INFO,2
/PLOPTS,WP,0
/RGB,INDEX,100,100,100,0
/RGB,INDEX,80,80,80,13
/RGB,INDEX,60,60,60,14
/RGB,INDEX,0,0,0,15
/YRANGE,-1.25,1.25,ALL
*VPLOT,THETA(1),CURVEI(1)            ! PLOT INPUT CURVE VERSUS THETA
/USER
/NOERASE
/COM OVERLAY THE OUTPUT CURVE ON THE INPUT CURVE
*VPLOT,THETA(1),CURVEO(1)    ! PLOT OUTPUT CURVE VERSUS THETA
*SET,M1,COEFF(2,1,1)
*SET,M3,COEFF(3,1,1)
*SET,M5,COEFF(4,1,1)
*SET,M7,COEFF(5,1,1)
*status,parm
*DIM,LABEL,CHAR,4,2
*DIM,VALUE,,4,3
LABEL(1,1) = 'M1 ','M2 ','M3 ','M4 '
LABEL(1,2) = 'COEF','COEF','COEF','COEF'
*VFILL,VALUE(1,1),DATA,.811,-.901E-1,.324E-1,-.165E-1
*VFILL,VALUE(1,2),DATA,M1,M3,M5,M7
*VFILL,VALUE(1,3),DATA,ABS(M1/.811),ABS(M3/(-.901E-1)),ABS(M5/(.324E-1)),ABS(M7/(-.165E-1))
/COM
/OUT,vm130,vrt
/COM,------------------- VM130 RESULTS COMPARISON -------------
/COM,
/COM,                 |   TARGET   |   Mechanical APDL   |   RATIO
/COM,
*VWRITE,LABEL(1,1),LABEL(1,2),VALUE(1,1),VALUE(1,2),VALUE(1,3)
(1X,A8,A8,'   ',F10.4,'  ',F12.4,'   ',1F15.3)
/COM,----------------------------------------------------------
/OUT
FINISH
*LIST,vm130,vrt