medmond919 icon

Interesting APDL script

medmond919 | PRO | 03/26/18 02:18:31 PM UTC | 0 ⭐ | 300 👁️ | Never ⏰ | []
text |

26.86 KB

|

None

|

0 👍

/

0 👎

!/PMACRO
/title,Torque Transmission between Magnetic Gears Bridged by Iron Pole
!David Shekhtman, Cooper Union Mechanical Engineer
!Advised by Professor Wolf, Cooper Union Professor and Chair of Physics
! /nopr
 npts=92
*dim,dist,table,npts
*dim,F,table,npts,2
pheta=0.0             ! Angle of Gear Rotation
 *do,i,1,npts,1
 parsave,all         ! Save all parameters
/clear,nostart      ! Do not reread the start file (look up)
parres              ! Read saved parameters
 ! ***Design Parameters in SI units
 *AFUN,RAD            ! Angular functions set to radians
Pi=acos(-1)          ! Define Pi
muo=4*Pi*1e-7        ! Free Space Permeability (Close Enough) 
rema=1.2             ! Remanance of a NdFeB magnet
*AFUN,DEG            ! Angular functions set to degrees
gap=0.03175          ! Radial Offset between Gears (1.25in)
 xxo=0                ! Location of Center of the Pole's arc
yyo=0
zzo=0
rpo1=0.0313       ! Outer Radius of Iron Pole 1.1875in now btw 1.23in and 1.24in
rpi1=.0254           ! Inner Radius of Iron Pole 1.000in
axl3=0.002794        ! Axial Length of the Pole 0.11in
plang=10 
 ror=0.035
    ro1=0.0210503        ! Radius of Tooth Location of Magnetic Gear  
ww1=0.003175         ! Width of magnet from center (0.125in)
hh1=0.00238125       ! Height of Magnet from center (0.09375in)
dep1=0.003175        ! Thickness of Magnet from center (0.125in)
 xx1=0-ro1*sin(pheta)                               ! Location of Magnet 1 in Global Coord
yy1=0+ro1*cos(pheta)
zz1=0
 xx2=ro1*cos(45)*cos(pheta)-ro1*sin(45)*sin(pheta)  ! Location of Magnet 2 in Global Coord
yy2=ro1*cos(45)*sin(pheta)+ro1*sin(45)*cos(pheta)
zz2=0
 xx3=ro1*cos(pheta)-0                               ! Location of Magnet 3 in Global Coord
yy3=ro1*sin(pheta)+0   
zz3=0
 xx4=ro1*cos(45)*cos(pheta)+ro1*sin(45)*sin(pheta)  ! Location of Magnet 4 in Global Coord
yy4=ro1*cos(45)*sin(pheta)-ro1*sin(45)*cos(pheta)
zz4=0
 xx5=0+ro1*sin(pheta)                               ! Location of Magnet 5 in Global Coord
yy5=0-ro1*cos(pheta)
zz5=0
 xx6=-ro1*cos(45)*cos(pheta)+ro1*sin(45)*sin(pheta) ! Location of Magnet 6 in Global Coord
yy6=-ro1*cos(45)*sin(pheta)-ro1*sin(45)*cos(pheta)
zz6=0
 xx7=-ro1*cos(pheta)-0                              ! Location of Magnet 7 in Global Coord
yy7=-ro1*sin(pheta)+0
zz7=0
 xx8=-ro1*cos(45)*cos(pheta)-ro1*sin(45)*sin(pheta) ! Location of Magnet 8 in Global Coord
yy8=-ro1*cos(45)*sin(pheta)+ro1*sin(45)*cos(pheta)
zz8=0
 xx17=0                                             ! Location of Magnet 9 in Global Coord
yy17=ror
zz17=0
 xx18=ror*cos(45)                                   ! Location of Magnet 10 in Global Coord
yy18=ror*sin(45)
zz18=0
 xx19=ror                                           ! Location of Magnet 11 in Global Coord
