/FILNAME, F:\Ansys\temp\electromagnet /TITLE,2D single electromagnet static analysis !* Set GUI prefs KEYW,PR_SET,1 KEYW,PR_ELMAG,1 KEYW,MAGNOD,1 /PREP7 EMUNITS,MKS x = 0.01 n = 2 l = n*x ! Air: ET,1,PLANE53 ! ET: Finite Plane Element MP,MURX,1,1 ! MP: Permeability ! Magnet: ET,2,PLANE53 ! Plane Element MP,MURX,2,1 ! Permeability RECTNG,0,2*l+x,0,2*l+x ! air shape RECTNG,l,l+x,l,l+x ! electromagnet shape AATT,2,,2 ! apply em material & type ASEL,all ASBA,1,2,,,KEEP ! air with electromagnet-shaped hole ASEL,U,AREA,,2 ! unselect the electromagnet AATT,1,,1 ! apply air mat & type ASEL,all LSEL,S,EXT ! select exterior lines DL,ALL,,AZ,0 ! apply flux parallel BC v = 1 ! applied magnetic potential LSEL,S,LOC,X,l ! select left line of electromagnet DL,ALL,,AZ,v ! apply +v potential LSEL,S,LOC,X,l+x ! select right line of electromagnet DL,ALL,,AZ,-v ! apply -v potential ! Mesh ALLSEL SMRT,1 AMESH,ALL FINISH ! Solve and plot flux lines /SOLU MAGSOLV FINISH /POST1 PLF2D