/COM,ANSYS MEDIA REL. 2024R2 (05/10/2024) REF. VERIF. MANUAL: REL. 2024R2
/VERIFY,VM117
/PREP7
/TITLE, VM117, ELECTRIC CURRENT FLOWING IN A NETWORK
C*** BASIC ELECTRICAL ENGR, FITZGERALD AND HIGGIN BOTHAM, 2ND ED, P. 22, EX. 1-11
ANTYPE,STATIC
ET,1,LINK68 ! THERMAL-ELECTRICAL LINE ELEMENT
MP,RSVX,1,1 ! UNIT RESISTIVITY
R,1,(1/20) ! AREAS INPUT TO GIVE REQUIRED RESISTANCE
R,2,(1/10) ! AS PER RESISTANCE=RSVX*L/AREA
R,3,(SQRT(2)/9)
R,4,(1/30)
R,5,(1/90)
N,1
N,2,,1
NGEN,2,2,1,2,1,1
E,1,2 ! BRANCH 1-2, 20 OHM
REAL,2 ! BRANCH 1-3, 10 OHM
E,1,3
REAL,3 ! BRANCH 2-3, 9 OHM
E,2,3
REAL,4 ! BRANCH 2-4, 30 OHM
E,2,4
REAL,5 ! BRANCH 3-4, 90 OHM
E,3,4
KBC,1 ! STEP BOUNDARY CONDITIONS
D,4,VOLT,100 ! NODAL VOLTAGE
D,1,VOLT,0 ! GROUND NODE
OUTPR,ALL,1
OUTPR,VENG,NONE
FINISH
/SOLU
/OUT,SCRATCH
SOLVE
FINISH
/POST1
/OUT,
ETABLE,CUR,NMISC,5
PRETAB,CUR ! PRINT CURRENT FOR ALL BRANCHES
*GET,I42,ELEM,4,ETAB,CUR ! CURRENT IN BRANCH 4-2
*GET,I43,ELEM,5,ETAB,CUR ! CURRENT IN BRANCH 4-3
I14=I42+I43 ! CURRENT THROUGH BATTERY (BRANCH 1-4)
*GET,I21,ELEM,1,ETAB,CUR
*GET,I31,ELEM,2,ETAB,CUR
*GET,I23,ELEM,3,ETAB,CUR
*GET,V1,NODE,1,VOLT
*GET,V2,NODE,2,VOLT
*GET,V3,NODE,3,VOLT
*GET,V4,NODE,4,VOLT
*DIM,LABEL,CHAR,10,2
*DIM,VALUE,,10,3
LABEL(1,1) = 'V1, VOLT','V2, VOLT','V3, VOLT','V4, VOLT','I2_1, AM'
LABEL(1,2) = 'S ','S ','S ','S ','PS '
LABEL(6,1) = 'I3_1, AM','I2_3, AM','I4_2, AM','I4_3, AM','I1_4, AM'
LABEL(6,2) = 'PS ','PS ','PS ','PS ','PS '
*VFILL,VALUE(1,1),DATA,0,28,19,100,1.4,1.9,1,2.4,.9,3.3
*VFILL,VALUE(1,2),DATA,V1,V2,V3,V4,ABS(I21),ABS(I31),ABS(I23),ABS(I42),ABS(I43),ABS(I14)
*VFILL,VALUE(1,3),DATA,0,ABS(V2/28),ABS(V3/19),ABS(V4/100),ABS(I21/1.4),ABS(I31/1.9)
*VFILL,VALUE(7,3),DATA,ABS(I23/1),ABS(I42/2.4 ),ABS(I43/.9),ABS(I14/3.3)
SAVE,TABLE_1
FINISH
/CLEAR,NOSTART
/PREP7
ANTYPE,STATIC
ET,1,CIRCU124,0
ET,2,CIRCU124,4
MP,RSVX,1,1 ! UNIT RESISTIVITY
R,1,20
R,2,10
R,3,9
R,4,30
R,5,90
R,6,100
N,1
N,2,,1
NGEN,2,2,1,2,1,1
N,5,2,.5
E,1,2 ! BRANCH 1-2, 20 OHM
REAL,2 ! BRANCH 1-3, 10 OHM
E,1,3
REAL,3 ! BRANCH 2-3, 9 OHM
E,2,3
REAL,4 ! BRANCH 2-4, 30 OHM
E,2,4
REAL,5 ! BRANCH 3-4, 90 OHM
E,3,4
TYPE,2
REAL,6
E,4,1,5
KBC,1 ! STEP BOUNDARY CONDITIONS
D,1,VOLT,0 ! GROUND NODE
OUTPR,ALL,1
OUTPR,VENG,NONE
FINISH
/SOLU
/OUT,SCRATCH
SOLVE
FINISH
/POST1
/OUT,
ETABLE,CUR,SMISC,2
PRETAB,CUR ! PRINT CURRENT FOR ALL BRANCHES
*GET,I42,ELEM,4,ETAB,CUR ! CURRENT IN BRANCH 4-2
*GET,I43,ELEM,5,ETAB,CUR ! CURRENT IN BRANCH 4-3
I14=I42+I43 ! CURRENT THROUGH BATTERY (BRANCH 1-4)
*GET,I21,ELEM,1,ETAB,CUR
*GET,I31,ELEM,2,ETAB,CUR
*GET,I23,ELEM,3,ETAB,CUR
*GET,V1,NODE,1,VOLT
*GET,V2,NODE,2,VOLT
*GET,V3,NODE,3,VOLT
*GET,V4,NODE,4,VOLT
*DIM,LABEL,CHAR,10,2
*DIM,VALUE,,10,3
LABEL(1,1) = 'V1, VOLT','V2, VOLT','V3, VOLT','V4, VOLT','I2_1, AM'
LABEL(1,2) = 'S ','S ','S ','S ','PS '
LABEL(6,1) = 'I3_1, AM','I2_3, AM','I4_2, AM','I4_3, AM','I1_4, AM'
LABEL(6,2) = 'PS ','PS ','PS ','PS ','PS '
*VFILL,VALUE(1,1),DATA,0,28,19,100,1.4,1.9,1,2.4,.9,3.3
*VFILL,VALUE(1,2),DATA,V1,V2,V3,V4,ABS(I21),ABS(I31),ABS(I23),ABS(I42),ABS(I43),ABS(I14)
*VFILL,VALUE(1,3),DATA,0,ABS(V2/28),ABS(V3/19),ABS(V4/100),ABS(I21/1.4),ABS(I31/1.9)
*VFILL,VALUE(7,3),DATA,ABS(I23/1),ABS(I42/2.4 ),ABS(I43/.9),ABS(I14/3.3)
SAVE,TABLE_2
RESUME,TABLE_1
/COM
/OUT,vm117,vrt
/COM,------------------- VM117 RESULTS COMPARISON --------------
/COM,
/COM, | TARGET | Mechanical APDL | RATIO
/COM,
/COM,LINK68:
/COM,
*VWRITE,LABEL(1,1),LABEL(1,2),VALUE(1,1),VALUE(1,2),VALUE(1,3)
(1X,A8,A8,' ',F10.3,' ',F12.3,' ',1F15.3)
/NOPR
RESUME,TABLE_2
/GOPR
/COM,
/COM,CIRCU124:
/COM,
*VWRITE,LABEL(1,1),LABEL(1,2),VALUE(1,1),VALUE(1,2),VALUE(1,3)
(1X,A8,A8,' ',F10.3,' ',F12.3,' ',1F15.3)
/COM,----------------------------------------------------------
/OUT
FINISH
/DELETE,TABLE_1
/DELETE,TABLE_2
FINISH
*LIST,vm117,vrt