yy19=0
zz19=0
 xx20=ror*cos(315)                                   ! Location of Magnet 12 in Global Coord
yy20=ror*sin(315)
zz20=0
 xx21=0                                   ! Location of Magnet 13 in Global Coord
yy21=-ror
zz21=0
 xx22=ror*cos(225)
yy22=ror*sin(225)
zz22=0
 xx23=-ror
yy23=0
zz23=0
 xx24=ror*cos(135)
yy24=ror*sin(135)
zz24=0
  aa = 0.100           ! xlength of Air Enclosure
bb = 0.050           ! ylength of Air Enclosure
cc = 0.050           ! zlength of Air Enclosure
 ! ***Create Model
/prep7
EMUNIT, MKS          ! Defines MUZERO and EPZERO
ET,1,SOLID236        ! Define Element 1 as Solid236
KEYOPT,1,7,1
MP,MURX,1,1          ! Relative Permeability of Air
MP,MURX,2,4000       ! Relative Permeability of Iron (Electrical Steel Wiki)
mp,mury,2,4000
mp,murz,2,4000
  !MP,MGZZ,2,0.6/muo   ! Coersive force z-axis of coord sys 11 and 12
HC=25 !(A/m)
TB,BH,2              ! B-H curve for material 2 
TBPT,DEFI,-25+HC,0  ! Shifted B-H curve (H,B)
TBPT,,-24+HC,0.6    ! First field defaults to "DEFI"
TBPT,,-24.5+HC,1.0
TBPT,,-0.1+HC,1.2
TBPT,,0+HC,1.6
TBPLOT,BH,2           ! Plot of B vs. H
MP,MURX,3,1.05       ! Relative Permeability of a NdFeB Magnet
MP,MGZZ,3,rema/muo   ! Coersive force z-axis of coord sys 11 and 12
  ! ***Geometry via Direct Generation
! ***Gear Magnets
LOCAL,11,0,xx1,yy1,zz1,pheta,-90,0                ! Define new local coord system for magnet 1 (Active)
WPCSYS,1,11                                       ! Align new working plane with local coord sys 11 
BLOCK,-ww1,ww1,-dep1,dep1,-hh1,hh1                ! Magnet 1
 LOCAL,12,0,xx2,yy2,zz2,45+pheta,0,-90             ! Define new local coord system for magnet 2 (Active)
WPCSYS,1,12                                       ! Align new working plane with local coord sys 12 
BLOCK,-dep1,dep1,-ww1,ww1,-hh1,hh1                ! Magnet 2
 LOCAL,13,0,xx3,yy3,zz3,pheta,0,90                 ! Define new local coord system for magnet 3 (Active)
WPCSYS,1,13                                       ! Align new working plane with local coord sys 13 
BLOCK,-dep1,dep1,-ww1,ww1,-hh1,hh1                ! Magnet 3
 LOCAL,14,0,xx4,yy4,zz4,pheta-45,0,-90             ! Define new local coord system for magnet 4 (Active)
WPCSYS,1,14                                       ! Align new working plane with local coord sys 14 
BLOCK,-dep1,dep1,-ww1,ww1,-hh1,hh1                ! Magnet 4
 LOCAL,15,0,xx5,yy5,zz5,pheta,90,0                 ! Define new local coord system for magnet 5 (Active)
WPCSYS,1,15                                       ! Align new working plane with local coord sys 15 
BLOCK,-ww1,ww1,-dep1,dep1,-hh1,hh1                ! Magnet 5
 LOCAL,16,0,xx6,yy6,zz6,-45+pheta,-90,0            ! Define new local coord system for magnet 6 (Active)
WPCSYS,1,16                                       ! Align new working plane with local coord sys 16 
BLOCK,-ww1,ww1,-dep1,dep1,-hh1,hh1                ! Magnet 6
 LOCAL,17,0,xx7,yy7,zz7,pheta,0,-90                ! Define new local coord system for magnet 7 (Active)
