9.2. Example: Electromagnetic Linear Perturbation Analysis

This example problem demonstrates the use of the linear perturbation method to calculate the differential inductance matrix of a transformer (linear perturbation static analysis) and a DC-biased harmonic analysis (linear perturbation harmonic analysis). The transformer model is described in Example: Transformer Analysis .

/title, Linear Perturbation Analysis of a Transformer, 1/4 Symmetry
/vie,1,2,-1,3
/pnu,mat,1
/num,1
pi=acos(-1)

! *** Model parameters
a_core=0.010        ! core cross-section width
w_core=0.075        ! overall core width
h_core=0.075        ! overall core height

r1_coil=0.015       ! inner radius, both coils
r2_coil=0.020       ! outer radius, both coils
h_coil=0.040        ! height, both coils

d_dmn=0.025         ! depth of surrounding domain

esz1=a_core/3       ! element size, components
esz2=3*esz1         ! element size, surrounding domain


! *** Primary coil
Np=100              ! # of turns
Rp=24               ! DC resistance (ohms)
care_left=(r2_coil-r1_coil)*h_coil      ! cross-sectional area
volu_left=pi*(r2_coil**2-r1_coil**2)*h_coil   ! volume
Vp=0.5              ! voltage (V)

! *** Secondary coil
Ns=200          ! # of turns
Rs=Rp*(Ns/Np)**2        ! DC resistance (ohms)
care_right=(r2_coil-r1_coil)*h_coil    ! cross-sectional area
volu_right=pi*(r2_coil**2-r1_coil**2)*h_coil   ! volume

R=1e4                   ! resistance attached to the secondary coil

frqncy=50               ! operating frequency (Hz)
symm=4                  ! symmetry factor

/nopr
! *** Geometry
/PREP7
vsel,none               ! core
bloc,-w_core/2,w_core/2,,h_core/2,-a_core/2,0
cm,scrap1_v,volu
vsel,none
bloc,-(w_core/2-a_core),w_core/2-a_core,,h_core/2-a_core,-a_core/2,0
cm,scrap2_v,volu

cmse,s,scrap1_v
cmse,a,scrap2_v
vsbv,scrap1_v,scrap2_v
cm,core_v,volu
vatt,2,2,2

wpcs,-1,0                ! left coil ESYS
wpof,-w_core/2+a_core/2
wpro,,-90
cswp,11,1

wpcs,-1,0                ! right coil ESYS
wpof,w_core/2-a_core/2
wpro,,-90
cswp,12,1

csys

vsel,none                ! left coil
wpcs,-1,11
cyli,r1_coil,r2_coil,0,h_coil/2,0,90
cyli,r1_coil,r2_coil,0,h_coil/2,90,180
vatt,3,3,3,11

vsel,none                ! right coil
wpcs,-1,12
cyli,r1_coil,r2_coil,0,h_coil/2,0,90
cyli,r1_coil,r2_coil,0,h_coil/2,90,180
vatt,4,4,4,12

alls
cm,keep_v,volu
*get,xmin,kp,,mnloc,x
*get,xmax,kp,,mxloc,x
*get,ymax,kp,,mxloc,y
*get,zmin,kp,,mnloc,z

wpcs,-1,0                ! surrounding domain
vsel,none
bloc,xmin-d_dmn,xmax+d_dmn,,ymax+d_dmn,zmin-d_dmn,0
cm,scrap_v,volu

cmse,all
vsbv,scrap_v,keep_v,,dele,keep
cmse,u,keep_v
cm,air_v,volu
vatt,1,1,1

alls
vplo

! *** FE model
et,1,236                 ! air
mp,murx,1,1

et,2,236                 ! core (laminated, non-conducting)
TB,BH,2 ,   1,  20       ! M6 
TBPT,,  0.8   , 0.01
TBPT,,  1.12  , 0.02
TBPT,,  2.39  ,0.07
TBPT,,  4     , 0.24
TBPT,,  5.57  , 0.31
TBPT,,  8     , 0.7
TBPT,,  16    , 1.14
TBPT,,  40    , 1.5
TBPT,,  79.6  , 1.62
TBPT,,  159   , 1.70
TBPT,,  398   , 1.76
TBPT,,  796   , 1.82
TBPT,,  1592  , 1.88
TBPT,,  3365  , 1.94
TBPT,,  3979  , 1.95
TBPT,,  7958  , 1.985
TBPT,,  15915 ,  2.010
TBPT,,  39789 , 2.041
TBPT,,  79577 , 2.093
TBPT,, 160000 , 2.2


