You are on page 1of 59

# Finite Element Method Magnetics: OctaveFEMM

Version 1.2
User’s Manual
November 26, 2009

David Meeker
dmeeker@ieee.org
http://femm.foster-miller.com
2006
c

1 Introduction
OctaveFEMM is a Matlab toolbox that allows for the operation of Finite Element Method Magnet-
ics (FEMM) via a set of Matlab functions. The toolbox works with Octave, a Matlab clone.
When OctaveFEMM starts up a FEMM process, the usual FEMM user interface is displayed
and is fully functional. The user then has the choice of accomplishing modeling and analysis tasks
either exclusively through functions implemented by the toolbox, or by a combination of manual
and programmatic operations – whichever is easiest for the task at hand.
The syntax of the OctaveFEMM toolbox closely mirrors that of FEMM’s existing Lua scripting
language interface associated with FEMM v4.2. However, there are some differences between the
Lua functions and the analogous Octave/Matlab implementations:

• All strings are enclosed in single quotes, rather than double quotes as in Lua.

• Functions in Lua that have no arguments require a set of empty parentheses after the function
name (e.g. mi analyze()). In Octave or Matlab, no parentheses should be used needed (e.g.
mi analyze with the OctaveFEMM toolbox).

commands streamline the drawing of new geometries with the OctaveFEMM toolbox, as
well is the collection of data from solutions.

Perhaps the most remarkable difference between Lua and OctaveFEMM, however, is due to
the matrix-oriented nature of Octave/Matlab. In just about any OctaveFEMM function in which
it would be desiable to enter an array of points such that multiple copies of an operation are per-
formed, OctaveFEMM will correctly interpret the input perform the requested operation on every
element in the array. In addition, for any function in which the coordinates of a point are required,
that point can be specified as an array with two elements instead of specifying each element sepa-
rately. In functions that require the specification of multiple points, those points can be entered as
an array of two-element arrays.

2 Installation and Startup
2.1 Installation for Matlab and Octave 3
The OctaveFEMM distribution is automatically installed with FEMM 4.2 in the mfiles subdirec-
tory. The absolute directory is typically c:\Program Files\femm42\mfiles. To use Octave-
FEMM with Octave or Matlab, this path needs to be added to the program’s search path. To add
this path to the search path, type the following lines at the Matlab or Octave 3.X.X command
prompt:

savepath;

Alternatively, in Matlab, the interactive pathtool command can be used to add the mfiles
directory to the search path.

2

2.2 Installation for Octave 2.1.50 and Octave 2.1.73
It is recommended that you use a newer version of Octave that has support for the actxserver
function. If this function exists, Octave will use ActiveX automation to communication with
FEMM. However, OctaveFEMM can still be used with versions of Octave (e.g. Octave 2.1.50
and 2.1.73) that do not support ActiveX. If actxserver is not available, a much slower interpro-
cess communication mechanism based on temporary files will be used.
Again, to use OctaveFEMM, the directory where the OctaveFEMM mfiles are located must
be permanently added to the search path. This directory can be added to the search path by an
appropriate modification of the .octaverc initialization file. For example, in the Octave 2.1.50
release, Octave looks for .octaverc in the directory:
C:\Program Files\GNU Octave 2.1.50\octave_files
To insert OctaveFEMM into the search path, one can create the .octaverc file and add the
line:
to add the directory containing the OctaveFEMM commands to the Octave search path.

2.3 Startup
To start an OctaveFEMM session, use the openfemm function. This function starts up a FEMM
process to which OctaveFEMM calls are sent. When done with OctaveFEMM, the FEMM process
can be shut down via the closefemm function.
A number of examples that use OctaveFEMM to analyze various problems are included in the
directory cd c:\Program Files\femm42\examples

3 Common Command Set
There are a number of FEMM-specific Octave that are not associated with any particular prob-
lem type. These functions manipulate the appearance of the main window and other top-level
components like the Lua console and Point Properties output window.

• clearconsole Clears the output window of the Lua console.

• newdocument(doctype) Creates a new preprocessor document and opens up a new prepro-
cessor window. Specify doctype to be 0 for a magnetics problem, 1 for an electrostatics
problem, 2 for a heat flow problem, or 3 for a current flow problem. Alternative syntax for
this function is create(doctype)

• hideconsole Hides the floating Lua console window.

• hidepointprops Hides the floating FEMM Properties display window.

• messagebox(’message’) displays the ’message’ string to the screen in a pop-up message
box.

• opendocument(’filename’) Opens a document specified by filename.

3

• print(item1,item2,...) This is standard Lua “print” command directed to the output of
the Lua console window. Any number of comma-separated items can be printed at once via
the print command.

• prompt(’message’) This function allows a FEMM script to prompt a user for input. When
this command is used, a dialog box pops up with the ’message’ string on the title bar of the
dialog box. The user can enter in a single line of input via the dialog box. Prompt returns
the user’s input to Octave and parses it using Octave’s eval command.

• showconsole Displays the floating Lua console window.

• showpointprops Displays the floating FEMM Properties display window.

• main minimize minimizes the main FEMM window.

• main maximize maximizes the main FEMM window.

• main restore restores the main FEMM window from a minimized or maximized state.

• main resize(width,height) resizes the main FEMM window client area to width ×
height.

4 Magnetics Preprocessor Command Set
A number of different commands are available in the preprocessor.

• mi addsegment(x1,y1,x2,y2) Add a new line segment from node closest to (x1,y1) to
node closest to (x2,y2)

• mi addarc(x1,y1,x2,y2,angle,maxseg) Add a new arc segment from the nearest node
to (x1,y1) to the nearest node to (x2,y2) with angle ‘angle’ divided into ‘maxseg’ segments.

• mi drawline(x1,y1,x2,y2) Adds nodes at (x1,y1) and (x2,y2) and adds a line between
the nodes.

• mi drawpolyline([x1,y1;x2,y2’...]) Adds nodes at each of the specified points and
connects them with segments.

• mi drawpolygon([x1,y1;x2,y2’...]) Adds nodes at each of the specified points and
connects them with segments to form a closed contour.

an arc of the specified angle and discretization connecting the nodes.

4

• mi drawrectangle(x1,y1,x2,y2) Adds nodes at the corners of a rectangle defined by the
points (x1,y1) and (x2,y2), then adds segments connecting the corners of the rectangle.

• mi deleteselected Delete all selected objects.

• mi deleteselectednodes Delete selected nodes.

• mi deleteselectedlabels Delete selected block labels.

• mi deleteselectedsegments Delete selected segments.

• mi deleteselectedarcsegments Delete selects arcs.

4.2 Geometry Selection Commands
• mi clearselected Clear all selected nodes, blocks, segments and arc segments.

• mi selectsegment(x,y) Select the line segment closest to (x,y)

• mi selectnode(x,y) Select the node closest to (x,y). Returns the coordinates of the se-
lected node.

• mi selectlabel(x,y) Select the label closet to (x,y). Returns the coordinates of the se-
lected label.

• mi selectarcsegment(x,y) Select the arc segment closest to (x,y)

• mi selectgroup(n) Select the nth group of nodes, segments, arc segments and blocklabels.
This function will clear all previously selected elements and leave the editmode in 4 (group)

4.3 Object Labeling Commands
• mi setnodeprop(’propname’,groupno) Set the selected nodes to have the nodal property
’propname’ and group number groupno.

• mi setblockprop(’blockname’, automesh, meshsize, ’incircuit’, magdir, group,
turns) Set the selected block labels to have the properties:

– Block property ’blockname’.
– automesh: 0 = mesher defers to mesh size constraint defined in meshsize, 1 = mesher
automatically chooses the mesh density.
– meshsize: size constraint on the mesh in the block marked by this label.
– Block is a member of the circuit named ’incircuit’
– The magnetization is directed along an angle in measured in degrees denoted by the
parameter magdir
– A member of group number group
– The number of turns associated with this label is denoted by turns.

5