WPCSYS,1,17                                       ! Align new working plane with local coord sys 17 
BLOCK,-dep1,dep1,-ww1,ww1,-hh1,hh1                ! Magnet 7
 LOCAL,18,0,xx8,yy8,zz8,pheta-45,0,90              ! Define new local coord system for magnet 8 (Active)
WPCSYS,1,18                                       ! Align new working plane with local coord sys 18 
BLOCK,-dep1,dep1,-ww1,ww1,-hh1,hh1                ! Magnet 8
 CSYS,0                                            ! Activate Global Cartesian Coord Sys
WPCSYS,1,0                                        ! Define working plane aligned with global coord sys 0
! ***Iron Poles
CYLIND,rpo1,rpi1,-(axl3)/2,(axl3)/2,90-plang,90+plang       ! Iron Pole 9
CYLIND,rpo1,rpi1,-(axl3)/2,(axl3)/2,45-plang,45+plang       ! Iron Pole 10
CYLIND,rpo1,rpi1,-(axl3)/2,(axl3)/2,0-plang,0+plang         ! Iron Pole 11
CYLIND,rpo1,rpi1,-(axl3)/2,(axl3)/2,315-plang,315+plang     ! Iron Pole 12
 CYLIND,rpo1,rpi1,-(axl3)/2,(axl3)/2,270-plang,270+plang     ! Iron Pole 13
CYLIND,rpo1,rpi1,-(axl3)/2,(axl3)/2,225-plang,225+plang     ! Iron Pole 14
CYLIND,rpo1,rpi1,-(axl3)/2,(axl3)/2,180-plang,180+plang     ! Iron Pole 15
CYLIND,rpo1,rpi1,-(axl3)/2,(axl3)/2,135-plang,135+plang     ! Iron Pole 16
  !Interested in _fysum on poles
LOCAL,19,0,xx17,yy17,zz17,90,0,0                   ! Define new local coord system for pole 9  (Active)
LOCAL,20,0,xx18,yy18,zz18,45,0,0                   ! Define new local coord system for pole 10 (Active)
LOCAL,21,0,xx19,yy19,zz19,0,0,0                    ! Define new local coord system for pole 11 (Active)
LOCAL,22,0,xx20,yy20,zz20,315,0,0                  ! Define new local coord system for pole 12 (Active)
LOCAL,23,0,xx21,yy21,zz21,270,0,0                  ! Define new local coord system for pole 13 (Active)
LOCAL,24,0,xx22,yy22,zz23,225,0,0                  ! Define new local coord system for pole 14 (Active)
LOCAL,25,0,xx23,yy23,zz23,180,0,0                  ! Define new local coord system for pole 15 (Active)
LOCAL,26,0,xx24,yy24,zz24,135,0,0                  ! Define new local coord system for pole 16 (Active)
    LOCAL,27,0,xx17,yy17,zz17,0,-90,0                  ! Define new local coord system for magnet 17 (Active)
WPCSYS,1,27                                        ! Align new working plane with local coord sys 27 
BLOCK,-dep1,dep1,-ww1,ww1,-hh1,hh1                 ! Magnet 17
 LOCAL,28,0,xx18,yy18,zz18,-45,90,0                 ! Define new local coord system for magnet 18 (Active)
WPCSYS,1,28                                        ! Align new working plane with local coord sys 28 
BLOCK,-dep1,dep1,-ww1,ww1,-hh1,hh1                 ! Magnet 18
 LOCAL,29,0,xx19,yy19,zz19,270,-90,0                ! Define new local coord system for magnet 19 (Active)
WPCSYS,1,29                                        ! Align new working plane with local coord sys 29 
BLOCK,-dep1,dep1,-ww1,ww1,-hh1,hh1                 ! Magnet 19
 LOCAL,30,0,xx20,yy20,zz20,-135,90,0                ! Define new local coord system for magnet 20 (Active)
WPCSYS,1,30                                        ! Align new working plane with local coord sys 30 
BLOCK,-dep1,dep1,-ww1,ww1,-hh1,hh1                 ! Magnet 20
 LOCAL,31,0,xx21,yy21,zz21,-180,-90,0               ! Define new local coord system for magnet 21 (Active)