et,3,236,2               ! left primary coil
mp,murx,3,1
r,3,care_left,Np,volu_left,0,1,0     ! left coil data
rmore,Rp,symm

et,4,236,2               ! right secondary coil
mp,murx,4,1
r,4,care_right,Ns,volu_right,0,1,0   ! right coil data
rmore,Rs,symm

! *** Mesh
numm,kp,1e-8,1e-8
esiz,esz1
vsel,s,mat,,3,4
vmes,all
vsel,s,mat,,2
vswe,all

vsel,s,mat,,1
msha,1
esiz,esz2
vmes,all
alls

! *** Boundary conditions and loads
asel,s,ext             ! flux parallel exterior
csys
asel,u,loc,y
da,all,az

vsel,s,mat,,3          ! left primary coil
alls,belo,volu
cp,1,emf,all
cp,2,volt,all
nd_p=ndnext(0)
alls

vsel,s,mat,,4          ! right secondary coil
alls,belo,volu
cp,3,emf,all
cp,4,volt,all
nd_s=ndnext(0)
alls


! *** Circuit
et,5,124,0             ! resistor connected to the secondary coil
r,5,R

*get,nmax,node,,num,max

n,nmax+1,0,h_coil/2            
type,5
real,5
e,nd_s,nmax+1

d,nmax+1,volt,0        ! ground
csys

eplo
fini

! *** Operating point solution 
/solu
antyp,static
d,nd_p,volt,Vp
solve
fini

! *** Post-processing
/post1
set,1,1
vsel,s,mat,,2,4
alls,belo,volu
plve,jt,,,,vect,,on
plve,b,,,,vect,,on
fini

! *** Linear perturbation static analysis
!     to determine the self- and mutual inductances of the coils
/solu
antyp,static,restart,,,perturb
perturb,stat,,current,allkeep
solve,elform

! *** Apply test current to the primary coil to determine its self-inductance 
ddele,nd_p,volt
curr=1.e-3
f,nd_p,amps,curr
solve

! *** Apply test current to the secondary coil to determine its self-inductance
fdele,nd_p,amps
f,nd_s,amps,curr
solve

! *** Apply test current to both coils to determine their mutual inductance
f,nd_p,amps,curr
solve
fini

/post1
file,,rstp

set,1,last
etable,_iene,iene
ssum
*get,iene_p,ssum,,item,_iene
Lp=2*iene_p/curr**2*symm

set,2,last
etable,_iene,iene
ssum
*get,iene_s,ssum,,item,_iene
Ls=2*iene_s/curr**2*symm

set,3,last
etable,_iene,iene
ssum
*get,iene_m,ssum,,item,_iene
Lm=(iene_m-iene_p-iene_s)/curr**2*symm

/com, *******************************************************************
/com,    Self-inductance of the primary coil Lp = %Lp% H
/com,    Self-inductance of the secondary coil Ls = %Ls% H
/com,    Mutual inductance of two coils Lm = %Lm% H
/com, *******************************************************************

! *** Linear perturbation harmonic analysis around the operating point
/solu
antyp,static,restart,,,perturb
perturb,harmonic,,current,allkeep
solve,elform

harfrq,frqncy
d,nd_p,volt,Vp/10
solve

fini

/post1
file,,rstp
set,1,last,,0               ! Real solution set
Vp_real=volt(nd_p)
Vs_real=volt(nd_s)

/com,
/com, *** Real solution
/com,  Vp = %Vp_real%
/com,  Vs = %Vs_real%
/com,
vsel,s,mat,,2,4
alls,belo,volu
plve,jt,,,,vect,,on
plve,b,,,,vect,,on
plnsol,emf
alls

set,1,last,,1               ! Imaginary solution set
Vp_imag=volt(nd_p)
Vs_imag=volt(nd_s)

/com,
/com, *** Imag solution
/com,  Vp = %Vp_imag%
/com,  Vs = %Vs_imag%
/com,
vsel,s,mat,,2,4
alls,belo,volu
plve,jt,,,,vect,,on
plve,b,,,,vect,,on
plnsol,emf
alls

Vp = sqrt(Vp_real**2 + Vp_imag**2)
Vs = sqrt(Vs_real**2 + Vs_imag**2)
/com, 
/com, *** Secondary to Primary Coil Voltage Ratio =  %Vs/Vp%
fini