---- Analysis of speaker blocked coil impedance vs. position ---- David Meeker ---- 01Nov2015 -- Base problem name and configuration myFile='SSF-082_1kHz.fem'; myCoilName='Icoil'; myCoilGroup=1; -- Displacement range under consideration xmin=-15; xmax=15; dx=2; -- Frequency under consideration in Hz w = 1000; -- Open up base problem and save as the DC operating point with no coil current open(myFile); mi_modifycircprop(myCoilName,1,0); --mi_setcurrent(myCoilName,0); mi_saveas('DCProblem.fem'); -- Open up base problem and save as the incremental AC problem with a coil current of 1A -- Incremental AC problem points back to the DC solution via the mi_setprevious('DCProblem.ans',1) call open(myFile); mi_modifycircprop(myCoilName,1,1); --mi_setcurrent(myCoilName,1); mi_probdef(w); mi_setprevious('DCProblem.ans',1); mi_saveas('ACProblem.fem'); -- move the coil to the xmin position, assuming that the geometry is drawn so that the coil is nominally at x=0 mi_setfocus('DCProblem.fem'); mi_selectgroup(myCoilGroup); mi_movetranslate(0,xmin); mi_setfocus('ACProblem.fem'); mi_selectgroup(myCoilGroup); mi_movetranslate(0,xmin); -- Step through the full range of coil positions Xx={}; Lx={}; Vx={}; Bl={}; n=0; for x=xmin,xmax,dx do n=n+1; Xx[n]=x; mi_setfocus('DCProblem.fem'); mi_analyze(); -- Analyze the AC solution about the magnet's DC operating point mi_setfocus('ACProblem.fem'); mi_analyze(); mi_loadsolution(); -- Evaluate Bl curve mo_groupselectblock(1); f=abs(mo_blockintegral(29)); Bl[n]=f; -- Get Inductance and Impedance i,v,L=mo_getcircuitproperties(myCoilName); Lx[n]=L; Vx[n]=v; print(x," ",L); -- Move coil to next position if (x