WPCSYS,1,31                                        ! Align new working plane with local coord sys 31 
BLOCK,-dep1,dep1,-ww1,ww1,-hh1,hh1                 ! Magnet 21
 LOCAL,32,0,xx22,yy22,zz22,-225,90,0                ! Define new local coord system for magnet 22 (Active)
WPCSYS,1,32                                        ! Align new working plane with local coord sys 32 
BLOCK,-dep1,dep1,-ww1,ww1,-hh1,hh1                 ! Magnet 22
 LOCAL,33,0,xx23,yy23,zz23,90,-90,0                 ! Define new local coord system for magnet 23 (Active)
WPCSYS,1,33                                        ! Align new working plane with local coord sys 33 
BLOCK,-dep1,dep1,-ww1,ww1,-hh1,hh1                 ! Magnet 23
 LOCAL,34,0,xx24,yy24,zz24,-315,90,0                ! Define new local coord system for magnet 24 (Active)
WPCSYS,1,34                                        ! Align new working plane with local coord sys 34 
BLOCK,-dep1,dep1,-ww1,ww1,-hh1,hh1                 ! Magnet 24
  CSYS,0                                             ! Activate Global Cartesian Coord Sys
WPCSYS,1,0                                         ! Define working plane aligned with global coord sys 0
     ! ***Air Enclosure (box)
BLOCK,-aa,aa,-bb,bb,-cc,cc                        ! Air Enclosure
VOVLAP,all                                        ! Allow Air Enclosure to Overlap all Volume Elements   
numcmp,volu                                       ! Number compression for volumes (Important)
VPLOT,1,24,1                                      ! Plot all volumes except for Air Enclosure
 ! ***Assigning material Attributes
! VSEL,type,item,comp,vmin,vmax,vinc,ksep
! VATT,mat,real,type,esys,secnum
 VSEL,S,VOLU,,1                                    ! Seclect Volume 1    magnet 1
VATT,3,,1,11                                      ! Volume 1 is ndfeB.  Coord sys 11
VSEL,S,VOLU,,2                                    ! Seclect Volume 2    magnet 2
VATT,3,,1,12                                      ! Volume 2 is ndfeB.  Coord sys 12
VSEL,S,VOLU,,3                                    ! Seclect Volume 3    magnet 3
VATT,3,,1,13                                      ! Volume 3 is ndfeB.  Coord sys 13
VSEL,S,VOLU,,4                                    ! Seclect Volume 4    magnet 4
VATT,3,,1,14                                      ! Volume 4 is ndfeB.  Coord sys 14
VSEL,S,VOLU,,5                                    ! Seclect Volume 5    magnet 5
VATT,3,,1,15                                      ! Volume 5 is ndfeB.  Coord sys 15
VSEL,S,VOLU,,6                                    ! Seclect Volume 6    magnet 6
VATT,3,,1,16                                      ! Volume 6 is ndfeB.  Coord sys 16
VSEL,S,VOLU,,7                                    ! Seclect Volume 7    magnet 7
VATT,3,,1,17                                      ! Volume 7 is ndfeB.  Coord sys 17
VSEL,S,VOLU,,8                                    ! Seclect Volume 8    magnet 8
VATT,3,,1,18                                      ! Volume 8 is ndfeB.  Coord sys 18
 VSEL,S,VOLU,,9                                    ! Seclect Volume 9    pole 9