’millimeters’. flag should be set to 1. 1 == hidden in post processor – A member of group number group • mi setarcsegmentprop(maxsegdeg. The flag parameter controls whether the solver window is visible or minimized. ’meters’. and ’micrometers’. The precision parameter dictates the precision required by the solver. hide. either specify no value for flag or specify 0. 4.type. ’documentname’ should contain the name of the desired document as it appears on the window’s title bar. or to ’axi’ for an axisymmetric problem.minangle.depth. For example. Specify the depth to be zero for axisymmetric problems. ’centimeters’. hide. 1 for Newton. this command can be used to switch between files so that the mutiple files can be operated upon programmatically. For a visible window. • mi setfocus(’documentname’) Switches the magnetics input file upon which commands are to act. Set the parameter problemtype to ’planar’ for a 2-D planar problem.units. ’propname’. • mi setsegmentprop(’propname’. representing the depth of the problem in the into-the-page direction for 2-D planar problems. group) Set the se- lected segments to have: – Boundary property ’propname’ – Local element size along segment no greater than elementsize – automesh: 0 = mesher defers to the element constraint defined by elementsize. group) Set the selected arc segments to: – Meshed with elements that span at most maxsegdeg degrees per element – Boundary property ’propname’ – hide: 0 = not hidden in post-processor. elementsize. 6 . Set freq to the desired frequency in Hertz. 1 == hidden in post processor – A member of group number group • mi setgroup(n) Set the group associated of the selected items to n. automesh. The sixth parameter represents the minimum angle constraint sent to the mesh generator – 30 degrees is the usual choice for this parameter. • mi analyze(flag) runs the magnetics solver. A fifth parameter. ’mils’. entering 1E-8 requires the RMS of the residual to be less than 10−8 . • mi loadsolution loads and displays the solution corresponding to the current geometry. 1 = mesher automatically chooses mesh size along the selected segments – hide: 0 = not hidden in post-processor.precision.(acsolver)) changes the problem definition.4 Problem Commands • mi probdef(freq. Valid ’units’ entries are ’inches’. For a minimized window. If more than one magnetics input file is being edited at a time. The units parameter spec- ifies the units used for measuring length in the problem domain. The acsolver parameter specifies which solver is to be used for AC problems: 0 for successive approximation.

angle.dy – distance by which the selected objects are incrementally shifted. as mi analyze will make sure the mesh is up to date before running an analysis. • mi copytranslate2(dx. copies ) – bx. 3 – arc segments. 3 – arc segments.shiftangle) – bx.y)intoacurveofradiusr. dy. – editaction 0 –nodes. 4. by. 4. by – base point for rotation – shiftangle – angle in degrees by which the selected objects are rotated. 2 –block labels. – editaction 0 –nodes. angle is measured in degrees.y. by – base point for rotation – angle – angle by which the selected objects are incrementally shifted to make each copy. copies. – copies – number of copies to be produced from the selected objects.group • mi copytranslate(dx. by. – copies – number of copies to be produced from the selected objects. 4. – copies – number of copies to be produced from the selected objects. dy. editaction ) – bx. • mi moverotate(bx. • mi showmesh shows the mesh. 1 – lines (segments).5 Mesh Commands • mi createmesh runs triangle to create a mesh. editaction) – dx. – copies – number of copies to be produced from the selected objects. by – base point for rotation – angle – angle by which the selected objects are incrementally shifted to make each copy. 1 – lines (segments). angle is measured in degrees. 7 .r)turnsacornerlocatedat(x. 4. • mi saveas(’filename’) saves the file with name ’filename’. copies. • mi purgemesh clears the mesh out of both the screen and memory. angle. • mi copyrotate2(bx. The number of elements in the mesh is pushed back onto the lua stack.6 Editing Commands • mi copyrotate(bx. Note that this is not a necessary precursor of performing an analysis. copies) – dx. 2 –block labels.by.dy – distance by which the selected objects are incrementally shifted.group • mi createradius(x.

dy.y2) mirror the selected objects about a line passing through the points (x1. 3 for arc segments.y1.shiftangle.by. 1 for lines (segments). 8 .dy – distance by which the selected objects are shifted. – editaction 0 –nodes.arc segments – ’blocks’ . 1 – lines (segments). 1 – lines (segments). – editaction 0 –nodes.by. 4.nodes – ’segments’ .by. 3 – arc segments.group • mi scale(bx. if they are used WITHOUT the editaction parameter.y2). and 4 for groups. • mi seteditmode(editmode) Sets the current editmode to: – ’nodes’ . by – base point for scaling – scalefactor – a multiplier that determines how much the selected objects are scaled • mi scale2(bx.editaction) – bx. 4.line segments – ’arcsegments’ .y2. 2 –block labels.scalefactor.scalefactor) – bx. 2 –block labels.dy – distance by which the selected objects are shifted. 3 – arc segments.y1. by – base point for scaling – scalefactor – a multiplier that determines how much the selected objects are scaled – editaction 0 –nodes. 2 –block labels.y1) and (x2.dy) – dx.group • mi movetranslate(dx.selected group This command will affect all subsequent uses of the other editing commands. • mi mirror2(x1. Valid editaction entries are 0 for nodes. 1 – lines (segments). 3 – arc segments. 2 for block labels.• mi moverotate2(bx.x2.group • mi mirror(x1.x2. • mi movetranslate2(dx.editaction) – dx.editaction) mirror the selected objects about a line passing through the points (x1. by – base point for rotation – shiftangle – angle in degrees by which the selected objects are rotated. editaction) – bx.block labels – ’group’ . 4.y2).y1) and (x2.

y2) Set the display area to be from the bottom left corner specified by (x1.y1) to the top right corner specified by (x2. • mi_grid_snap(’flag’) Setting flag to ’on’ turns on snap to grid. • mi maximize maximizes the active magnetics input view.y2). • mi restore restores the active magnetics input view from a minimized or maximized state. LamType. – H c Permanent magnet coercivity in Amps/Meter. • mi zoomout zooms out by a factor of 50%. mu x. dwire) adds a new material with called ’matname’ with the material properties: – mu x Relative permeability in the x. Phi hx. lam fill. – Cduct Electrical conductivity of the material in MS/m. • mi zoom(x1.x2.4. and the type parameter is set to ’cart’ for cartesian coordinates or ’polar’ for polar coordinates. • mi minimize minimizes the active magnetics input view. H c.height) resizes the active magnetics input window client area to width × height. setting flag to ’off’ turns off snap to grid. • mi_setgrid(density. 4. Phi hmax. Cduct. nstr. • mi_hidegrid Hide the grid points points. – Lam d Lamination thickness in millimeters. Phi hy. • mi refreshview Redraws the current view.9 Object Properties • mi addmaterial(’matname’. The density parameter speci- fies the space between grid points.’type’) Change the grid spacing.7 Zoom Commands • mi zoomnatural zooms to a “natural” view with sensible extents. • mi zoomin zoom in by a factor of 200%. J.or z-direction. • mi resize(width. Lam d. mu y. – J Applied source current density in Amps/mm2. 9 . 4.or r-direction. – mu y Relative permeability in the y.8 View Commands • mi_showgrid Show the grid points.y1.

a. Set the unused parameter pairs to 0. A1. – For a “Strategic dual image” boundary. • mi addbhpoint(’blockname’. A2.h) Adds a B-H data point the the material specified by the string ’blockname’. Mu. Set all other parameters to zero. 10 . • mi addboundprop(’propname’. A0. set BdryFormat to 3 and set all other parameters to zero. set C1 and C0 as required and BdryFormat to 2. A1. – For a “Small Skin Depth” type boundary condtion. set the A0. – To obtain a “Mixed” type boundary condition. – Phi hmax Hysteresis lag angle in degrees. – dwire Diameter of each of the wire’s constituent strand in millimeters. • mi clearbhpoints(’blockname’) Clears all B-H data points associatied with the material specified by ’blockname’. – Lam fill Fraction of the volume occupied per lamination that is actually filled with iron (Note that this parameter defaults to 1 in the femm preprocessor dialog box because. – Phi hy Hysteresis lag in degrees in the y-direction for linear problems. • mi addpointprop(’pointpropname’. The point to be added has a flux density of b in units of Teslas and a field intensity of h in units of Amps/Meter. by default. – nstr Number of strands in the wire build. BdryFormat) adds a new boundary property with name ’propname’ – For a “Prescribed A” type boundary condition.j) adds a new point property of name ’pointpropname’ with either a specified potential a in units Webers/Meter or a point current j in units of Amps. Should be 1 for Magnet or Square wire. Set all other parameters to zero. A2 and Phi parameters as required. c0.b. set the Mu to the desired relative permeability and Sig to the desired conductivity in MS/m. Note that not all properties need be defined – properties that aren’t defined are assigned default values. iron completely fills the volume) – Lamtype Set to ∗ 0 – Not laminated or laminated in plane ∗ 1 – laminated x or r ∗ 2 – laminated y or z ∗ 3 – magnet wire ∗ 4 – plain stranded wire ∗ 5 – Litz wire ∗ 6 – square wire – Phi hx Hysteresis lag in degrees in the x-direction for linear problems. Phi. Set BdryFormat to 1 and all other parameters to zero. Sig. used for nonlinear BH curves. c1.

The BC to be modified is specified by ’BdryName’. • mi deletematerial(’materialname’) deletes the material named ’materialname’. MS/m 6 dlam Lamination thickness. The next parameter is the number of the property to be set. The last number is the value to be applied to the specified property. set BdryFormat to 5 set all other parameters to zero. • mi addcircprop(’circuitname’. The material to be modified is specified by ’BlockName’. 1 = parallel to x. degrees • mi_modifyboundprop(’BdryName’. The last number is the value to be applied to the specified property. – For an “Anti-Perodic” boundary condition. i. mm 7 φhmax Hysteresis lag angle for nonlinear problems. The various properties that can be modified are listed below: 11 . • mi deletepointprop(’pointpropname’) deletes the point property named ’pointpropname’ • mi_modifymaterial(’BlockName’. – For a “Periodic” boundary condition. degrees 8 LamFill Iron fill fraction 9 LamType 0 = None/In plane.propnum.propnum. so that current can be modified from run to run). • mi deleteboundprop(’propname’) deletes the boundary property named ’propname’. set BdryFormat to 4 and set all other parameters to zero. The various properties that can be modified are listed below: propnum Symbol Description 0 BlockName Name of the material 1 µx x (or r) direction relative permeability 2 µy y (or z) direction relative permeability 3 Hc Coercivity. The circuittype parameter is 0 for a parallel-connected circuit and 1 for a series-connected circuit.g.value) This function allows for modifica- tion of a material’s properties without redefining the entire material (e. MA/m2 5 σ Electrical conductivity. degrees 11 φhy Hysteresis lag in y-direction for linear problems.value) This function allows for modifica- tion of a boundary property. Amps/Meter 4 J Source current density. The next parameter is the number of the property to be set. • mi deletecircuit(’circuitname’) deletes the circuit named circuitname. 2=parallel to y 10 φhx Hysteresis lag in x-direction for linear problems. circuittype) adds a new circuit property with name ’circuitname’ with a prescribed current.

The last number is the value to be applied to the specified property.10 Miscellaneous • mi savebitmap(’filename’) saves a bitmapped screenshot of the current view to the file specified by ’filename’. propnum Symbol Description 0 BdryName Name of boundary property 1 A0 Prescribed A parameter 2 A1 Prescribed A parameter 3 A2 Prescribed A parameter 4 φ Prescribed A phase 5 µ Small skin depth relative permeability 6 σ Small skin depth conductivity. 12 . Weber/Meter 2 J Nodal current.value) This function allows for modifi- cation of a point property. Amps • mi_modifycircprop(’CircName’. 1 = Series • mi setcurrent(’CircName’.propnum. The circuit property to be modified is specified by ’CircName’.i) sets the current in the circuit specified by ’CircName’ to i. The last number is the value to be applied to the specified property. 4. MS/m 7 c0 Mixed BC parameter 8 c1 Mixed BC parameter 9 BdryFormat Type of boundary condition: 0 = Prescribed A 1 = Small skin depth 2 = Mixed 3 = Strategic Dual Image 4 = Periodic 5 = Antiperiodic • mi_modifypointprop(’PointName’. The various properties that can be modified are listed below: propnum Symbol Description 0 PointName Name of the point property 1 A Nodal potential. The next parameter is the number of the property to be set. The various properties that can be modified are listed below: propnum Symbol Description 0 CircName Name of the circuit property 1 i Total current 2 CircType 0 = Parallel. The point property to be modified is specified by ’PointName’.value) This function allows for modifica- tion of a circuit property.propnum. The next parameter is the number of the property to be set.

the Ro parameter is the radius of the outer region. the region of interest). • mi readdxf(’filename’) This function imports a dxf file specified by ’filename’.Ri) defines an axisymmetric external region to be used in conjuction with the Kelvin Transformation method of modeling unbounded problems. • mi shownames(flag) This function allow the user to display or hide the block label names on screen.t total H.n total B. - 1 H. the permeability varies as a function of distance from the origin of the external region.n)ˆ2 .n)ˆ2 avg (B. • mi attachouterspace marks all selected block labels as members of the external region used for modeling unbounded axisymmetric problems via the Kelvin Transformation. 5. To display the names. • mi refreshview Redraws the current view.e. • mi defineouterspace(Zo.t . - 2 Contour length surface area . In the exterior region. 5 Magnetics Post Processor Command Set There are a number of scripting commands designed to operate in the postprocessing environment. • mi savemetafile(’filename’) saves a metafile screenshot of the current view to the file specified by ’filename’. These parameters are necessary to define the permeability variation in the external region.n avg B. - 3 Stress Tensor Force DC r/x force DC y/z force 2× r/x force 2× y/z force 4 Stress Tensor Torque DC torque 2× torque . • mi savedxf(’filename’) This function saves geometry information in a dxf file specified by ’filename’. • mi detachouterspace undefines all selected block labels as members of the external region used for modeling unbounded axisymmetric problems via the Kelvin Transformation. • mi close Closes current magnetics preprocessor document and destroys magnetics prepro- cessor window. The Zo parameter is the z-location of the origin of the outer region.n)ˆ2 total (B. - 5 (B.Ro. flag should be 0. To hide the block label names.n .1 Data Extraction Commands • mo lineintegral(type) Calculate the line integral for the defined contour type name values 1 values 2 values 3 values 4 0 B. and the Ri parameter is the radius of the inner region (i. - 13 . the parameter should be set to 1.t avg H.

The only exception is integral 3. moment of inertia / density) • mo getpointvalues(x. For force and torque results. which evaluates Maxwell’s stress tensor.y) Get the values associated with the point at (x. and the second value is the average of the quantity of interest over the contour.y). Returns typically two values. The first value is the result of the integral calculation. the 2× results are only relevant for problems where ω 6= 0. The function returns an array whose contents are. This integral can return up to four results. • mo blockintegral(type) Calculate a block integral for the selected blocks Type Definition 0 A·J 1 A 2 Magnetic field energy 3 Hysteresis and/or lamination losses 4 Resistive losses 5 Block cross-section area 6 Total losses 7 Total current 8 Integral of Bx (or Br ) over block 9 Integral of By (or Bz ) over block 10 Block volume 11 x (or r) part of steady-state Lorentz force 12 y (or z) part of steady-state Lorentz force 13 x (or r) part of 2× Lorentz force 14 y (or z) part of 2× Lorentz force 15 Steady-state Lorentz torque 16 2× component of Lorentz torque 17 Magnetic field coenergy 18 x (or r) part of steady-state weighted stress tensor force 19 y (or z) part of steady-state weighted stress tensor force 20 x (or r) part of 2× weighted stress tensor force 21 y (or z) part of 2× weighted stress tensor force 22 Steady-state weighted stress tensor torque 23 2× component of weighted stress tensor torque 24 R2 (i.e. in order: 14 .

• mo getj(x.y). Br if axisymmetric B2 By if planar.y) Gets the magnetic field energy density associated with the point at (x. 2πrA is reported.y) Get the magnetic flux density associated with the point at (x. • mo getpe(x. • mo getfill(x.y) Get the electric current density associated with the point at (x. The return value is a list with two element representing Hx and Hy for planar problems and Hr and Hz for axisymmetric problems.y) Get the magnetic field intensity associated with the point at (x. • mo getb(x. 15 .y). Symbol Definition A Potential A or flux φ B1 Bx if planar.y). • mo geth(x. µz if axisymmetric Pe Power density dissipated through ohmic losses Ph Power density dissipated by hysteresis ff Winding fill factor The following series of functions retrieves smaller subsets of these results.e.y). • mo getmu(x. The return value is a list with two element representing µx and µy for planar problems and µr and µz for axisymmetric problems.y). the average fraction of the volume filled with conductor) associated with the point at (x. For planar problems.y).y) Get the ohmic loss density associated with the point at (x. • mo getph(x.y).y) Get the potential associated with the point at (x.y).y).y) Get the relative magnetic permeability associated with the point at (x.y) Gets the conductivity associated with the point at (x. Bz if axisymmetric Sig conductivity σ E stored energy density H1 Hx if planar. • mo geta(x. • mo getconductivity(x. For axisymmetric problems. • mo getenergydensity(x.y) Get the hysteresis/laminated eddy current loss density associated with the point at (x.y). µr if axisymmetric Mu2 µy if planar. Hz if axisymmetric Je eddy current density Js source current density Mu1 µx if planar.y) Get the winding factor (i. The return value is a list with two element representing Bx and By for planar problems and Br and Bz for axisymmetric problems. Hr if axisymmetric H2 Hy if planar. the reported potential is vector potential A.

if one wanted to plot B · n to the screen with 200 points evaluated to make the graph. the command would be: mo makeplot(2. Returns four values: Return value Definition 1 problem type 2 frequency in Hz 3 problem depth in meters 4 length unit used to draw the problem. Valid entries for PlotType are: PlotType Definition 0 Potential 1 |B| 2 B·n 3 B·t 4 |H| 5 H ·n 6 H ·t 7 Jeddy 8 Jsource + Jeddy Valid file formats are FileFormat Definition 0 Multi-column text with legend 1 Multi-column text with no legend 2 Mathematica-style formatting For example. the command is instead interpreted as a command to write the data to disk to the specfied file name. Properties are returned for the circuit property named ’circuit’. If only PlotType or only PlotType and NumPoints are spec- ified.’c:\temp\myfile.emf’) To write data instead of a plot to disk. rather than display it to make a graphical plot. Six values are returned by the function.200) If this plot were to be written to disk as a metafile.txt’.0) • mo_getprobleminfo Returns info on problem description. the command would be: mo_makeplot(2.Filename. represented in meters • mo_getcircuitproperties(’circuit’) Used primarily to obtain impedance information associated with circuit properties. In order.200. the plot is instead written to disk to the specified file name as an extended metafile. the command would be of the form: mo_makeplot(2. these parameters are: 16 . in addition. If.200. the command is interpreted as a request to plot the requested plot type to the screen. the Filename parameter is specified.FileFormat) Allows Octave access to FEMM’s X-Y plot routines.• mo_makeplot(PlotType.’c:\temp\myfile.NumPoints. If the FileFormat parameter is also.

– flux Circuit’s flux linkage 5. and ’area’. The anglestep parameter must be greater than zero. • mo addcontour(x.y) Adds a contour point at (x.y2). The mo addcontour command has the same functionality as a right-button-click contour point addition when the program is running in interactive mode. Valid entries for mode are ’point’. or area mode.y). • mo selectblock(x. If no number is specified (i. – volts Voltage drop across the circuit in the circuit. • mo_zoomout Zoom out one level. mo groupselectblock ). each of which is constrained to span no more than anglestep de- grees. If there are less than two points defined in the contour. • mo_zoomin Zoom in one level.x2. if there are existing points the contour runs from the previous point to this point.y) Adds a contour point at the closest input point to (x. • mo selectpoint(x. If this is the first point then it starts a contour. The mo selectpoint command has the same functional- ity as the left-button-click contour point selection when the program is running in interactive mode.y).y1) and upper right corner (x2. a contour is added that traces along the arcsegment. • mo zoom(x1. • mo groupselectblock(n) Selects all of the blocks that are labeled by block labels that are members of group n. The angle parameter can take on values from -180 to 180 degrees.2 Selection Commands • mo seteditmode(mode) Sets the mode of the postprocessor to point. • mo bendcontour(angle.y) Select the block that contains point (x.3 Zoom Commands • mo_zoomnatural Zoom to the natural boundaries of the geometry. all blocks are selected. contour. this command is ignored. ’contour’.e. The arc is actually composed of many straight lines. • mo clearcontour Clear a prevously defined contour • mo clearblock Clear block selection 5. 17 .anglestep) Replaces the straight line formed by the last two points in the contour by an arc that spans angle degrees. If the se- lected point and a previous selected points lie at the ends of an arcsegment.y2) Zoom to the window defined by lower left corner (x1.y). – current Current carried by the circuit.y1.

• mo_showpoints Show the node points from the input geometry. Valid entries are ’mag’. • mo_setgrid(density. – lower_A Lower limit for A contours.lower_A. • mo_showdensityplot(legend. which are naturally piece-wise constant over each element. and setting flag to ’off’ turns off smoothing. and ’jimag’ for magnitude. – gscale Set to 0 for a colour density plot or 1 for a grey scale density plot. • mo_showcontourplot(numcontours. – upper_B Sets the upper display limit for the density plot.upper_A.type) shows the A contour plot with options: – numcontours Number of A equipotential lines to be plotted. real component. • mo smooth(’flag’) This function controls whether or not smoothing is applied to the B and H fields.lower_B. ’real’. and the type parameter is set to ’cart’ for cartesian coordinates or ’polar’ for polar coordinates.gscale. and imaginary component of B. The density parameter speci- fies the space between grid points. Alterna- tively. – type Type of density plot to display.5. • mo_grid_snap(’flag’) Setting flag to ’on’ turns on snap to grid.4 View Commands • mo_showmesh Show the mesh. – lower_B Sets the lower display limit for the density plot. • mo_hidedensityplot hides the flux density plot.type) Shows the flux density plot with options: – legend Set to 0 to hide the plot legend or 1 to show the plot legend. real component. • mo_hidecontourplot Hides the contour plot. respectively. setting flag to ’off’ turns off snap to grid. 18 . – upper_A Upper limit for A contours.’type’) Change the grid spacing. ’jreal’. Setting flag equal to ’on’ turns on smoothing. respectively. • mo_hidepoints Hide the node points from the input geometry. • mo_hidegrid Hide the grid points points. and ’imag’ for magnitude.upper_B. • mo_hidemesh Hide the mesh. • mo_showgrid Show the grid points. current density can be displayed by specifying ’jmag’. and imaginary component of J.

Index of second element node 19 . • mo getelement(n) MOGetElement[n] returns the following proprerties for the nth element: 1. • mo numelements Returns the number of elements in the in focus magnets output mesh. • mo showvectorplot(type. 1 for the real part of flux density B. flag should be 0. 3 for the imaginary part of B. 5. To display the names. • mo savemetafile(’filename’) saves a metafile screenshot of the current view to the file specified by ’filename’.y) or (r.5 Miscellaneous • mo close Closes the current post-processor instance. If the scale is set to 1. or ’both’ to show either the real. 4 for the imaginary part of H.scalefactor) controls the display of vectors denoting the field strength and direction. • mo shownames(flag) This function allow the user to display or hide the block label names on screen. which should be set to 0 for no vector plot. • mo maximize maximizes the active magnetics output view. ’imag’. Index of first element node 2. 2 for the real part of field intensity H. – type Choice of ’real’. The scalefactor determines the relative length of the vectors. • mo refreshview Redraws the current view.z) position of the nth mesh node. and 6 for both the real and imaginary parts of H. the parameter should be set to 1. To hide the block label names. the length of the vectors are chosen so that the highest flux density corresponds to a vector that is the same length as the current grid size setting. imaginary of both real and imaginary components of A. • mo numnodes Returns the number of nodes in the in focus magnetics output mesh. The parameters taken are the type of plot. • mo reload Reloads the solution from disk. • mo restore restores the active magnetics output view from a minimized or maximized state. • mo minimize minimizes the active magnetics output view. • mo getnode(n) Returns the (x. 5 for both the real and imaginary parts of B. • mo savebitmap(’filename’) saves a bitmapped screen shot of the current view to the file specified by ’filename’.height) resizes the active magnetics output window client area to width × height. • mo resize(width.

• ei selectarcsegment(x. segments and arc segments.y) Select the line segment closest to (x.3 Object Labeling Commands • ei setnodeprop(’propname’. 1 = mesher automatically chooses mesh size along the selected segments hide: 0 = not hidden in post-processor. 1 = mesher automatically chooses the mesh density.6. automesh. this parameter can be specified as ’<None>’. group.y). arc segments and block labels. Returns the coordinates of the se- lected node.y) Select the label closet to (x. this parameter can be set to ’<None>’. elmsize.y).y) • ei selectgroup(n) Select the nth group of nodes. If the node doesn’t belong to a named con- ductor. • ei selectsegment(x. meshsize. blocks.y) Select the node closest to (x. Returns the coordinates of the se- lected label. automesh. segments. • ei setblockprop(’blockname’. This function will clear all previously selected elements and leave the edit mode in 4 (group) 6. The ’inconductor’ string specifies which conductor the node belongs to. meshsize: size constraint on the mesh in the block marked by this label.2 Geometry Selection Commands • ei clearselected Clear all selected nodes. 21 . • ei selectlabel(x. If the segment is not part of a conductor.y) • ei selectnode(x.groupno.y) Select the arc segment closest to (x. group) Set the selected block labels to have the properties: Block property ’blockname’. 1 == hidden in post processor A member of group number group A member of the conductor specified by the string ’inconductor’. automesh: 0 = mesher defers to mesh size constraint defined in meshsize. ’inconductor’) Set the selected nodes to have the nodal property ’propname’ and group number groupno. hide. ’inconductor’) Set the select segments to have: Boundary property ’name’ Local element size along segment no greater than elmsize automesh: 0 = mesher defers to the element constraint defined by elementsize. A member of group number group • ei setsegmentprop(’name’.

The number of elements in the mesh is pushed back onto the lua stack.minangle) changes the problem definition. and ’micrometers’. ’mils’. The sixth parameter represents the minimum angle constraint sent to the mesh generator (usually 30 degrees). group. ’inconductor’) Set the selected arc segments to: Meshed with elements that span at most maxsegdeg degrees per element Boundary property ’propname’ hide: 0 = not hidden in post-processor.precision. or to ’axi’ for an axisymmetric problem. 1 == hidden in post processor A member of group number group A member of the conductor specified by the string ’inconductor’. For example. ’meters. • ei showmesh toggles the flag that shows or hides the mesh. this parameter can be specified as ’<None>’. The precision parameter dictates the precision required by the solver. as ei analyze will make sure the mesh is up to date before running an analysis. • ei loadsolution loads and displays the solution corresponding to the current geometry. Note that this is not a necessary precursor of performing an analysis. 6. • ei setfocus(’documentname’) Switches the electrostatics input file upon which com- mands are to act. • ei setarcsegmentprop(maxsegdeg. For a visible window.type. The fourth parameter represents the depth of the problem in the into-the-page direction for 2-D planar problems–just enter 0 as a placeholder for axisymmetric problems.5 Mesh Commands • ei createmesh runs triangle to create a mesh. ’centimeters’. For a minimized window. ’documentname’ should contain the name of the desired document as it appears on the window’s title bar. If the segment is not part of a conductor. either specify no value for flag or specify 0. • ei analyze(flag) runs the electrostatics solver.E-8 requires the RMS of the residual to be less than 10−8 .depth. hide. • ei saveas(’filename’) saves the file with name ’filename’. • ei setgroup(n) Set the group associated of the selected items to n. The units parameter specifies the units used for measuring length in the problem domain. flag should be set to 1. Valid ’units’ entries are ’inches’. If more than one electrostatics input file is being edited at a time. this command can be used to switch between files so that the mutiple files can be operated upon programmatically. ’propname’. entering 1.4 Problem Commands • ei probdef(units. 6. Set problemtype to ’planar’ for a 2-D planar problem. ’millimeters’. 22 . The flag parameter controls whether the solver window is visible or minimized.

2 –block labels. 4. • ei purgemesh clears the mesh out of both the screen and memory. by – base point for rotation – shiftangle – angle in degrees by which the selected objects are rotated. 1 – lines (segments). 23 . by.dy – distance by which the selected objects are shifted. 2 –block labels. • ei moverotate2(bx. editaction) – bx. • ei moverotate(bx.y. 1 – lines (segments).dy – distance by which the selected objects are incrementally shifted. dy. • ei copytranslate2(dx. – copies – number of copies to be produced from the selected objects. 3 – arc segments. – copies – number of copies to be produced from the selected objects. 3 – arc segments.y)intoacurveofradiusr.group • ei copytranslate(dx. by – base point for rotation – angle – angle by which the selected objects are incrementally shifted to make each copy.by. angle is measured in degrees. 2 –block labels. editaction ) – bx. – copies – number of copies to be produced from the selected objects. – editaction 0 –nodes. 6. dy. angle. 4. copies. • ei copyrotate2(bx.dy – distance by which the selected objects are incrementally shifted. – editaction 0 –nodes. – copies – number of copies to be produced from the selected objects. 4. angle is measured in degrees. copies.shiftangle) – bx.shiftangle. – editaction 0 –nodes. editaction) – dx.dy) – dx. 3 – arc segments.group • ei movetranslate(dx.by.group • ei createradius(x. 1 – lines (segments). angle.r)turnsacornerlocatedat(x. copies ) – bx. by. by – base point for rotation – shiftangle – angle in degrees by which the selected objects are rotated. copies) – dx.6 Editing Commands • ei copyrotate(bx. by – base point for rotation – angle – angle by which the selected objects are incrementally shifted to make each copy.

y2).7 Zoom Commands • ei zoomnatural zooms to a “natural” view with sensible extents. 1 for lines (segments). 3 – arc segments.x2. • ei mirror2(x1.y2).editaction) – bx.y1. • ei movetranslate2(dx.by.y2. and 4 for groups. 3 – arc segments.block labels – ’group’ . • ei zoomin zoom in by a factor of 200%.y1) to the top right corner specified by (x2. 4.y2). by – base point for scaling – scalefactor – a multiplier that determines how much the selected objects are scaled – editaction 0 –nodes.y1) and (x2.line segments – ’arcsegments’ .dy – distance by which the selected objects are shifted. Valid editaction entries are 0 for nodes.editaction) – dx. 2 –block labels. 2 –block labels. • ei seteditmode(editmode) Sets the current editmode to: – ’nodes’ .group • ei scale(bx.arc segments – ’blocks’ .group • ei mirror(x1.x2.nodes – ’segments’ . 2 for block labels. • ei zoom(x1.by. – editaction 0 –nodes.scalefactor) – bx.y2) Set the display area to be from the bottom left corner specified by (x1. 1 – lines (segments).dy. • ei zoomout zooms out by a factor of 50%.editaction) mirror the selected objects about a line passing through the points (x1. 4. 3 for arc segments.y1.y2) mirror the selected objects about a line passing through the points (x1.scalefactor. by – base point for scaling – scalefactor – a multiplier that determines how much the selected objects are scaled • ei scale2(bx. 6.y1) and (x2. if they are used WITHOUT the editaction parameter.y1. 1 – lines (segments).selected group This command will affect all subsequent uses of the other editing commands. 24 .x2.

qp) adds a new point property of name ’pointname’ with either a specified potential Vp a point charge density qp in units of C/m. • ei hidegrid Hide the grid points points. qv) adds a new material with called ’matname’ with the material properties: ex Relative permittivity in the x. • ei gridsnap(’flag’) Setting flag to ”on” turns on snap to grid.’type’) Change the grid spacing. • ei maximize maximizes the active electrostatics input view. c0. 25 . • ei addboundprop(’boundname’.or z-direction. 6. set C1 and C0 as required and BdryFormat to 1. ex. qv Volume charge density in units of C/m3 • ei addpointprop(’pointname’. set qs to the desired charge density in C/m2 and set BdryFormat to 2. . • ei resize(width.Vp. • ei refreshview Redraws the current view. • ei restore restores the active electrostatics input view from a minimized or maximized state. set the Vs parameter to the desired voltage and all other parameters to zero. ey.8 View Commands • ei showgrid Show the grid points. To obtain a “Mixed” type boundary condition. To obtain a prescribes surface charge density. qs. and the type parameter is set to ’cart’ for Cartesian coordi- nates or ’polar’ for polar coordinates.6. The density parameter specifies the space between grid points. set BdryFormat to 3 and set all other parameters to zero. • ei setgrid(density.9 Object Properties • ei addmaterial(’matname’. setting flag to ’off’turns off snap to grid. For a “Periodic” boundary condition. • ei minimize minimizes the active electrostatics input view. c1. Set all other parameters to zero.height) resizes the active electrostatics input window client area to width × height. ey Relative permittivity in the y.or r-direction. BdryFormat) adds a new bound- ary property with name ’boundname’ For a “Fixed Voltage” type boundary condition. Vs.

The last number is the value to be applied to the specified property.value) This function allows for modifica- tion of a material’s properties without redefining the entire material (e. The next parameter is the number of the property to be set. The various properties that can be modified are listed below: propnum Symbol Description 0 BlockName Name of the material 1 ex x (or r) direction relative permittivity 2 ey y (or z) direction relative permittivity 3 qs Volume charge • ei modifyboundprop(’BdryName’. The various properties that can be modified are listed below: propnum Symbol Description 0 BdryName Name of boundary property 1 Vs Fixed Voltage 2 qs Prescribed charge density 3 c0 Mixed BC parameter 4 c1 Mixed BC parameter 5 BdryFormat Type of boundary condition: 0 = Prescribed V 1 = Mixed 2 = Surface charge density 3 = Periodic 4 = Antiperiodic • ei modifypointprop(’PointName’. • ei addconductorprop(’conductorname’.propnum. The material to be modified is specified by ’BlockName’. The BC to be modified is specified by ’BdryName’. so that current can be modified from run to run). • ei deleteboundprop(’boundname’) deletes the boundary property named ’boundname’. Vc. • ei deleteconductor(’conductorname’) deletes the conductor named conductorname. The conductortype parameter is 0 for prescribed charge and 1 for prescribed voltage.propnum.g. 26 .value) This function allows for modifica- tion of a point property. conductortype) adds a new con- ductor property with name ’conductorname’ with either a prescribed voltage or a pre- scribed total charge. The last number is the value to be applied to the specified property. • ei deletematerial(’materialname’) deletes the material named ’materialname’. Set the unused property to zero.propnum. The next parameter is the number of the property to be set. set BdryFormat to 4 set all other parameters to zero. qc. For an “Anti-Perodic” boundary condition. The point property to be modified is specified by ’PointName’.value) This function allows for modifica- tion of a boundary property. • ei deletepointprop(’pointname’) deletes the point property named ’pointname’ • ei modifymaterial(’BlockName’.

The various properties that can be modified are listed below: propnum Symbol Description 0 PointName Name of the point property 1 Vp Prescribed nodal voltage 2 qp Point charge density in C/m • ei modifyconductorprop(’ConductorName’. To display the names.Ri) defines an axisymmetric external region to be used in conjuction with the Kelvin Transformation method of modeling unbounded problems.Ro. the permeability varies as a function of distance from the origin of the external region. The conductor property to be modified is specified by ’ConductorName’. 1 = Prescribed voltage 6. The next parameter is the number of the property to be set. • ei close closes the preprocessor window and destroys the current document. • ei savedxf(’filename’) This function saves geometry information in a dxf file specified by ’filename’. • ei shownames(flag) This function allow the user to display or hide the block label names on screen. • ei readdxf(’filename’) This function imports a dxf file specified by ’filename’. flag should be 0.propnum. The last number is the value to be applied to the specified property. The various properties that can be modified are listed below: propnum Symbol Description 0 ConductorName Name of the conductor property 1 Vc Conductor voltage 2 qc Total conductor charge 3 ConductorType 0 = Prescribed charge. The Zo parameter is the z-location of the origin of the outer region. • ei refreshview Redraws the current view.10 Miscellaneous • ei savebitmap(’filename’) saves a bitmapped screenshot of the current view to the file specified by ’filename’. The next parameter is the number of the property to be set. the parameter should be set to 1. • ei savemetafile(’filename’) saves a metafile screenshot of the current view to the file specified by ’filename’. The last number is the value to be applied to the specified property. the Ro parameter is the radius of the outer region. • ei defineouterspace(Zo.e. the region of interest). In the exterior region. 27 . These parameters are necessary to define the permeability variation in the external region.value) This function allows for modification of a conductor property. To hide the block label names. and the Ri parameter is the radius of the inner region (i.

volume and torque.1 Data Extraction Commands • eo lineintegral(type) Calculates the line integral for the defined contour type Integral 0 E ·t 1 D·n 2 Contour length 3 Force from stress tensor 4 Torque from stress tensor This integral a single result for field intensity. D and E. contour length. and torque. the function returns an array with two elements is returned representing components in the x and y or r and z directions. an array with two elements is returned representing force in the x and y or r and z directions. 7. y). 7 Electrostatics Post Processor Command Set There are a number of scripting commands designed to operate in the postprocessor. For force. • ei attachouterspace marks all selected block labels as members of the external region used for modeling unbounded axisymmetric problems via the Kelvin Transformation. • eo getpointvalues(x. flux density.y) Gets the values associated with the point at (x. The function returns an array of results whose elements represent: 28 . • eo blockintegral(type) Calculates a block integral for the selected blocks type Integral 0 Stored Energy 1 Block Cross-section 2 Block Volume 3 Average D over the block 4 Average E over the block 5 Weighted Stress Tensor Force 6 Weighted Stress Tensor Torque This integral a single result for energy. As with the preprocessor commands. For force. • ei detachouterspace undefines all selected block labels as members of the external region used for modeling unbounded axisymmetric problems via the Kelvin Transformation. these commands can be used with either the underscore naming or with the no-underscore naming convention.

or r. If. rather than display it to make a graphical plot.y) Gets the voltage associated with the point at (x.direction component of permittivity ey y. Symbol Definition V Voltage Dx x.y) Gets the electric permittivity associated with the point at (x. the plot is instead written to disk to the specified file name as an extended metafile.y). n (Normal flux density) 3 D .y) Gets the electric field energy density associated with the point at (x.direction component of displacement Ex x.Filename. the command is interpreted as a request to plot the requested plot type to the screen.y) Gets the electric flux density associated with the point at (x.direction component of electric field intensity Ey y.direction component of displacement Dy y.NumPoints. in addi- tion. • eo getenergydensity(x. t (Tangential flux density) 4 |E| (Magnitude of field intensity) 5 E .or z. If only PlotType or only PlotType and NumPoints are specified.direction component of permittivity nrg electric field energy density • eo getv(x. the Filename parameter is specified. • eo makeplot(PlotType.or r. the command is in- stead interpreted as a command to write the data to disk to the specfied file name.y).y) Gets the electric field intensity associated with the point at (x. The return value is a list with two element representing εx and εy for planar problems and εr and εz for axisymmetric problems. If the FileFormat parameter is also.or z.y). n (Normal field intensity) 6 E .or z. Valid entries for PlotType are: PlotType Definition 0 V (Voltage) 1 |D| (Magnitude of flux density) 2 D . The return value is a list with two element representing Dx and Dy for planar problems and Dr and Dz for axisymmetric problems. • eo gete(x.direction component of electric field intensity ex x.y). t (Tangential field intensity) Valid file formats are: 29 . • eo getd(x. The return value is a list with two element representing Ex and Ey for planar problems and Er and Ez for axisymmetric problems.y).FileFormat) Allows Octave to access to the X-Y plot routines.or r. • eo getperm(x.

The anglestep param- eter must be greater than zero. • eo groupselectblock(n) Selects all of the blocks that are labeled by block labels that are members of group n.emf’) To write data instead of a plot to disk.e. or area mode. and arc segments that are part of the conductor specified by the string (’name’). eo groupselectblock). Returns three values: the Prob- lem type (0 for planar and 1 for axisymmetric). rather than regions (i. If there are less than two points defined in the contour. this command is ignored. The angle parameter can take on values from -180 to 180 degrees. where the conductors are points or surfaces. and the charge carried on the specified conductor. and the length unit used to draw the problem. If this is the first point then it starts a contour.200) If this plot were to be written to disk as a metafile. • eo addcontour(x. the depth assumed for planar problems in units of meters.’c:temp. all blocks are selected.y) Adds a contour point at (x.200. each of which is constrained to span no more than anglestep degrees. represented in meters. the command would be: eo makeplot(0. and ’area’.2 Selection Commands • eo seteditmode(mode) Sets the mode of the postprocessor to point. FileFormat Definition 0 Multi-column text with legend 1 Multi-column text with no legend 2 Mathematica-style formatting For example. This command is used to select con- ductors for the purposes of the “weighted stress tensor” force and torque integrals. • eo selectblock(x.e.anglestep) Replaces the straight line formed by the last two points in the contour by an arc that spans angle degrees.y). Two values are returned: The voltage of the specified con- ductor. • eo bendcontour(angle. 7. can’t be selected with eo selectblock). the command would be of the form: eo makeplot(0.y).txt’. Valid entries for mode are ’point’.200. if one wanted to plot V to the screen with 200 points evaluated to make the graph. If no number is specified (i.0) • eo getprobleminfo Returns info on problem description. contour. 30 .’c:temp. if there are existing points the contour runs from the previous point to this point.y) Select the block that contains point (x. • eo getconductorproperties(’conductor’) Properties are returned for the conductor property named ’conductor’. segments. • eo selectconductor(’name’) Selects all nodes. ’contour’. the command would be: eo makeplot(0. The arc is actually composed of many straight lines. The eo addcontour command has the same functionality as a right-button-click contour point addition when the program is running in interactive mode.

y2) Zoom to the window defined by lower left corner (x1.4 View Commands • eo showmesh Show the mesh. setting flag to ’off’ turns off snap to grid.’type’) Change the grid spacing.y). • eo hidedensityplot hides the flux density plot. • eo zoomin Zoom in one level. and the type parameter is set to ’cart’ for Cartesian coordi- nates or ’polar’ for polar coordinates. • eo showpoints Show the node points from the input geometry. 7. Setting flag equal to ’on’ turns on smoothing. eo gridsnap(’flag’) Setting flag to ”on” turns on snap to grid. a contour is added that traces along the arcsegment.x2.y1) and upper right corner (x2. • eo setgrid(density. • eo showgrid Show the grid points. • eo smooth(’flag’) This function controls whether or not smoothing is applied to the D and E fields which are naturally piece-wise constant over each element. and setting flag to ’off’ turns off smoothing.y2). If the se- lected point and a previous selected points lie at the ends of an arcsegment. The density parameter specifies the space between grid points.y) Adds a contour point at the closest input point to (x. • eo hidemesh Hide the mesh.y1. 31 . • eo zoom(x1. • eo selectpoint(x. • eo zoomout Zoom out one level. • eo hidegrid Hide the grid points points. • eo hidepoints Hide the node points from the input geometry.3 Zoom Commands • eo zoomnatural Zoom to the natural boundaries of the geometry. The selectpoint command has the same functionality as the left-button-click contour point selection when the program is running in interactive mode. • eo clearcontour Clear a prevously defined contour • eo clearblock Clear block selection 7.

gscale. • eo refreshview Redraws the current view. 1 for flux density D.lower V. • eo minimize minimizes the active electrostatics output view. • eo showdensityplot(legend. lower V Lower limit for contours. • eo maximize maximizes the active electrostatics output view. If the scale is set to 1.height) resizes the active electrostatics output window client area to width × height. upper D Sets the upper display limit for the density plot.upper V) shows the V contour plot with options: numcontours Number of equipotential lines to be plotted. • eo showcontourplot(numcontours. 1 plots the magnitude of D. upper V Upper limit for contours. • eo resize(width. gscale Set to 0 for a colour density plot or 1 for a grey scale density plot. • eo reload Reloads the solution from disk. The parameters taken are the type of plot. lower D Sets the lower display limit for the density plot.upper D. the length of the vectors are chosen so that the highest flux density corresponds to a vector that is the same length as the current grid size setting.5 Miscellaneous • eo close close the current postprocessor window. and 2 for field intensity E. The scalefactor determines the relative length of the vectors.lower D) Shows the flux density plot with options: legend Set to 0 to hide the plot legend or 1 to show the plot legend. A value of 0 plots voltage. • eo savebitmap(’filename’) saves a bitmapped screen shot of the current view to the file specified by ’filename’.type. and 2 plots the magnitude of E • eo hidecontourplot Hides the contour plot. 7. • eo showvectorplot(type. 32 . which should be set to 0 for no vector plot. • eo restore restores the active electrostatics output view from a minimized or maximized state. type Sets the type of density plot.scalefactor) controls the display of vectors denoting the field strength and direction.

angle. • eo savemetafile(’filename’) saves a metafile screenshot of the current view to the file specified by ’filename’. • hi deleteselected Delete all selected objects.y1. To display the names.y2) with angle ‘angle’ divided into ‘maxseg’ segments.y) or (r. • hi deleteselectednodes Delete selected nodes.x2.x2. • eo getelement(n) MOGetElement[n] returns the following proprerties for the nth element: 1.y1. x (or r) coordinate of the element centroid 5. group number associated with the element 8 Heat Flow Preprocessor Lua Command Set A number of different commands are available in the preprocessor. Index of second element node 3. • hi deleteselectedlabels Delete selected block labels.y2) Add a new line segment from node closest to (x1.y2. Two naming conventions can be used: one which separates words in the command names by underscores. and one that eliminates the underscores. the parameter should be set to 1. Index of first element node 2. • eo numnodes Returns the number of nodes in the in focus electrostatics output mesh. 33 .y1) to node closest to (x2.maxseg) Add a new arc segment from the nearest node to (x1.y1) to the nearest node to (x2.y • hi addsegment(x1. y (or z) coordinate of the element centroid 6. 8.z) position of the nth mesh node.y2) • hi addblocklabel(x. • eo shownames(flag) This function allow the user to display or hide the block label names on screen.y) Add a new node at x. flag should be 0. To hide the block label names. Index of third element node 4. element area using the length unit defined for the problem 7.y) • hi addarc(x1.y) Add a new block label at (x. • eo numelements Returns the number of elements in the in focus electrostatics output mesh. • eo getnode(n) Returns the (x.1 Object Add/Remove Commands • hi addnode(x.

• hi deleteselectedarcsegments Delete selects arcs.y). arc segments and block labels.y) Select the arc segment closest to (x. 1 = mesher automatically chooses the mesh density. segments and arc segments. automesh. blocks. segments. meshsize: size constraint on the mesh in the block marked by this label. • hi selectlabel(x. This function will clear all previously selected elements and leave the edit mode in 4 (group) 8. group) Set the selected block labels to have the properties: Block property "blockname". 1 == hidden in post processor A member of group number group 34 .2 Geometry Selection Commands • hi clearselected() Clear all selected nodes.groupno.y) Select the label closet to (x.y). automesh: 0 = mesher defers to mesh size constraint defined in meshsize. this parameter can be set to "<None>". Returns the coordinates of the se- lected label. elementsize. The "inconductor" string specifies which conductor the node belongs to.y) Select the line segment closest to (x. automesh. "inconductor") Set the select segments to have: Boundary property "propname" Local element size along segment no greater than elementsize automesh: 0 = mesher defers to the element constraint defined by elementsize.y) Select the node closest to (x. 1 = mesher automatically chooses mesh size along the selected segments hide: 0 = not hidden in post-processor. group. • hi setblockprop("blockname". "inconductor") Set the selected nodes to have the nodal property "propname" and group number groupno. 8. If the node doesn’t belong to a named con- ductor. • hi deleteselectedsegments Delete selected segments. • hi selectarcsegment(x. A member of group number group • hi setsegmentprop("propname". Returns the coordinates of the se- lected node. hide.y) • hi selectgroup(n) Select the nth group of nodes.3 Object Labeling Commands • hi setnodeprop("propname".y) • hi selectnode(x. • hi selectsegment(x. meshsize.

g. either specify no value for flag or specify 0. this parameter can be specified as "<None>". can also be specified for planar problems. and "micrometers".feh 8. • hi setgroup(n) Set the group associated of the selected items to n. entering 1. "inconductor") Set the selected arc segments to: Meshed with elements that span at most maxsegdeg degrees per element Boundary property "propname" hide: 0 = not hidden in post-processor.precision. If more than one heat flow input file is being edited at a time. 35 . representing the depth of the problem in the into-the- page direction for 2-D planar problems. Note that this is not a necessary precursor of performing an analysis. 1 == hidden in post processor A member of group number group A member of the conductor specified by the string "inconductor". this command can be used to switch between files so that the mutiple files can be operated upon program- matically via Lua.5 Mesh Commands • hi createmesh() runs triangle to create a mesh. • hi saveas("filename") saves the file with name "filename". hide. If the segment is not part of a conductor. A fourth parameter. For a minimized window.type. this parameter can be specified as "<None>". "millimeters". "centimeters". "mils".E-8 requires the RMS of the residual to be less than 10−8 . For example. A sixth parameter represents the minimum angle constraint sent to the mesh generator. c:\\temp\\myfile.(minangle)) changes the problem defi- nition. • hi loadsolution() loads and displays the solution corresponding to the current geometry. as hi analyze() will make sure the mesh is up to date before running an analysis. Set problemtype to "planar" for a 2-D planar problem. "meters. Valid "units" entries are "inches". • hi setfocus(‘‘documentname’’) Switches the heat flow input file upon which Lua com- mands are to act. or to "axi" for an axisymmetric problem. • hi setarcsegmentprop(maxsegdeg. A member of the conductor specified by the string "inconductor". The number of elements in the mesh is pushed back onto the lua stack. If the segment is not part of a conductor. • hi analyze(flag) runs hsolv to solve the problem. For a visible window. group. The flag parameter controls whether the hsolve window is visible or minimized. 8. flag should be set to 1. documentname should contain the name of the desired document as it appears on the window’s title bar. The precision parameter dictates the precision required by the solver.(depth). Note if you use a path you must use two backslashes e. The units parameter specifies the units used for measuring length in the problem domain. "propname".4 Problem Commands • hi probdef(units.

(editaction)) dx. 1 – lines (segments). copies – number of copies to be produced from the selected objects.6 Editing Commands • hi copyrotate(bx.group • hi mirror(x1. by – base point for rotation shiftangle – angle in degrees by which the selected objects are rotated.x2. 2 –block labels.(editaction)) mirror the selected objects about a line passing through the points (x1.dy.y1.y. copies. • hi showmesh() toggles the flag that shows or hides the mesh. 2 –block labels. editaction 0 –nodes.line segments 36 . (editaction) ) bx. 2 –block labels.dy – distance by which the selected objects are shifted.y)intoacurveofradiusr.(editaction)) bx. 3 for arc segments. editaction 0 –nodes. editaction 0 –nodes.y2).group • mi createradius(x. (editaction)) dx.y1) and (x2. 3 – arc segments. 2 –block labels.shiftangle (editaction)) bx. 4.r)turnsacornerlocatedat(x. 3 – arc segments.scalefactor.y2. 1 – lines (segments). angle is measured in degrees. 2 –block labels. 1 – lines (segments). 4.by. copies. 8. • hi seteditmode(editmode) Sets the current editmode to: "nodes" – nodes "segments" . Valid editaction entries are 0 for nodes. 1 – lines (segments).group • hi movetranslate(dx. by – base point for scaling scalefactor – a multiplier that determines how much the selected objects are scaled editaction 0 –nodes. copies – number of copies to be produced from the selected objects. 3 – arc segments. 1 for lines (segments). • hi purgemesh() clears the mesh out of both the screen and memory. 3 – arc segments. 4. by – base point for rotation angle – angle by which the selected objects are incrementally shifted to make each copy.group • hi scale(bx. 4. angle. 2 for block labels.dy – distance by which the selected objects are incrementally shifted.group • hi copytranslate(dx. dy. 4. editaction 0 –nodes. 1 – lines (segments). and 4 for groups. by. • hi moverotate(bx.by. 3 – arc segments.

• hi minimize() minimizes the active heat flow input view. • hi maximize() maximizes the active heat flow input view.7 Zoom Commands • hi zoomnatural() zooms to a “natural” view with sensible extents."type") Change the grid spacing.y1) to the top right corner specified by (x2. • hi gridsnap("flag") Setting flag to ”on” turns on snap to grid. • hi zoomout() zooms out by a factor of 50%.height) resizes the active heat flow input window client area to width × height.y2) Set the display area to be from the bottom left corner specified by (x1. • hi setgrid(density.block labels "group" .y1. and the type parameter is set to "cart" for Cartesian coordi- nates or "polar" for polar coordinates. • hi zoomin() zoom in by a factor of 200%. 37 . setting flag to ”off”turns off snap to grid.arc segments "blocks" .x2. The density parameter specifies the space between grid points.selected group This command will affect all subsequent uses of the other editing commands. if they are used WITHOUT the editaction parameter. 8. "arcsegments" . • hi restore() restores the active heat flow input view from a minimized or maximized state. • hi resize(width. 8. • hi refreshview() Redraws the current view.y2).8 View Commands • hi showgrid() Show the grid points. • hi hidegrid() Hide the grid points points. • hi zoom(x1.

• hi deleteboundprop("boundpropname") deletes the boundary property named "boundpropname". – To obtain a convection boundary condition.9 Object Properties • hi addmaterial("materialname". beta) adds a new boundary property with name "boundpropname".or z-direction. The material to be modified is specified by "BlockName". ky. Tinf. • hi addboundprop("boundpropname". Set the unused property to zero. qc. h. 38 .8. kt) adds a new material with called "materialname" with the material properties: kx Thermal conductivity in the x. so that current can be modified from run to run).g. • hi deletepointprop("pointpropname") deletes the point property named "pointpropname" • hi modifymaterial("BlockName". ky Thermal conductivity in the y. – For a Radiation boundary condition. set beta equal to the desired emissivity and Tinf to the desired external temperature and set BdryFormat to 3. qv Volume heat generation density in units of W/m3 kt Volumetric heat capacity in units of MJ/(m3*K) • hi addpointprop("pointpropname". set BdryFormat to 4 and set all other parameters to zero. – For a “Periodic” boundary condition. – To obtain a “Heat Flux” type boundary condition. • hi addconductorprop("conductorname". set qs to be the heat flux density and BdryFormat to 1. set BdryFormat to 5 set all other parameters to zero. qv. . BdryFormat. kx. – For an “Anti-Perodic” boundary condition. Tset. qs.value) This function allows for modifica- tion of a material’s properties without redefining the entire material (e. – For a “Fixed Temperature” type boundary condition. set h to the desired heat transfer coefficient and Tinf to the desired external temperature and set BdryFormat to 2. conductortype) adds a new con- ductor property with name "conductorname" with either a prescribed temperature or a pre- scribed total heat flux. The conductortype parameter is 0 for prescribed heat flux and 1 for prescribed temperature. • hi deleteconductor("conductorname") deletes the conductor named conductorname. Set all other parameters to zero. Tc.qp) adds a new point property of name "pointpropname" with either a specified temperature Tp or a point heat generation density qp in units of W/m.propnum.or r-direction. set the Tset parameter to the desired temperature and all other parameters to zero.Tp. • hi deletematerial("materialname") deletes the material named "materialname".

The next parameter is the number of the property to be set. The next parameter is the number of the property to be set. The various properties that can be modified are listed below: 39 . The various properties that can be modified are listed below: propnum Symbol Description 0 BlockName Name of the material 1 kx x (or r) direction thermal conductivity 2 ky y (or z) direction thermal conductivity 3 qs Volume heat generation 4 kt Volumetric heat capacity • hi modifyboundprop("BdryName". The various properties that can be modified are listed below: propnum Symbol Description 0 PointName Name of the point property 1 Tp Prescribed nodal temperature 2 qp Point heat generation in W/m • hi modifyconductorprop("ConductorName".propnum. The conductor property to be modified is specified by "ConductorName".propnum.propnum. The last number is the value to be applied to the specified property.value) This function allows for modification of a conductor property.value) This function allows for modifica- tion of a point property.value) This function allows for modifica- tion of a boundary property. The BC to be modified is specified by "BdryName". The last number is the value to be applied to the specified property. The last number is the value to be applied to the specified property. The various properties that can be modified are listed below: propnum Symbol Description 0 BdryName Name of boundary property 1 BdryFormat Type of boundary condition: 0 = Prescribed temperature 1 = Heat Flux 2 = Convection 3 = Radiation 4 = Periodic 5 = Antiperiodic 2 Tset Fixed Temperature 3 qs Prescribed heat flux density 4 Tinf External temperature 5 h Heat transfer coefficient 6 beta Emissivity • hi modifypointprop("PointName". The last number is the value to be applied to the specified property. The next parameter is the number of the property to be set. The point property to be modified is specified by "PointName". The next parameter is the number of the property to be set.

• hi detachouterspace() undefines all selected block labels as members of the external region used for modeling unbounded axisymmetric problems via the Kelvin Transformation. • hi attachouterspace() marks all selected block labels as members of the external region used for modeling unbounded axisymmetric problems via the Kelvin Transformation.Ri) defines an axisymmetric external region to be used in conjuction with the Kelvin Transformation method of modeling unbounded problems.10 Miscellaneous • hi savebitmap("filename") saves a bitmapped screenshot of the current view to the file specified by "filename". the region of interest).e. propnum Symbol Description 0 ConductorName Name of the conductor property 1 Tc Conductor temperature 2 qc Total conductor heat flux 3 ConductorType 0 = Prescribed heat flow.T. The Zo parameter is the z-location of the origin of the outer region. These parameters are necessary to define the permeability variation in the external region.k) adds the point (T. • hi defineouterspace(Zo. • hi savemetafile("filename") saves a metafile screenshot of the current view to the file specified by "filename". To display the names.k) to the thermal conductivity vs. temperature curve for the material specified by "materialname". flag should be 0. In the exterior region. 40 . • hi close() closes the preprocessor window and destroys the current document. subject to the printf-type formatting explained previously for the hi saveas command. 1 = Prescribed temperature • hi addtkpoint("materialname". • hi shownames(flag) This function allow the user to display or hide the block label names on screen. the Ro parameter is the radius of the outer region. To hide the block label names. subject to the printf-type formatting explained previously for the hi saveas command. • hi savedxf("filename") This function saves geometry information in a dxf file specified by "filename". and the Ri parameter is the radius of the inner region (i. 8. the permeability varies as a function of distance from the origin of the external region. the parameter should be set to 1. • hi refreshview() Redraws the current view. • hi readdxf("filename") This function imports a dxf file specified by "filename". • hi cleartkpoints("materialname") erases all of the thermal conductivity points that have been defined for the material named "materialname".Ro.

If.Gy.Filename.Fx.01.or z.direction component of thermal conductivity ky y. depending on the integral type.direction component of heat flux density Fy y. are: Symbol Definition V Temperature Fx x.direction component of heat flux density Gx x.direction component of thermal conductivity Example: To catch all values at (0. in order.direction component of temperature gradient Gy y. e.ky= ho getpointvalues(0.g. Gy = ho blockintegral(4) • ho getpointvalues(X.1 Data Extraction Commands • ho lineintegral(type) Calculate the line integral for the defined contour type Integral 0 Temperature difference (G · t) 1 Heat flux through the contour (F · n) 2 Contour length 3 Average Temperature This integral returns either 1 or 2 values.or z. If only PlotType or only PlotType and NumPoints are specified.FileFormat) Allows Lua access to the X-Y plot routines.0) • ho makeplot(PlotType.0) use T. As with the preprocessor commands.kx. these commands can be used with either the underscore naming or with the no-underscore naming convention.NumPoints.or r.Y) Get the values associated with the point at x.direction component of temperature gradient kx x. 41 . in addition. the com- mand is interpreted as a request to plot the requested plot type to the screen.Gx.01.: Gx. : Ftot.g.or r.or z.9 Heat Flow Post Processor Command Set There are a number of Lua scripting commands designed to operate in the postprocessor. e.Fy. Favg = ho lineintegral(2) • ho blockintegral(type) Calculate a block integral for the selected blocks type Integral 0 Average T over the block 1 Block Cross-section 2 Block Volume 3 Average F over the block 4 Average G over the block Returns one or two floating point values as results.y The return values.or r. 9.

txt". the depth assumed for planar problems in units of meters. the command is instead interpreted as a command to write the data to disk to the specfied file name. the plot is instead written to disk to the specified file name as an extended metafile. If the FileFormat parameter is also. Returns three values: the Problem type (0 for planar and 1 for axisymmetric).e.2 Selection Commands • ho seteditmode(mode) Sets the mode of the postprocessor to point. and the length unit used to draw the problem. Two values are returned: The temperature of the specified conductor. n (Normal field intensity) 6 E . 9. t (Tangential field intensity) Valid file formats are: FileFormat Definition 0 Multi-column text with legend 1 Multi-column text with no legend 2 Mathematica-style formatting For example. the command would be of the form: ho makeplot(0. Valid entries for mode are "point". • ho selectblock(x.emf") To write data instead of a plot to disk. the command would be: ho makeplot(0. • ho groupselectblock(n) Selects all of the blocks that are labeled by block labels that are members of group n.y) Select the block that contains point (x.200. rather than display it to make a graphical plot. the Filename parameter is specified."c:temp. the command would be: ho makeplot(0.200) If this plot were to be written to disk as a metafile. 42 .y).200. "contour". contour. n (Normal heat flux density) 3 D . If no number is specified (i. and "area". and the total heat flux through the specified conductor. represented in meters.0) • ho getprobleminfo() Returns info on problem description. or area mode. all blocks are selected. t (Tangential heat flux density) 4 |E| (Magnitude of field intensity) 5 E . • ho getconductorproperties("conductor") Properties are returned for the conductor property named ”conductor”."c:temp. if one wanted to plot V to the screen with 200 points evaluated to make the graph. Valid entries for PlotType are: PlotType Definition 0 V (Temperature) 1 |D| (Magnitude of heat flux density) 2 D . ho groupselectblock()).

• ho hidemesh() Hide the mesh. • ho showpoints() Show the node points from the input geometry. The arc is actually composed of many straight lines. If the se- lected point and a previous selected points lie at the ends of an arcsegment. 9.y2).4 View Commands • ho showmesh() Show the mesh.anglestep) Replaces the straight line formed by the last two points in the contour by an arc that spans angle degrees. If there are less than two points defined in the contour.y1) and upper right corner (x2. and arc segments that are part of the conductor specified by the string ("name"). The anglestep param- eter must be greater than zero. • ho selectconductor("name") Selects all nodes. where the conductors are points or surfaces. • ho zoom(x1. • ho zoomin() Zoom in one level. if there are existing points the contour runs from the previous point to this point.x2. • ho clearcontour() Clear a prevously defined contour • ho clearblock() Clear block selection 9. a contour is added that traces along the arcsegment.y) Adds a contour point at (x. rather than regions (i. 43 .e. • ho bendcontour(angle. • ho zoomout() Zoom out one level. • ho selectpoint(x. The ho addcontour command has the same functionality as a right-button-click contour point addition when the program is running in interactive mode.y) Adds a contour point at the closest input point to (x. this command is ignored. The selectpoint command has the same functionality as the left-button-click contour point selection when the program is running in interactive mode. can’t be selected with ho selectblock). If this is the first point then it starts a contour.y1.y). • ho hidepoints() Hide the node points from the input geometry. The angle parameter can take on values from -180 to 180 degrees.3 Zoom Commands • ho zoomnatural() Zoom to the natural boundaries of the geometry. segments. • ho addcontour(x.y2) Zoom to the window defined by lower left corner (x1.y). each of which is constrained to span no more than anglestep degrees. This command is used to select con- ductors for the purposes of the “weighted stress tensor” force and torque integrals.

and setting flag to "off" turns off smoothing.lower V.g. and 2 plots the magnitude of G • ho hidecontourplot() Hides the contour plot. which should be set to 0 for no vector plot. lower Sets the lower display limit for the density plot. upper Sets the upper display limit for the density plot. If the scale is set to 1. 1 for heat flux density F.type. The parameters taken are the type of plot.scalefactor) controls the display of vectors denoting the field strength and direction. gscale Set to 0 for a colour density plot or 1 for a grey scale density plot.upper."type") Change the grid spacing. and the type parameter is set to "cart" for Cartesian coordi- nates or "polar" for polar coordinates. • ho showgrid() Show the grid points. lower V Lower limit for contours.lower) Shows the heat flux density plot with options: legend Set to 0 to hide the plot legend or 1 to show the plot legend. Setting flag equal to "on" turns on smoothing. and 2 for temperature gradient G. • ho showdensityplot(legend. • ho minimize() minimizes the active heat flow input view.• ho smooth("flag") This function controls whether or not smoothing is applied to the F and G fields which are naturally piece-wise constant over each element. setting flag to ”off” turns off snap to grid. If ho numcontours is -1 all parameters are ignored and default values are used. e.upper V) shows the V contour plot with options: numcontours Number of equipotential lines to be plotted. • ho maximize() maximizes the active heat flow input view. • ho hidegrid() Hide the grid points points. A value of 0 plots temperature. upper V Upper limit for contours. type Sets the type of density plot. 44 . 1 plots the magnitude of F. The density parameter specifies the space between grid points. the length of the vectors are chosen so that the highest flux density corresponds to a vector that is the same length as the current grid size setting. The scalefactor determines the relative length of the vectors.gscale. • ho showcontourplot(numcontours. show contour plot(-1) • ho showvectorplot(type. • ho setgrid(density. ho gridsnap("flag") Setting flag to ”on” turns on snap to grid. • ho hidedensityplot() hides the heat flux density plot.

height) resizes the active heat flow input window client area to width × height. • ho resize(width.g. y (or z) coordinate of the element centroid 6. • ho reload() Reloads the solution from disk. • ho numelements Returns the number of elements in the in focus heat flow output mesh. • ho refreshview() Redraws the current view. subject to the printf-type formatting explained previously for the savebitmap command. x (or r) coordinate of the element centroid 5.bmp"). Note that if you use a path you must use two backslashes (e.y) or (r. "c:\\temp\\myfile.bmp\"") • ho savemetafile("filename") saves a metafile screenshot of the current view to the file specified by "filename". Index of third element node 4. 9.z) position of the nth mesh node. Index of first element node 2. To hide the block label names. • ho restore() restores the active heat flow input view from a minimized or maximized state. • ho numnodes Returns the number of nodes in the in focus heat flow output mesh. Index of second element node 3.5 Miscellaneous • ho close() close the current postprocessor window. the parameter should be set to 1. element area using the length unit defined for the problem 7. • ho savebitmap("filename") saves a bitmapped screen shot of the current view to the file specified by "filename". file names like c:\program files\stuff) you must enclose the file name in (extra) quotes by using a \" se- quence.g. To display the names. • ho shownames(flag) This function allow the user to display or hide the block label names on screen. • ho getelement(n) MOGetElement[n] returns the following proprerties for the nth element: 1. flag should be 0. • ho getnode(n) Returns the (x. group number associated with the element 45 . For example: ho savebitmap("\"c:\\temp\\screenshot. If the file name contains a space (e.

y) • ci selectgroup(n) Select the nth group of nodes. • ci deleteselectedarcsegments Delete selects arcs.y) Add a new block label at (x. segments. blocks. 10.2 Geometry Selection Commands • ci clearselected() Clear all selected nodes.y • ci addsegment(x1. • ci selectarcsegment(x.y2) • ci addblocklabel(x.x2.angle.y) Select the node closest to (x. Returns the coordinates of the se- lected label.y) • ci addarc(x1. • ci selectsegment(x. This function will clear all previously selected elements and leave the edit mode in 4 (group) 46 .y1) to node closest to (x2.maxseg) Add a new arc segment from the nearest node to (x1. Two naming conventions can be used: one which separates words in the command names by underscores. Returns the coordinates of the se- lected node. • ci deleteselectednodes Delete selected nodes. and one that eliminates the underscores. • ci deleteselected Delete all selected objects.1 Object Add/Remove Commands • ci addnode(x.y1. • ci deleteselectedlabels Delete selected block labels. • ci selectlabel(x.y1) to the nearest node to (x2.y). • ci deleteselectedsegments Delete selected segments.y2) Add a new line segment from node closest to (x1.x2.y) • ci selectnode(x.y) Select the line segment closest to (x.y2) with angle ‘angle’ divided into ‘maxseg’ segments.10 Current Flow Preprocessor Lua Command Set A number of different commands are available in the preprocessor.y) Add a new node at x. 10.y) Select the label closet to (x. arc segments and block labels.y). segments and arc segments.y1.y2.y) Select the arc segment closest to (x.

A member of group number group • ci setsegmentprop("propname". If the node doesn’t belong to a named con- ductor. The "inconductor" string specifies which conductor the node belongs to. group.3 Object Labeling Commands • ci setnodeprop("propname". meshsize. automesh: 0 = mesher defers to mesh size constraint defined in meshsize. this parameter can be specified as "<None>". • ci setarcsegmentprop(maxsegdeg. 47 . hide. meshsize: size constraint on the mesh in the block marked by this label. hide.) Set the select segments to have: Boundary property "propname" Local element size along segment no greater than elementsize automesh: 0 = mesher defers to the element constraint defined by elementsize. "propname". automesh. 1 = mesher automatically chooses the mesh density.10. • ci setgroup(n) Set the group associated of the selected items to n. • ci setblockprop("blockname". If the segment is not part of a conductor. If the segment is not part of a conductor. group) Set the selected block labels to have the properties: Block property "blockname". this parameter can be specified as "<None>". "inconductor") Set the selected arc segments to: Meshed with elements that span at most maxsegdeg degrees per element Boundary property "propname" hide: 0 = not hidden in post-processor. 1 == hidden in post processor A member of group number group A member of the conductor specified by the string "inconductor". elementsize. 1 = mesher automatically chooses mesh size along the selected segments hide: 0 = not hidden in post-processor. 1 == hidden in post processor A member of group number group A member of the conductor specified by the string "inconductor". this parameter can be set to "<None>". "inconductor".groupno. automesh. "inconductor") Set the selected nodes to have the nodal property "propname" and group number groupno. group.

precision. as ci analyze() will make sure the mesh is up to date before running an analysis. Note that this is not a necessary precursor of performing an analysis.(minangle)) changes the prob- lem definition. flag should be set to 1. The flag parameter controls whether the Belasolve window is visible or minimized. by. 48 . copies – number of copies to be produced from the selected objects. For a visible window.6 Editing Commands • ci copyrotate(bx. Valid "units" entries are "inches".fee 10.10. A sixth parameter represents the minimum angle constraint sent to the mesh generator. angle. "centimeters". • ci analyze(flag) runs belasolv to solve the problem. "mils". entering 1.type. copies. documentname should contain the name of the desired document as it appears on the window’s title bar.(depth). For example. by – base point for rotation angle – angle by which the selected objects are incrementally shifted to make each copy. either specify no value for flag or specify 0. • ci showmesh() toggles the flag that shows or hides the mesh. this command can be used to switch between files so that the mutiple files can be operated upon programmatically via Lua. "meters. The units parameter specifies the units used for measuring length in the problem domain. If more than one electrostatics input file is being edited at a time.g. The number of elements in the mesh is pushed back onto the lua stack.4 Problem Commands • ci probdef(units. • ci saveas("filename") saves the file with name "filename". angle is measured in degrees. • ci purgemesh() clears the mesh out of both the screen and memory.E-8 requires the RMS of the residual to be less than 10−8 . (editaction) ) bx. representing the depth of the problem in the into-the-page direction for 2-D planar problems.5 Mesh Commands • ci createmesh() runs triangle to create a mesh. • ci loadsolution() loads and displays the solution corresponding to the current geometry. For a minimized window. Note if you use a path you must use two backslashes e. c:\\temp\\myfemmfile. 10. and "micrometers". can also be specified for pla- nar problems. A fourth parameter. Set problemtype to "planar" for a 2-D planar problem.frequency. "millimeters". The frequency parameter specifies the frequency in Hz at which the analysis ois to be performed. The precision parame- ter dictates the precision required by the solver. or to "axi" for an axisymmetric problem. • ci setfocus("documentname") Switches the electrostatics input file upon which Lua com- mands are to act.

3 – arc segments. 1 for lines (segments).y2. if they are used WITHOUT the editaction parameter.group • ci copytranslate(dx.by.arc segments "blocks" .group • ci mirror(x1. 3 – arc segments.scalefactor. 2 –block labels. 4.(editaction)) dx. 2 for block labels. editaction 0 –nodes. by – base point for rotation shiftangle – angle in degrees by which the selected objects are rotated.shiftangle (editaction)) bx.y2).dy – distance by which the selected objects are incrementally shifted. and 4 for groups. 1 – lines (segments). 1 – lines (segments). • ci moverotate(bx. 4.x2. 3 for arc segments.y1.dy – distance by which the selected objects are shifted. 4.(editaction)) mirror the selected objects about a line passing through the points (x1. 1 – lines (segments). 3 – arc segments.dy.r)turnsacornerlocatedat(x. 3 – arc segments. Valid editaction entries are 0 for nodes.line segments "arcsegments" . copies. copies – number of copies to be produced from the selected objects.group • ci scale(bx. 2 –block labels. 2 –block labels.(editaction)) bx. • ci seteditmode(editmode) Sets the current editmode to: "nodes" – nodes "segments" .group • ci movetranslate(dx. dy.group • mi createradius(x.block labels "group" .selected group This command will affect all subsequent uses of the other editing commands. 4.y)intoacurveofradiusr. (editaction)) dx. 1 – lines (segments). 4. 1 – lines (segments). by – base point for scaling scalefactor – a multiplier that determines how much the selected objects are scaled editaction 0 –nodes. editaction 0 –nodes. 2 –block labels. editaction 0 –nodes. 49 . 2 –block labels.y.y1) and (x2.by. 3 – arc segments. editaction 0 –nodes.

10.or r-direction. ey. The density parameter specifies the space between grid points. and the type parameter is set to "cart" for Cartesian coordi- nates or "polar" for polar coordinates.or z-direction. ltx Dielectric loss tangent in the x. setting flag to ”off”turns off snap to grid.y1."type") Change the grid spacing.y2) Set the display area to be from the bottom left corner specified by (x1.or z-direction in units of S/m. • ci maximize() maximizes the active magnetics input view. lty Dielectric loss tangent in the y. • ci zoomin() zoom in by a factor of 200%. oy Electrical conductivity in the y.or z-direction.height) resizes the active magnetics input window client area to width × height. ox. • ci restore() restores the active magnetics input view from a minimized or maximized state. ex Relative permittivity in the x. ltx.y2).8 View Commands • ci showgrid() Show the grid points. • ci gridsnap("flag") Setting flag to ”on” turns on snap to grid. • ci zoomout() zooms out by a factor of 50%.7 Zoom Commands • ci zoomnatural() zooms to a “natural” view with sensible extents.or r-direction.10.y1) to the top right corner specified by (x2. • ci minimize() minimizes the active magnetics input view. 10. • ci setgrid(density. lty) adds a new material with called "materialname" with the material properties: ox Electrical conductivity in the x.x2. ex.9 Object Properties • ci addmaterial("materialname". • ci zoom(x1. • ci resize(width. • ci refreshview() Redraws the current view. oy.or r-direction in units of S/m. ey Relative permittivity in the y. 50 . • ci hidegrid() Hide the grid points points.

so that current can be modified from run to run).value) This function allows for modifica- tion of a material’s properties without redefining the entire material (e. c0. • ci deletematerial("materialname") deletes the material named "materialname". The conductortype parameter is 0 for prescribed current and 1 for prescribed voltage. The next parameter is the number of the property to be set.jp) adds a new point property of name "pointpropname" with either a specified potential Vp a point current density jp in units of A/m. • ci deleteconductor("conductorname") deletes the conductor named conductorname. set BdryFormat to 3 and set all other parameters to zero. The last number is the value to be applied to the specified property. set C1 and C0 as required and BdryFormat to 1. js. • ci deleteboundprop("boundpropname") deletes the boundary property named "boundpropname". Vc. conductortype) adds a new con- ductor property with name "conductorname" with either a prescribed voltage or a pre- scribed total current. To obtain a prescribes surface current density. • ci addconductorprop("conductorname".g.Vp. The material to be modified is specified by "BlockName". jc. For an “Anti-Perodic” boundary condition. set BdryFormat to 4 set all other parameters to zero. • ci addboundprop("boundpropname". For a “Periodic” boundary condition.• ci addpointprop("pointpropname". set the Vs parameter to the desired voltage and all other parameters to zero. BdryFormat) adds a new bound- ary property with name "boundpropname" For a “Fixed Voltage” type boundary condition. The various properties that can be modified are listed below: propnum Symbol Description 0 BlockName Name of the material 1 ox x (or r) direction conductivity 2 oy y (or z) direction conductivity 3 ex x (or r) direction relative permittivity 4 ey y (or z) direction relative permittivity 5 ltx x (or r) direction dielectric loss tangent 6 lty y (or z) direction dielectric loss tangent 51 . To obtain a “Mixed” type boundary condition. set js to the desired current density in A/m2 and set BdryFormat to 2. • ci deletepointprop("pointpropname") deletes the point property named "pointpropname" • ci modifymaterial("BlockName". Set all other parameters to zero. c1. Set the unused property to zero.propnum. Vs.

The point property to be modified is specified by "PointName".propnum. The conductor property to be modified is specified by "ConductorName". • ci modifyboundprop("BdryName". 1 = Prescribed voltage 10. The last number is the value to be applied to the specified property.value) This function allows for modification of a conductor property.value) This function allows for modifica- tion of a point property. • ci savemetafile("filename") saves a metafile screenshot of the current view to the file 52 . The various properties that can be modified are listed below: propnum Symbol Description 0 PointName Name of the point property 1 Vp Prescribed nodal voltage 2 jp Point current density in A/m • ci modifyconductorprop("ConductorName". The next parameter is the number of the property to be set. The next parameter is the number of the property to be set. subject to the printf-type formatting explained previously for the ci saveas command. The last number is the value to be applied to the specified property. The next parameter is the number of the property to be set. The last number is the value to be applied to the specified property.propnum.10 Miscellaneous • ci savebitmap("filename") saves a bitmapped screenshot of the current view to the file specified by "filename". The various properties that can be modified are listed below: propnum Symbol Description 0 BdryName Name of boundary property 1 Vs Fixed Voltage 2 js Prescribed current density 3 c0 Mixed BC parameter 4 c1 Mixed BC parameter 5 BdryFormat Type of boundary condition: 0 = Prescribed V 1 = Mixed 2 = Surface current density 3 = Periodic 4 = Antiperiodic • ci modifypointprop("PointName". The BC to be modified is specified by "BdryName". The various properties that can be modified are listed below: propnum Symbol Description 0 ConductorName Name of the conductor property 1 Vc Conductor voltage 2 jc Total conductor current 3 ConductorType 0 = Prescribed current.propnum.value) This function allows for modifica- tion of a boundary property.

As with the preprocessor commands. these commands can be used with either the underscore naming or with the no-underscore naming convention. subject to the printf-type formatting explained previously for the ci saveas command. The Zo parameter is the z-location of the origin of the outer region. the parameter should be set to 1. • ci attachouterspace() marks all selected block labels as members of the external region used for modeling unbounded axisymmetric problems via the Kelvin Transformation. • ci close() closes the preprocessor window and destroys the current document. These parameters are necessary to define the permeability variation in the external region. • ci defineouterspace(Zo. • ci savedxf("filename") This function saves geometry information in a dxf file specified by "filename". and the Ri parameter is the radius of the inner region (i. • ci readdxf("filename") This function imports a dxf file specified by "filename". • ci refreshview() Redraws the current view.Ro. flag should be 0. 11. the permeability varies as a function of distance from the origin of the external region. • ci detachouterspace() undefines all selected block labels as members of the external region used for modeling unbounded axisymmetric problems via the Kelvin Transformation.Ri) defines an axisymmetric external region to be used in conjuction with the Kelvin Transformation method of modeling unbounded problems. the Ro parameter is the radius of the outer region. To hide the block label names. To display the names.1 Data Extraction Commands • co lineintegral(type) Calculate the line integral for the defined contour type Integral 0 E ·t 1 J·n 2 Contour length 3 Average voltage over contour 4 Force from stress tensor 5 Torque from stress tensor 53 . In the exterior region. 11 Current Flow Post Processor Command Set There are a number of Lua scripting commands designed to operate in the postprocessor. • ci shownames(flag) This function allow the user to display or hide the block label names on screen.e. specified by "filename". the region of interest).

or r. • co getpointvalues(X.direction component of current density Jy y.direction component of displacement current density Jdy y. DC component 7 y (or z) direction Weighted Stress Tensor force.direction component of AC conductivity Ex x.y The return values.or r. in order.or z.or z. the com- mand is interpreted as a request to plot the requested plot type to the screen. If. depending on the integral type.or z.or r. e. 2x frequency component Returns a value that can be complex. in addition. Valid entries for PlotType are: 54 .direction component of AC conductivity Ky y.direction component of conduction current density • co makeplot(PlotType.direction component of permittivity ey y.or z. 2x frequency component 9 y (or z) direction Weighted Stress Tensor force. the Filename parameter is specified.direction component of permittivity oy y. If the FileFormat parameter is also.or r.or z.or r. 2x frequency component 10 Weighted Stress Tensor torque. the plot is instead written to disk to the specified file name as an extended metafile. This integral returns either 1 or 2 values.direction component of permittivity Jcx x.direction component of permittivity Jdx x.Y) Get the values associated with the point at x. rather than display it to make a graphical plot.or r. Fy = co lineintegral(4) • co blockintegral(type) Calculate a block integral for the selected blocks type Integral 0 Real Power 1 Reactive Power 2 Apparent Power 3 Time-Average Stored Energy 4 Block cross-section area 5 Block volume 6 x (or r) direction Weighted Stress Tensor force. DC component 11 Weighted Stress Tensor torque.direction component of current density Kx x.or z. the command is instead interpreted as a command to write the data to disk to the specfied file name.NumPoints.direction component of conduction current density Jcy y.or r. as necessary. If only PlotType or only PlotType and NumPoints are specified. are: Symbol Definition V Voltage Jx x.direction component of electric field intensity Ey y.direction component of displacement current density ox x. : Fx. DC component 8 x (or r) direction Weighted Stress Tensor force.FileFormat) Allows Lua access to the X-Y plot routines.Filename.g.or z.direction component of electric field intensity ex x.

Two values are returned: The voltage of the specified con- ductor. PlotType Definition 0 V (Voltage) 1 |J| (Magnitude of current density) 2 J . the command would be: co makeplot(0. and "area". or area mode. n (Normal conduction current density) 9 Jc .0) • co getprobleminfo() Returns info on problem description. t (Tangential displacement current density) Valid file formats are: FileFormat Definition 0 Multi-column text with legend 1 Multi-column text with no legend 2 Mathematica-style formatting For example. and the current on the specified conductor.200.200. t (Tangential conduction current density) 10 |Jd| (Magnitude of displacement current density) 11 Jd .200) If this plot were to be written to disk as a metafile. if one wanted to plot V to the screen with 200 points evaluated to make the graph. 11. t (Tangential current density) 4 |E| (Magnitude of field intensity) 5 E . n (Normal current density) 3 J . 55 . t (Tangential field intensity) 7 |Jc| (Magnitude of conduction current density) 8 Jc . n (Normal field intensity) 6 E . the command would be: co makeplot(0. Valid entries for mode are "point". Returns four values: Return value Definition 1 problem type 2 frequency in Hz 3 depth assumed for planar problems in meters 4 length unit used to draw the problem.txt". represented in meters."c:temp. the command would be of the form: co makeplot(0."c:temp.emf") To write data instead of a plot to disk. n (Normal displacement current density) 12 Jd . contour. "contour".2 Selection Commands • co seteditmode(mode) Sets the mode of the postprocessor to point. • co getconductorproperties("conductor") Properties are returned for the conductor property named ”conductor”.

• co selectblock(x. The co addcontour command has the same functionality as a right-button-click contour point addition when the program is running in interactive mode. and arc segments that are part of the conductor specified by the string ("name").y).y) Select the block that contains point (x. If this is the first point then it starts a contour.y2) Zoom to the window defined by lower left corner (x1.e.y) Adds a contour point at the closest input point to (x. • co selectconductor("name") Selects all nodes. this command is ignored. if there are existing points the contour runs from the previous point to this point. The selectpoint command has the same functionality as the left-button-click contour point selection when the program is running in interactive mode. • co addcontour(x. 11. The arc is actually composed of many straight lines. • co clearcontour() Clear a prevously defined contour • co clearblock() Clear block selection 11. a contour is added that traces along the arcsegment. • co zoomin() Zoom in one level. all blocks are selected. • co zoom(x1. where the conductors are points or surfaces. If the se- lected point and a previous selected points lie at the ends of an arcsegment. • co groupselectblock(n) Selects all of the blocks that are labeled by block labels that are members of group n. If no number is specified (i. co groupselectblock()).y) Adds a contour point at (x.y1. 56 .y2).3 Zoom Commands • co zoomnatural() Zoom to the natural boundaries of the geometry. rather than regions (i.anglestep) Replaces the straight line formed by the last two points in the contour by an arc that spans angle degrees.x2. The angle parameter can take on values from -180 to 180 degrees. The anglestep param- eter must be greater than zero. • co bendcontour(angle. • co hidemesh() Hide the mesh. can’t be selected with co selectblock).y1) and upper right corner (x2.y). each of which is constrained to span no more than anglestep degrees. If there are less than two points defined in the contour.e.y). • co zoomout() Zoom out one level.4 View Commands • co showmesh() Show the mesh. This command is used to select con- ductors for the purposes of the “weighted stress tensor” force and torque integrals. segments. • co selectpoint(x.

gscale Set to 0 for a colour density plot or 1 for a grey scale density plot. setting flag to ”off” turns off snap to grid.lower V. upper V Upper limit for contours.• co showpoints() Show the node points from the input geometry. • co showcontourplot(numcontours. lower Sets the lower display limit for the density plot. • co hidegrid() Hide the grid points points.gscale. 57 . upper Sets the upper display limit for the density plot. • co showdensityplot(legend. type Sets the type of density plot.upper. and the type parameter is set to "cart" for Cartesian coordi- nates or "polar" for polar coordinates. • co setgrid(density.upper V). • co showgrid() Show the grid points.type shows the V contour plot with options: numcontours Number of equipotential lines to be plotted.type. • co smooth("flag") This function controls whether or not smoothing is applied to the D and E fields which are naturally piece-wise constant over each element. Setting flag equal to "on" turns on smoothing. • co hidedensityplot() hides the current density plot. Specific choices for the type of density plot include: type Description 0 |V | 1 |Re(V )| 2 |Im(V )| 3 |J| 4 |Re(J)| 5 |Im(J)| 6 |E| 7 |Re(E)| 8 |Im(E)| • co hidecontourplot() Hides the contour plot.lower) Shows the current density plot with options: legend Set to 0 to hide the plot legend or 1 to show the plot legend. The density parameter specifies the space between grid points. co gridsnap("flag") Setting flag to ”on” turns on snap to grid."type") Change the grid spacing. and setting flag to "off" turns off smoothing. • co hidepoints() Hide the node points from the input geometry.

5 Miscellaneous • co close() close the current postprocessor window. If co numcontours is -1 all parameters are ignored and default values are used. type the type of contour plot to be rendered. 11.bmp\"") 58 . or "both". If the file name contains a space (e.scalefactor) controls the display of vectors denoting the field strength and direction. the imaginary part of voltage.g. For example: co savebitmap("\"c:\\temp\\screenshot. lower V Lower limit for contours. show contour plot(-1) The type can take on the values of "real".bmp"). • co savebitmap("filename") saves a bitmapped screen shot of the current view to the file specified by "filename". • co maximize() maximizes the active magnetics input view. or both components of voltage. e. the length of the vectors are chosen so that the highest field magnitude corresponds to a vector that is the same length as the current grid size setting. The type parameter can take on the following values: type Description 0 No vector plot 1 Re(J) 2 Re(E) The scalefactor determines the relative length of the vectors. • co resize(width. "imag". denoting the real part of voltage. • co showvectorplot(type. • co minimize() minimizes the active magnetics input view. "c:\\temp\\myfile.g. 3 Im(J) 4 Im(E) 5 Re(J) and Im(J) 6 Re(E) and Im(E) If the scale is set to 1.height) resizes the active magnetics input window client area to width × height. Note that if you use a path you must use two backslashes (e. file names like c:\program files\stuff) you must enclose the file name in (extra) quotes by using a \" se- quence.g. • co restore() restores the active magnetics input view from a minimized or maximized state. • co refreshview() Redraws the current view. • co reload() Reloads the solution from disk.

• co getnode(n) Returns the (x. element area using the length unit defined for the problem 7. To display the names. To hide the block label names. • co numelements Returns the number of elements in the in focus current flow output mesh. y (or z) coordinate of the element centroid 6. Index of first element node 2. x (or r) coordinate of the element centroid 5.z) position of the nth mesh node. group number associated with the element 59 . • co getelement(n) MOGetElement[n] returns the following proprerties for the nth element: 1. subject to the printf-type formatting explained previously for the savebitmap command. the parameter should be set to 1. • co numnodes Returns the number of nodes in the in focus current flow output mesh.y) or (r. • co shownames(flag) This function allow the user to display or hide the block label names on screen. Index of third element node 4.• co savemetafile("filename") saves a metafile screenshot of the current view to the file specified by "filename". Index of second element node 3. flag should be 0.