VATT,2,,1,27                                       ! Volume 9 is ndfeB.  Coord sys 27
VSEL,S,VOLU,,10                                   ! Seclect Volume 10   pole 10
VATT,2,,1,28                                       ! Volume 10 is ndfeB. Coord sys 28
VSEL,S,VOLU,,11                                   ! Seclect Volume 11   pole 11
VATT,2,,1,29                                       ! Volume 11 is ndfeB. Coord sys 29
VSEL,S,VOLU,,12                                   ! Seclect Volume 12   pole 12
VATT,2,,1,30                                       ! Volume 12 is ndfeB. Coord sys 30
VSEL,S,VOLU,,13                                   ! Seclect Volume 13   pole 13
VATT,2,,1,31                                       ! Volume 13 is ndfeB. Coord sys 31
VSEL,S,VOLU,,14                                   ! Seclect Volume 13   pole 14
VATT,2,,1,32                                       ! Volume 13 is ndfeB. Coord sys 32
VSEL,S,VOLU,,15                                   ! Seclect Volume 13   pole 15
VATT,2,,1,33                                       ! Volume 13 is ndfeB. Coord sys 33
VSEL,S,VOLU,,16                                   ! Seclect Volume 13   pole 16
VATT,2,,1,34                                       ! Volume 13 is ndfeB. Coord sys 34
 VSEL,S,VOLU,,17                                    ! Seclect Volume 1    magnet 1
VATT,3,,1,27                                      ! Volume 1 is ndfeB.  Coord sys 11
VSEL,S,VOLU,,18                                    ! Seclect Volume 2    magnet 2
VATT,3,,1,28                                      ! Volume 2 is ndfeB.  Coord sys 12
VSEL,S,VOLU,,19                                    ! Seclect Volume 3    magnet 3
VATT,3,,1,29                                      ! Volume 3 is ndfeB.  Coord sys 13
VSEL,S,VOLU,,20                                    ! Seclect Volume 4    magnet 4
VATT,3,,1,30                                      ! Volume 4 is ndfeB.  Coord sys 14
VSEL,S,VOLU,,21                                    ! Seclect Volume 5    magnet 5
VATT,3,,1,31                                      ! Volume 5 is ndfeB.  Coord sys 15
VSEL,S,VOLU,,22                                    ! Seclect Volume 6    magnet 6
VATT,3,,1,32                                      ! Volume 6 is ndfeB.  Coord sys 16
VSEL,S,VOLU,,23                                    ! Seclect Volume 7    magnet 7
VATT,3,,1,33                                      ! Volume 7 is ndfeB.  Coord sys 17
VSEL,S,VOLU,,24                                    ! Seclect Volume 8    magnet 8
VATT,3,,1,34                                      ! Volume 8 is ndfeB.  Coord sys 18
  VSEL,S,VOLU,,25                                   ! Seclect Volume 25   air enclosure
VATT,1,,1,0                                       ! Volume 25 is air.   Coord sys 0
 ! ***Meshing Procedure
! ***Meshing Left Magnet
VSEL,S,VOLU,,1,8,1                                ! Seclect Volumes 1 through 8
VSEL,A,VOLU,,17,24,1                              ! Seclect Volumes 17 through 24
ESIZE,,6                                         ! Global # of Meshing Element Divisions
MSHKEY,1                                          ! Mapped Volume Mesh
MSHAPE,0,3D                                       ! Using Hexahedral Elements
VMESH,1,13,1                                      ! Mesh volumes 1 through 13
VMESH,17,24,1                                     ! Mesh volumes 17 through 24  
 VSEL,S,VOLU,,9,16,1                               ! Seclect Volume 25
ESIZE,,8                                         ! Global # of Meshing Element Divisions
MSHKEY,1                                          ! Mapped Volume Mesh
MSHAPE,0,3D                                       ! Using Hexahedral Elements
VSWEEP,9                                          ! Mesh via sweeping volume 9
VSWEEP,10                                         ! Mesh via sweeping volume 10
VSWEEP,11                                         ! Mesh via sweeping volume 11
VSWEEP,12                                         ! Mesh via sweeping volume 12
VSWEEP,13                                         ! Mesh via sweeping volume 13
VSWEEP,14                                         ! Mesh via sweeping volume 14
VSWEEP,15                                         ! Mesh via sweeping volume 15
VSWEEP,16                                         ! Mesh via sweeping volume 16
   ! ***Meshing Air Enclosure
VSEL,S,VOLU,,25                                   ! Seclect Volume 25
ESIZE,,6                                         ! Global # of Meshing Element Divisions
MSHKEY,0                                          ! Free Volume Mesh
MSHAPE,1,3D                                       ! Using Tetrahedrals
MOPT,PYRA,ON                                      ! Allow pyramid transitioning
VMESH,25                                          ! Mesh volume 25
 !NSEL,s,ext
!D,ALL,AZ,0                          ! Flux-Parallel Boundary Condition
  ASEL,S,LOC,Z,cc                      ! Z SYMMETRY PLANE: FLUX PARALLEL approach from pg.1370 vm121 verfication manual
DA,ALL,AZ,0                          ! Flux-Parallel Boundary Condition Set AZ = 0 (important for edge formulation)
FINISH                               ! Finish Preprocessing
 /SOLU
SOLVE                                ! SOLVE macro for mag vector potential solution MAGSOLVE,0 
FINISH
 ! ***Postprocessor
/Post1
/NERR,,,-1 
vsel,s,,,1,,,1                       ! Select Everything in Volume one (corrected)
RSYS,11                              ! Activate Local Coordinate System 11
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx1=_fxsum
fy1=_fysum
allsel
 vsel,s,,,2,,,1                       ! Select Everything in Volume two (corrected)
RSYS,12                               ! Activate Global Coordinate System
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx2=_fxsum
fy2=_fysum
allsel
 vsel,s,,,3,,,1                       ! Select Everything in Volume three (corrected)
RSYS,13                              ! Activate coord sys 13
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
allsel
fz3=_fzsum
fy3=_fysum
 vsel,s,,,4,,,1                       ! Select Everything in Volume four (corrected)
RSYS,14                              ! Activate Global Coordinate System
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fz4=_fzsum
fy4=_fysum
allsel
 vsel,s,,,5,,,1                       ! Select Everything in Volume 15 (corrected)
RSYS,15                               ! Activate Global Coordinate System
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx5=_fxsum
fy5=_fysum
allsel
 vsel,s,,,6,,,1                       ! Select Everything in Volume 16 (corrected)
RSYS,16                               ! Activate Global Coordinate System
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx6=_fxsum
fy6=_fysum
allsel
 vsel,s,,,7,,,1                       ! Select Everything in Volume four (corrected)
RSYS,17                               ! Activate Global Coordinate System
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx7=_fxsum
fy7=_fysum
allsel
 vsel,s,,,8,,,1                       ! Select Everything in Volume one (corrected)
RSYS,18                              ! Activate Local Coordinate System 18
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx8=_fxsum
fy8=_fysum
allsel
  !Forces on poles
vsel,s,,,9,,,1                       ! Select Everything in Volume 9 (corrected)
RSYS,19                              ! Activate Local Coordinate System 19
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx9=_fxsum
fy9=_fysum
allsel
 vsel,s,,,10,,,1                       ! Select Everything in Volume 10 (corrected)
RSYS,20                              ! Activate Local Coordinate System 20
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx10=_fxsum
fy10=_fysum
allsel
 vsel,s,,,11,,,1                       ! Select Everything in Volume 11 (corrected)
RSYS,21                              ! Activate Local Coordinate System 21
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx11=_fxsum
fy11=_fysum
allsel
 vsel,s,,,12,,,1                       ! Select Everything in Volume 12 (corrected)
RSYS,22                              ! Activate Local Coordinate System 22
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx12=_fxsum
fy12=_fysum
allsel
 vsel,s,,,13,,,1                       ! Select Everything in Volume 13 (corrected)
RSYS,23                              ! Activate Local Coordinate System 23
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx13=_fxsum
fy13=_fysum
allsel
 vsel,s,,,14,,,1                       ! Select Everything in Volume 14 (corrected)
RSYS,24                              ! Activate Local Coordinate System 24
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx14=_fxsum
fy14=_fysum
allsel
 vsel,s,,,15,,,1                       ! Select Everything in Volume 15 (corrected)
RSYS,25                              ! Activate Local Coordinate System 25
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx15=_fxsum
fy15=_fysum
allsel
 vsel,s,,,16,,,1                       ! Select Everything in Volume 16 (corrected)
RSYS,26                              ! Activate Local Coordinate System 26
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx16=_fxsum
fy16=_fysum
allsel
 vsel,s,,,17,,,1                       ! Select Everything in Volume 9 (corrected)
RSYS,19                              ! Activate Local Coordinate System 19
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx17=_fxsum
fy17=_fysum
allsel
 vsel,s,,,18,,,1                       ! Select Everything in Volume 10 (corrected)
RSYS,20                              ! Activate Local Coordinate System 20
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx18=_fxsum
fy18=_fysum
allsel
 vsel,s,,,19,,,1                       ! Select Everything in Volume 11 (corrected)
RSYS,21                              ! Activate Local Coordinate System 21
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx19=_fxsum
fy19=_fysum
allsel
 vsel,s,,,20,,,1                       ! Select Everything in Volume 12 (corrected)
RSYS,22                              ! Activate Local Coordinate System 22
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx20=_fxsum
fy20=_fysum
allsel
 vsel,s,,,21,,,1                       ! Select Everything in Volume 13 (corrected)
RSYS,23                              ! Activate Local Coordinate System 23
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx21=_fxsum
fy21=_fysum
allsel
 vsel,s,,,22,,,1                       ! Select Everything in Volume 14 (corrected)
RSYS,24                              ! Activate Local Coordinate System 24
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx22=_fxsum
fy22=_fysum
allsel
 vsel,s,,,23,,,1                       ! Select Everything in Volume 15 (corrected)
RSYS,25                              ! Activate Local Coordinate System 25
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx23=_fxsum
fy23=_fysum
allsel
 vsel,s,,,24,,,1                       ! Select Everything in Volume 16 (corrected)
RSYS,26                              ! Activate Local Coordinate System 26
esln                                 ! Selects those elements attached to the selected nodes
EMFT                                 ! Sum up magnetic forces
fx24=_fxsum
fy24=_fysum
allsel
  /VIEW,1,0,0,1                        ! View Window 1 from angle 0,1,0
/VSCALE,1,0.75,0                      ! Set for Relative Magnitude Vector Scaling (0.75 length)
plvect,b,,,,vect,elem,on,on          ! plot magnetic field 
/DIST,1,0.729,1 
/REP,FAST   
/DIST,1,0.729,1 
/REP,FAST   
/DIST,1,0.729,1 
/REP,FAST   
/DIST,1,0.729,1 
/REP,FAST   
/image,save,Magnetic Flux Density of Rotating Magnetic Field %i%.bmp
plvect,fmag,,,,vect,node,on,on       ! plot magnetic forces
/image,save,Magnetic Forces Between Gears %i%.bmp
 allsel
FINISH
   /com, i = %i%
dist(i)=pheta
!F(i,1)=_fxsum*cos(pheta)-_fysum*sin(pheta)
!F(i,1)=fz3
F(i,1)=fy3+fy2+fy4+fx5+fx6-fx1-fy7-fy8
!F(i,2)=_fxsum*sin(pheta)+_fysum*cos(pheta)
!F(i,2)=fy3+fy2+fy4+fx5+fx6-fx1-fy7-fy8
F(i,2)=fy9+fy10+fy11+fy12+fy13+fy14+fy15+fy16
!F(i,2)=fy17+fy18+fy19+fy20+fy21+fy22+fy23+fy24
pheta=pheta+1
*enddo
 /axlab,x,Angular Displacement (degrees)
/axlab,y,Forces on Magnets 2,3,4 (N)
!/axlab,y,Ftan Mag 1 to 8 (N)
/gcol,1,Ft_inner
/gcol,2,Ft_poles
*vplot,dist(1),F(1,1),2
/image,save,not_Iron_Pole_Reg_Esize6_0_to_47.5deg %i%.bmp

Comments