Finite Element Method Magnetics: OctaveFEMM

Version 1.2 User’s Manual
October 2, 2006

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

1 Introduction
OctaveFEMM is a Matlab toolbox that allows for the operation of Finite Element Method Magnetics (FEMM) via a set of Matlab functions. The toolbox works with Octave, a Matlab clone. Since Octave does not support ActiveX, the toolbox use an alternative interprocess communication scheme based on temporary files for passing messages between Octave and FEMM. This toolbox can also run in Matlab using Matlab’s built-in support of ActiveX. The use and functionality of the toolbox is essentially identical under either Matlab or Octave. The only difference is speed– Matlab’s ActiveX interface is noticeably faster than the file-based interprocess communications method used when running with Matlab. 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). • Several commands have also been added to OctaveFEMM that have no analog in Lua. These 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 performed, 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 separately. 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
The OctaveFEMM distribution is automatically installed with FEMM 4.2 in the mfiles subdirectory. The absolute directory is typically c:\Program Files\femm42\mfiles. To use OctaveFEMM with Matlab, c:\Program Files\femm42\mfiles must be added to the Matlab search path. This can be accomplished via Matlab’s interactive pathtool command. For use with Octave, you need to add the OctaveFEMM Toolbox to Octave’s search path. This can be done permanently by either adding to or creating the .octaverc file that octave runs when it starts up. For example, in the Octave 2.1.50 release, Octave looks for .octaverc in the directory: 2

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: LOADPATH = [ ’/cygdrive/c/progra˜1/femm42/mfiles//’, LOADPATH ]; to add the directory containing the OctaveFEMM commands to the Octave search path. Next, you need to may need to edit the command used to invoke FEMM, especially if you have installed FEMM in a directory that is not the default one. Edit c:\Program Files\femm42\mfiles\openfemm.m to make sure that OctaveFEMM is pointing to the right FEMM executable. The temporary files defined in this directory should also be located in the same directory as the FEMM executable, so you may need to edit those definitions as well. 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 problem 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 preprocessor 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. • 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. 3

• 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.

4.1 Object Add/Remove Commands
• mi addnode(x,y) Add a new node at x,y • mi addsegment(x1,y1,x2,y2) Add a new line segment from node closest to (x1,y1) to node closest to (x2,y2) • mi addblocklabel(x,y) Add a new block label at (x,y) • 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. • mi drawarc(x1,y1,x2,y2,angle,maxseg) Adds nodes at (x1,y1) and (x2,y2) and adds an arc of the specified angle and discretization connecting the nodes. • 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. 4

• 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 selected node. • mi selectlabel(x,y) Select the label closet to (x,y). Returns the coordinates of the selected 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. • mi setsegmentprop(’propname’, elementsize, automesh, hide, group) Set the selected 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, 1 = mesher automatically chooses mesh size along the selected segments 5

Set the parameter problemtype to ’planar’ for a 2-D planar problem.depth. flag should be set to 1. If more than one magnetics input file is being edited at a time. representing the depth of the problem in the into-the-page direction for 2-D planar problems. ’centimeters’. ’meters’. hide. The units parameter specifies the units used for measuring length in the problem domain. The number of elements in the mesh is pushed back onto the lua stack. ’millimeters’. and ’micrometers’. Set freq to the desired frequency in Hertz. ’propname’.– hide: 0 = not hidden in post-processor. The sixth parameter represents the minimum angle constraint sent to the mesh generator – 30 degrees is the usual choice for this parameter. • mi saveas(’filename’) saves the file with name ’filename’. Specify the depth to be zero for axisymmetric problems. • mi loadsolution loads and displays the solution corresponding to the current geometry. either specify no value for flag or specify 0. 4. For example.4 Problem Commands • mi probdef(freq. The precision parameter dictates the precision required by the solver. entering 1E-8 requires the RMS of the residual to be less than 10−8 . 1 == hidden in post processor – A member of group number group • mi setarcsegmentprop(maxsegdeg.5 Mesh Commands • mi createmesh runs triangle to create a mesh. ’documentname’ should contain the name of the desired document as it appears on the window’s title bar. 1 == hidden in post processor – A member of group number group 4. A fifth parameter. For a visible window. this command can be used to switch between files so that the mutiple files can be operated upon programmatically. as mi analyze will make sure the mesh is up to date before running an analysis. • mi showmesh shows the mesh. • mi analyze(flag) runs the magnetics solver. The flag parameter controls whether the solver window is visible or minimized. 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.type.precision. For a minimized window. Note that this is not a necessary precursor of performing an analysis. 6 . Valid ’units’ entries are ’inches’. ’mils’. or to ’axi’ for an axisymmetric problem. • mi setfocus(’documentname’) Switches the magnetics input file upon which commands are to act.minangle) changes the problem definition.units.

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

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

lam fill. • mi resize(width. H c. nstr. J. Phi hx. – Cduct Electrical conductivity of the material in MS/m. by default. – mu y Relative permeability in the y. • mi_hidegrid Hide the grid points points. used for nonlinear BH curves. – H c Permanent magnet coercivity in Amps/Meter. – 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. setting flag to ’off’ turns off snap to grid. LamType. mu x. • mi_grid_snap(’flag’) Setting flag to ’on’ turns on snap to grid. and the type parameter is set to ’cart’ for cartesian coordinates or ’polar’ for polar coordinates. dwire) adds a new material with called ’matname’ with the material properties: – mu x Relative permeability in the x.’type’) Change the grid spacing.4.8 View Commands • mi_showgrid Show the grid points. – Lam d Lamination thickness in millimeters. • mi minimize minimizes the active magnetics input view.9 Object Properties • mi addmaterial(’matname’. • mi restore restores the active magnetics input view from a minimized or maximized state.height) resizes the active magnetics input window client area to width × height. Lam d. – Phi hmax Hysteresis lag angle in degrees. The density parameter specifies the space between grid points. 4. Cduct.or z-direction. • mi_setgrid(density. mu y. – J Applied source current density in Amps/mm2. 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 9 . Phi hmax. Phi hy. • mi refreshview Redraws the current view.or r-direction. • mi maximize maximizes the active magnetics input view.

A2 and Phi parameters as required. Set all other parameters to zero. 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. • mi addcircprop(’circuitname’. Should be 1 for Magnet or Square wire. 10 . Sig. Note that not all properties need be defined – properties that aren’t defined are assigned default values. – For an “Anti-Perodic” boundary condition. Phi. set C1 and C0 as required and BdryFormat to 2. Set BdryFormat to 1 and all other parameters to zero. BdryFormat) adds a new boundary property with name ’propname’ – For a “Prescribed A” type boundary condition. • mi addbhpoint(’blockname’. • mi clearbhpoints(’blockname’) Clears all B-H data points associatied with the material specified by ’blockname’. – dwire Diameter of each of the wire’s constituent strand in millimeters. i. The circuittype parameter is 0 for a parallel-connected circuit and 1 for a series-connected circuit. set the Mu to the desired relative permeability and Sig to the desired conductivity in MS/m.∗ 4 – plain stranded wire ∗ 5 – Litz wire ∗ 6 – square wire – Phi hx Hysteresis lag in degrees in the x-direction for linear problems. A0. set the A0. Set all other parameters to zero. – To obtain a “Mixed” type boundary condition. c0. A1. circuittype) adds a new circuit property with name ’circuitname’ with a prescribed current. – For a “Periodic” boundary condition.b. set BdryFormat to 3 and set all other parameters to zero. A2. c1. Mu. – For a “Small Skin Depth” type boundary condtion. • mi addboundprop(’propname’.h) Adds a B-H data point the the material specified by the string ’blockname’. set BdryFormat to 5 set all other parameters to zero.a. Set the unused parameter pairs to 0. set BdryFormat to 4 and set all other parameters to zero. – For a “Strategic dual image” boundary. – nstr Number of strands in the wire build. A1.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. • mi addpointprop(’pointpropname’. – Phi hy Hysteresis lag in degrees in the y-direction for linear problems.

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

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

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

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

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

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

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

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

y1.y) Add a new block label at (x.y1) to node closest to (x2.5 Miscellaneous • mo close Closes the current post-processor instance. the parameter should be set to 1. or ’both’ to show either the real. • mo shownames(flag) This function allow the user to display or hide the block label names on screen.y2. ’imag’. • mo maximize maximizes the active magnetics output view.y1) to the nearest node to (x2.maxseg) Add a new arc segment from the nearest node to (x1. To display the names. • mo savemetafile(’filename’) saves a metafile screenshot of the current view to the file specified by ’filename’. • mo reload Reloads the solution from disk. • mo restore restores the active magnetics output view from a minimized or maximized state. 5.y2) • ei addblocklabel(x.y • ei addsegment(x1. Two naming conventions can be used: one which separates words in the command names by underscores. • mo resize(width.1 Object Add/Remove Commands • ei addnode(x.x2. To hide the block label names.angle. imaginary of both real and imaginary components of A. 6 Electrostatics Preprocessor Command Set A number of different commands are available in the preprocessor.height) resizes the active magnetics output window client area to width × height. 6.y) Add a new node at x.y) • ei addarc(x1.y2) Add a new line segment from node closest to (x1.y2) with angle ‘angle’ divided into ‘maxseg’ segments. • mo minimize minimizes the active magnetics output view. 19 .– type Choice of ’real’. • mo refreshview Redraws the current view.x2. • mo savebitmap(’filename’) saves a bitmapped screen shot of the current view to the file specified by ’filename’.y1. and one that eliminates the underscores. flag should be 0.

• ei drawrectangle(x1. • ei deleteselectednodes Delete selected nodes.y2). • ei drawpolygon([x1. ’inconductor’) Set the selected nodes to have the nodal property ’propname’ and group number groupno. • ei deleteselectedsegments Delete selected segments. • ei deleteselectedlabels Delete selected block labels. • ei selectlabel(x.. • ei drawpolyline([x1.x2.y2) Adds nodes at (x1. 6. The ’inconductor’ string specifies which conductor the node belongs to.y1) and (x2. • ei deleteselected Delete all selected objects.y1) and (x2. • ei deleteselectedarcsegments Delete selects arcs. This function will clear all previously selected elements and leave the edit mode in 4 (group) 6. then adds segments connecting the corners of the rectangle..y) • ei selectnode(x.y2) and adds an arc of the specified angle and discretization connecting the nodes.y2) and adds a line between the nodes.2 Geometry Selection Commands • ei clearselected Clear all selected nodes.]) Adds nodes at each of the specified points and connects them with segments to form a closed contour.y).y2’.angle.y). • ei selectsegment(x.x2.x2.y1.y) Select the node closest to (x. arc segments and block labels. • ei drawarc(x1.y1.y1) and (x2. blocks.y2’.y) Select the label closet to (x.y2) Adds nodes at the corners of a rectangle defined by the points (x1. Returns the coordinates of the selected label. If the node doesn’t belong to a named conductor. • ei selectarcsegment(x.y1.. segments.]) Adds nodes at each of the specified points and connects them with segments. 20 .x2. Returns the coordinates of the selected node.groupno.3 Object Labeling Commands • ei setnodeprop(’propname’.• ei drawline(x1. segments and arc segments.maxseg) Adds nodes at (x1.y1.y2.y) • ei selectgroup(n) Select the nth group of nodes.y) Select the arc segment closest to (x. this parameter can be set to ’<None>’.x2.y) Select the line segment closest to (x..y1.

entering 1. 1 == hidden in post processor A member of group number group A member of the conductor specified by the string ’inconductor’. ’propname’. The units parameter specifies the units used for measuring length in the problem domain. automesh. group.• ei setblockprop(’blockname’. ’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. group. 1 = mesher automatically chooses the mesh density. If the segment is not part of a conductor.minangle) changes the problem definition. or to ’axi’ for an axisymmetric problem. ’mils’. automesh: 0 = mesher defers to mesh size constraint defined in meshsize. The sixth parameter represents the minimum angle constraint sent to the mesh generator (usually 30 degrees). group) Set the selected block labels to have the properties: Block property ’blockname’. this parameter can be specified as ’<None>’. For example. automesh. 6. A member of group number group • ei setsegmentprop(’name’.precision. and ’micrometers’.type. • ei setarcsegmentprop(maxsegdeg. 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. meshsize: size constraint on the mesh in the block marked by this label. 1 = mesher automatically chooses mesh size along the selected segments hide: 0 = not hidden in post-processor. ’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. 21 . Valid ’units’ entries are ’inches’.depth.4 Problem Commands • ei probdef(units. hide. this parameter can be specified as ’<None>’. Set problemtype to ’planar’ for a 2-D planar problem. 1 == hidden in post processor A member of group number group A member of the conductor specified by the string ’inconductor’. elmsize. ’millimeters’. The precision parameter dictates the precision required by the solver.E-8 requires the RMS of the residual to be less than 10−8 . ’centimeters’. hide. ’meters. If the segment is not part of a conductor. meshsize.

as ei analyze will make sure the mesh is up to date before running an analysis. 3 – arc segments. • ei purgemesh clears the mesh out of both the screen and memory. by. angle is measured in degrees. The flag parameter controls whether the solver window is visible or minimized. Note that this is not a necessary precursor of performing an analysis. – copies – number of copies to be produced from the selected objects. 6. 4. by – base point for rotation – angle – angle by which the selected objects are incrementally shifted to make each copy. • ei setfocus(’documentname’) Switches the electrostatics input file upon which commands are to act. angle. 6. – copies – number of copies to be produced from the selected objects. editaction ) – bx.dy – distance by which the selected objects are incrementally shifted. If more than one electrostatics input file is being edited at a time.• ei analyze(flag) runs the electrostatics solver. For a visible window. copies ) – bx. • ei loadsolution loads and displays the solution corresponding to the current geometry.group • ei copytranslate(dx. copies) – dx. 22 . by. • ei showmesh toggles the flag that shows or hides the mesh. copies. flag should be set to 1. dy. angle is measured in degrees. • ei saveas(’filename’) saves the file with name ’filename’. this command can be used to switch between files so that the mutiple files can be operated upon programmatically. The number of elements in the mesh is pushed back onto the lua stack. 2 –block labels. For a minimized window. by – base point for rotation – angle – angle by which the selected objects are incrementally shifted to make each copy. – copies – number of copies to be produced from the selected objects. ’documentname’ should contain the name of the desired document as it appears on the window’s title bar.6 Editing Commands • ei copyrotate(bx. – editaction 0 –nodes. 1 – lines (segments).5 Mesh Commands • ei createmesh runs triangle to create a mesh. angle. either specify no value for flag or specify 0. • ei copyrotate2(bx.

shiftangle) – bx. and 4 for groups. dy.y)intoacurveofradiusr. 4. 2 –block labels. • ei seteditmode(editmode) Sets the current editmode to: 23 . 1 – lines (segments). 2 –block labels.scalefactor) – bx. 3 for arc segments.dy – distance by which the selected objects are shifted. 3 – arc segments.r)turnsacornerlocatedat(x. editaction) – dx.y.y2. 4. by – base point for rotation – shiftangle – angle in degrees by which the selected objects are rotated. 1 – lines (segments).y2).dy.dy – distance by which the selected objects are incrementally shifted. 1 – lines (segments). – editaction 0 –nodes. • ei mirror2(x1.by.group • ei scale(bx. – editaction 0 –nodes.by.y1) and (x2. – copies – number of copies to be produced from the selected objects.group • ei createradius(x.editaction) – dx. by – base point for scaling – scalefactor – a multiplier that determines how much the selected objects are scaled – editaction 0 –nodes. 3 – arc segments. Valid editaction entries are 0 for nodes.editaction) – bx. copies.editaction) mirror the selected objects about a line passing through the points (x1. 1 for lines (segments). 1 – lines (segments).group • ei mirror(x1.• ei copytranslate2(dx.x2.dy – distance by which the selected objects are shifted.shiftangle.x2.by. 2 –block labels. 3 – arc segments. • ei movetranslate2(dx. 4. 4.y2). – editaction 0 –nodes.y1. 3 – arc segments.group • ei movetranslate(dx.scalefactor. by – base point for scaling – scalefactor – a multiplier that determines how much the selected objects are scaled • ei scale2(bx.y2) mirror the selected objects about a line passing through the points (x1. • ei moverotate(bx. editaction) – bx.y1.y1) and (x2.dy) – dx. 2 –block labels. by – base point for rotation – shiftangle – angle in degrees by which the selected objects are rotated.by. • ei moverotate2(bx. 2 for block labels.

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

BdryFormat) adds a new boundary property with name ’boundname’ For a “Fixed Voltage” type boundary condition. The various properties that can be modified are listed below: 25 . • ei addboundprop(’boundname’. Set the unused property to zero. qc.propnum.Vp. ex. The next parameter is the number of the property to be set. . set C1 and C0 as required and BdryFormat to 1. ey. • ei addconductorprop(’conductorname’. so that current can be modified from run to run). Set all other parameters to zero. The material to be modified is specified by ’BlockName’.g. c0. ey Relative permittivity in the y. set the Vs parameter to the desired voltage and all other parameters to zero.9 Object Properties • ei addmaterial(’matname’.or z-direction.or r-direction. c1. set BdryFormat to 3 and set all other parameters to zero. The conductortype parameter is 0 for prescribed charge and 1 for prescribed voltage. To obtain a “Mixed” type boundary condition. conductortype) adds a new conductor property with name ’conductorname’ with either a prescribed voltage or a prescribed total charge. • ei deletepointprop(’pointname’) deletes the point property named ’pointname’ • ei modifymaterial(’BlockName’. Vs. • ei deletematerial(’materialname’) deletes the material named ’materialname’.6. qv Volume charge density in units of C/m3 • ei addpointprop(’pointname’. • ei deleteboundprop(’boundname’) deletes the boundary property named ’boundname’. set BdryFormat to 4 set all other parameters to zero. qs. Vc. For an “Anti-Perodic” boundary condition. • ei deleteconductor(’conductorname’) deletes the conductor named conductorname. To obtain a prescribes surface charge density. The last number is the value to be applied to the specified property. qv) adds a new material with called ’matname’ with the material properties: ex Relative permittivity in the x. set qs to the desired charge density in C/m2 and set BdryFormat to 2. For a “Periodic” boundary condition.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.value) This function allows for modification of a material’s properties without redefining the entire material (e.

The conductor property to be modified is specified by ’ConductorName’. The BC to be modified is specified by ’BdryName’. 1 = Prescribed voltage 26 .value) This function allows for modification of a boundary property.value) This function allows for modification of a conductor property. The next parameter is the number of the property to be set. The point property to be modified is specified by ’PointName’. 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 last number is the value to be applied to the specified property.propnum.propnum. The various properties that can be modified are listed below: propnum 0 1 2 3 4 5 Symbol BdryName Vs qs c0 c1 BdryFormat Description Name of boundary property Fixed Voltage Prescribed charge density Mixed BC parameter Mixed BC parameter Type of boundary condition: 0 = Prescribed V 1 = Mixed 2 = Surface charge density 3 = Periodic 4 = Antiperiodic • ei modifypointprop(’PointName’. The various properties that can be modified are listed below: propnum Symbol Description 0 PointName Name of the point property Vp Prescribed nodal voltage 1 2 qp Point charge density in C/m • ei modifyconductorprop(’ConductorName’. 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 next parameter is the number of the property to be set.propnum 0 1 2 3 Symbol BlockName ex ey qs Description Name of the material x (or r) direction relative permittivity y (or z) direction relative permittivity Volume charge • ei modifyboundprop(’BdryName’. The next parameter is the number of the property to be set.propnum.value) This function allows for modification of a point property.

To hide the block label names. To display the names. As with the preprocessor commands. the permeability varies as a function of distance from the origin of the external region.6. • ei close closes the preprocessor window and destroys the current document. The Zo parameter is the z-location of the origin of the outer region.1 Data Extraction Commands • eo lineintegral(type) Calculates the line integral for the defined contour type 0 1 2 3 4 Integral E ·t D·n Contour length Force from stress tensor Torque from stress tensor 27 . In the exterior region. the region of interest). • ei readdxf(’filename’) This function imports a dxf file specified by ’filename’. flag should be 0. the Ro parameter is the radius of the outer region.e.Ri) defines an axisymmetric external region to be used in conjuction with the Kelvin Transformation method of modeling unbounded problems. These parameters are necessary to define the permeability variation in the external region. the parameter should be set to 1. • ei shownames(flag) This function allow the user to display or hide the block label names on screen. these commands can be used with either the underscore naming or with the no-underscore naming convention. • ei refreshview Redraws the current view. and the Ri parameter is the radius of the inner region (i.10 Miscellaneous • ei savebitmap(’filename’) saves a bitmapped screenshot of the current view to the file specified by ’filename’. • ei defineouterspace(Zo. • ei savemetafile(’filename’) saves a metafile screenshot of the current view to the file specified by ’filename’.Ro. • ei attachouterspace marks all selected block labels as members of the external region used for modeling unbounded axisymmetric problems via the Kelvin Transformation. 7. • ei detachouterspace undefines all selected block labels as members of the external region used for modeling unbounded axisymmetric problems via the Kelvin Transformation. 7 Electrostatics Post Processor Command Set There are a number of scripting commands designed to operate in the postprocessor.

For force. • eo getperm(x.direction component of electric field intensity y. the function returns an array with two elements is returned representing components in the x and y or r and z directions.y) Gets the electric field intensity associated with the point at (x.y).y) Gets the values associated with the point at (x. The return value is a list with two element representing Ex and Ey for planar problems and Er and Ez for axisymmetric problems. • eo getpointvalues(x.or r. D and E. contour length. 28 .direction component of electric field intensity x.y). and torque. The function returns an array of results whose elements represent: Symbol V Dx Dy Ex Ey ex ey nrg Definition Voltage x. flux density.or z. • eo getd(x.This integral a single result for field intensity. The return value is a list with two element representing εx and εy for planar problems and εr and εz for axisymmetric problems.y).or r.or r. y). • eo gete(x.or z.y) Gets the electric field energy density associated with the point at (x. The return value is a list with two element representing Dx and Dy for planar problems and Dr and Dz for axisymmetric problems.y) Gets the voltage associated with the point at (x. an array with two elements is returned representing force in the x and y or r and z directions. • eo blockintegral(type) Calculates a block integral for the selected blocks type 0 1 2 3 4 5 6 Integral Stored Energy Block Cross-section Block Volume Average D over the block Average E over the block Weighted Stress Tensor Force Weighted Stress Tensor Torque This integral a single result for energy.y) Gets the electric flux density associated with the point at (x.y). For force. volume and torque.direction component of displacement y.y) Gets the electric permittivity associated with the point at (x. • eo getenergydensity(x.direction component of permittivity y.or z.direction component of displacement x.y).direction component of permittivity electric field energy density • eo getv(x.

• eo getconductorproperties(’conductor’) Properties are returned for the conductor property named ’conductor’. 29 .’c:temp.0) • eo getprobleminfo Returns info on problem description.y). Valid entries for mode are ’point’. If only PlotType or only PlotType and NumPoints are specified. • eo selectblock(x.y) Select the block that contains point (x.200. and the charge carried on the specified conductor. the command would be: eo makeplot(0. the command would be of the form: eo makeplot(0. the command would be: eo makeplot(0. If. Returns two values: the Problem type (0 for planar and 1 for axisymmetric) and the depth assumed for planar problems in units of meters.txt’. n (Normal flux density) D .200) If this plot were to be written to disk as a metafile.’c:temp. rather than display it to make a graphical plot.FileFormat) Allows Octave to access to the X-Y plot routines. the plot is instead written to disk to the specified file name as an extended metafile. in addition. ’contour’. and ’area’.• eo makeplot(PlotType. contour.2 Selection Commands • eo seteditmode(mode) Sets the mode of the postprocessor to point. the Filename parameter is specified. n (Normal field intensity) E .200.NumPoints. Two values are returned: The voltage of the specified conductor. t (Tangential flux density) |E| (Magnitude of field intensity) E . 7. or area mode.Filename. if one wanted to plot V to the screen with 200 points evaluated to make the graph. 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.emf’) To write data instead of a plot to disk. the command is interpreted as a request to plot the requested plot type to the screen. the command is instead interpreted as a command to write the data to disk to the specfied file name. If the FileFormat parameter is also. Valid entries for PlotType are: PlotType 0 1 2 3 4 5 6 Definition V (Voltage) |D| (Magnitude of flux density) D .

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

which should be set to 0 for no vector plot. upper D Sets the upper display limit for the density plot.scalefactor) controls the display of vectors denoting the field strength and direction. setting flag to ’off’ turns off snap to grid. • eo showvectorplot(type.type) Shows the flux density plot with options: legend Set to 0 to hide the plot legend or 1 to show the plot legend. gscale Set to 0 for a colour density plot or 1 for a grey scale density plot. • eo showgrid Show the grid points.lower D. • eo minimize minimizes the active electrostatics output view. and 2 for field intensity E.’type’) Change the grid spacing. • eo maximize maximizes the active electrostatics output view. The scalefactor determines the relative length of the vectors. If the scale is set to 1. Setting flag equal to ’on’ turns on smoothing. type Sets the type of density plot. eo gridsnap(’flag’) Setting flag to ”on” turns on snap to grid.lower V.gscale. lower V Lower limit for contours. and the type parameter is set to ’cart’ for Cartesian coordinates or ’polar’ for polar coordinates. upper V Upper limit for contours. • 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. 1 plots the magnitude of D. A value of 0 plots voltage. lower D Sets the lower display limit for the density plot. • eo showdensityplot(legend.upper V) shows the V contour plot with options: numcontours Number of equipotential lines to be plotted. The parameters taken are the type of plot. • eo hidedensityplot hides the flux density plot. 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.• eo hidepoints Hide the node points from the input geometry. The density parameter specifies the space between grid points. 1 for flux density D.upper D. and setting flag to ’off’ turns off smoothing. • eo showcontourplot(numcontours. and 2 plots the magnitude of E • eo hidecontourplot Hides the contour plot. • eo setgrid(density. 31 . • eo hidegrid Hide the grid points points.

• hi deleteselectednodes Delete selected nodes.height) resizes the active electrostatics output window client area to width × height. 32 .y) • hi addarc(x1. Two naming conventions can be used: one which separates words in the command names by underscores. • eo reload Reloads the solution from disk.angle.y2) • hi addblocklabel(x. • eo savemetafile(’filename’) saves a metafile screenshot of the current view to the file specified by ’filename’.y • hi addsegment(x1.y2) with angle ‘angle’ divided into ‘maxseg’ segments.y1. • eo shownames(flag) This function allow the user to display or hide the block label names on screen. • eo resize(width. 8 Heat Flow Preprocessor Lua Command Set A number of different commands are available in the preprocessor.maxseg) Add a new arc segment from the nearest node to (x1. • eo refreshview Redraws the current view. • eo savebitmap(’filename’) saves a bitmapped screen shot of the current view to the file specified by ’filename’.y1) to the nearest node to (x2. • hi deleteselected Delete all selected objects.y2.• eo restore restores the active electrostatics output view from a minimized or maximized state.x2.5 Miscellaneous • eo close close the current postprocessor window.y) Add a new block label at (x. flag should be 0. 7. • hi deleteselectedlabels Delete selected block labels.x2. and one that eliminates the underscores.y1) to node closest to (x2.y2) Add a new line segment from node closest to (x1.y) Add a new node at x. the parameter should be set to 1.y1.1 Object Add/Remove Commands • hi addnode(x. To display the names. To hide the block label names. 8.

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

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

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

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

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

The next parameter is the number of the property to be set.propnum.value) This function allows for modification of a boundary 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 Tinf External temperature 4 5 h Heat transfer coefficient 6 beta Emissivity • hi modifypointprop("PointName". The point property to be modified is specified by "PointName".propnum. The conductor property to be modified is specified by "ConductorName". The various properties that can be modified are listed Symbol BlockName kx ky qs Description Name of the material x (or r) direction thermal conductivity y (or z) direction thermal conductivity Volume heat generation • hi modifyboundprop("BdryName". 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. 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.value) This function allows for modification of a conductor property. 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". The BC to be modified is specified by "BdryName". The last number is the value to be applied to the specified property. The various properties that can be modified are listed below: 38 .value) This function allows for modification of a point property.be applied below: propnum 0 1 2 3 to the specified property.

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

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

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

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

• 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. e. type Sets the type of density plot. lower Sets the lower display limit for the density plot. Setting flag equal to "on" turns on smoothing. • ho showdensityplot(legend.lower. 1 for heat flux density F. • ho minimize() minimizes the active heat flow input view.type) Shows the heat flux density plot with options: legend Set to 0 to hide the plot legend or 1 to show the plot legend.gscale. gscale Set to 0 for a colour density plot or 1 for a grey scale density plot. A value of 0 plots temperature. • ho hidegrid() Hide the grid points points.g. • ho hidedensityplot() hides the heat flux density plot. setting flag to ”off” turns off snap to grid.upper. • ho showgrid() Show the grid points. 1 plots the magnitude of F.scalefactor) controls the display of vectors denoting the field strength and direction. If the scale is set to 1. lower V Lower limit for contours. The scalefactor determines the relative length of the vectors. • ho maximize() maximizes the active heat flow input view. If ho numcontours is -1 all parameters are ignored and default values are used.lower V. The density parameter specifies the space between grid points. show contour plot(-1) • ho showvectorplot(type. and 2 for temperature gradient G. 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."type") Change the grid spacing. ho gridsnap("flag") Setting flag to ”on” turns on snap to grid. upper Sets the upper display limit for the density plot. upper V Upper limit for contours. The parameters taken are the type of plot. and 2 plots the magnitude of G • ho hidecontourplot() Hides the contour plot. 43 . and the type parameter is set to "cart" for Cartesian coordinates or "polar" for polar coordinates. which should be set to 0 for no vector plot. • ho showcontourplot(numcontours. • ho setgrid(density.upper V) shows the V contour plot with options: numcontours Number of equipotential lines to be plotted. and setting flag to "off" turns off smoothing.

y1.1 Object Add/Remove Commands • ci addnode(x.x2. 10.angle. • ho savebitmap("filename") saves a bitmapped screen shot of the current view to the file specified by "filename".• ho restore() restores the active heat flow input view from a minimized or maximized state.y1) to node closest to (x2.bmp\"") • ho savemetafile("filename") saves a metafile screenshot of the current view to the file specified by "filename". If the file name contains a space (e. • ho shownames(flag) This function allow the user to display or hide the block label names on screen. • ho refreshview() Redraws the current view. Two naming conventions can be used: one which separates words in the command names by underscores. • ho resize(width. and one that eliminates the underscores. subject to the printf-type formatting explained previously for the savebitmap command. • ci deleteselected Delete all selected objects.maxseg) Add a new arc segment from the nearest node to (x1.y • ci addsegment(x1.y1.y1) to the nearest node to (x2. For example: ho savebitmap("\"c:\\temp\\screenshot. "c:\\temp\\myfile. flag should be 0.g. Note that if you use a path you must use two backslashes (e.y2) Add a new line segment from node closest to (x1.y2) • ci addblocklabel(x. file names like c:\program files\stuff) you must enclose the file name in (extra) quotes by using a \" sequence.y) • ci addarc(x1.g.y) Add a new block label at (x.bmp"). 44 .y2. • ho reload() Reloads the solution from disk.y) Add a new node at x.5 Miscellaneous • ho close() close the current postprocessor window. To hide the block label names. 9.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. the parameter should be set to 1.x2. To display the names.height) resizes the active heat flow input window client area to width × height.

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

can also be specified for planar problems. "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. If the segment is not part of a conductor. Note if you use a path you must use two backslashes e.g. or to "axi" for an axisymmetric problem. this command can be used to switch between files so that the mutiple files can be operated upon programmatically via Lua.frequency. and "micrometers". • ci saveas("filename") saves the file with name "filename". The precision parameter dictates the precision required by the solver. If the segment is not part of a conductor. "millimeters".4 Problem Commands • ci probdef(units. this parameter can be specified as "<None>". "meters. • ci setfocus("documentname") Switches the electrostatics input file upon which Lua commands are to act. 10.precision. The flag parameter controls whether the Belasolve window is visible or minimized. "centimeters".(depth). A fourth parameter. Set problemtype to "planar" for a 2-D planar problem. For example.E-8 requires the RMS of the residual to be less than 10−8 . group. For a minimized window. either specify no value for flag or specify 0. A sixth parameter represents the minimum angle constraint sent to the mesh generator.hide: 0 = not hidden in post-processor. "propname". documentname should contain the name of the desired document as it appears on the window’s title bar. "mils". • ci setarcsegmentprop(maxsegdeg. hide.fee 46 . For a visible window. flag should be set to 1. entering 1. representing the depth of the problem in the into-the-page direction for 2-D planar problems. The frequency parameter specifies the frequency in Hz at which the analysis ois to be performed. 1 == hidden in post processor A member of group number group A member of the conductor specified by the string "inconductor". 1 == hidden in post processor A member of group number group A member of the conductor specified by the string "inconductor". c:\\temp\\myfemmfile. If more than one electrostatics input file is being edited at a time. • ci analyze(flag) runs belasolv to solve the problem. • ci loadsolution() loads and displays the solution corresponding to the current geometry. The units parameter specifies the units used for measuring length in the problem domain. Valid "units" entries are "inches".type.(minangle)) changes the problem definition. this parameter can be specified as "<None>".

4. and 4 for groups.group • ci mirror(x1. 4. 2 –block labels. Note that this is not a necessary precursor of performing an analysis.dy – distance by which the selected objects are incrementally shifted.(editaction)) mirror the selected objects about a line passing through the points (x1. copies. (editaction)) dx. editaction 0 –nodes.shiftangle (editaction)) bx.group • ci scale(bx.r)turnsacornerlocatedat(x. 3 – arc segments. 10. 2 –block labels. by – base point for rotation shiftangle – angle in degrees by which the selected objects are rotated. by – base point for rotation angle – angle by which the selected objects are incrementally shifted to make each copy.group • ci movetranslate(dx.y1) and (x2.group • ci copytranslate(dx. 47 . 4.(editaction)) bx. editaction 0 –nodes. copies – number of copies to be produced from the selected objects. angle is measured in degrees. 4. 1 – lines (segments). 1 – lines (segments). 1 – lines (segments).x2. 2 –block labels. 3 – arc segments.y2. 3 – arc segments. 1 – lines (segments). • ci purgemesh() clears the mesh out of both the screen and memory.y)intoacurveofradiusr. 2 for block labels. 4.dy – distance by which the selected objects are shifted.y1. 1 for lines (segments).y. as ci analyze() will make sure the mesh is up to date before running an analysis.scalefactor.by. editaction 0 –nodes. • ci showmesh() toggles the flag that shows or hides the mesh.10. copies. 3 – arc segments. 2 –block labels.y2). 3 – arc segments. by – base point for scaling scalefactor – a multiplier that determines how much the selected objects are scaled editaction 0 –nodes.by. 2 –block labels.group • mi createradius(x.dy. 1 – lines (segments). dy. The number of elements in the mesh is pushed back onto the lua stack. copies – number of copies to be produced from the selected objects.5 Mesh Commands • ci createmesh() runs triangle to create a mesh.(editaction)) dx.6 Editing Commands • ci copyrotate(bx. angle. 3 for arc segments. by. (editaction) ) bx. • ci moverotate(bx. editaction 0 –nodes. Valid editaction entries are 0 for nodes.

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

or z-direction in units of S/m. The last number is the value to 49 . • ci deletepointprop("pointpropname") deletes the point property named "pointpropname" • ci modifymaterial("BlockName".or z-direction.9 Object Properties • ci addmaterial("materialname". oy. ex Relative permittivity in the x.or r-direction. set the Vs parameter to the desired voltage and all other parameters to zero. set js to the desired current density in A/m2 and set BdryFormat to 2.g. • ci deleteboundprop("boundpropname") deletes the boundary property named "boundpropname". set C1 and C0 as required and BdryFormat to 1. • ci deletematerial("materialname") deletes the material named "materialname". c1. Vc. c0.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.Vp. set BdryFormat to 3 and set all other parameters to zero. BdryFormat) adds a new boundary property with name "boundpropname" For a “Fixed Voltage” type boundary condition. For an “Anti-Perodic” boundary condition. ey Relative permittivity in the y. lty Dielectric loss tangent in the y. Set all other parameters to zero. ltx Dielectric loss tangent in the x. • ci deleteconductor("conductorname") deletes the conductor named conductorname. js. Vs.or r-direction.propnum. lty) adds a new material with called "materialname" with the material properties: ox Electrical conductivity in the x. ox. jc.or z-direction. The next parameter is the number of the property to be set. Set the unused property to zero. For a “Periodic” boundary condition. • ci addboundprop("boundpropname". To obtain a prescribes surface current density.value) This function allows for modification of a material’s properties without redefining the entire material (e.10. To obtain a “Mixed” type boundary condition. conductortype) adds a new conductor property with name "conductorname" with either a prescribed voltage or a prescribed total current. set BdryFormat to 4 set all other parameters to zero. ey. so that current can be modified from run to run).or r-direction in units of S/m. ltx. The material to be modified is specified by "BlockName". • ci addpointprop("pointpropname". ex. oy Electrical conductivity in the y. • ci addconductorprop("conductorname". The conductortype parameter is 0 for prescribed current and 1 for prescribed voltage.

The last number is the value to be applied to the specified property.propnum.value) This function allows for modification of a boundary property. The various properties that can be modified are listed Symbol BlockName ox oy ex ey ltx lty Description Name of the material x (or r) direction conductivity y (or z) direction conductivity x (or r) direction relative permittivity y (or z) direction relative permittivity x (or r) direction dielectric loss tangent y (or z) direction dielectric loss tangent • ci modifyboundprop("BdryName". The conductor property to be modified is specified by "ConductorName". The next parameter is the number of the property to be set.propnum. The point property to be modified is specified by "PointName".value) This function allows for modification of a point property.value) This function allows for modification of a conductor property. The various properties that can be modified are listed below: propnum 0 1 2 3 4 5 Symbol BdryName Vs js c0 c1 BdryFormat Description Name of boundary property Fixed Voltage Prescribed current density Mixed BC parameter Mixed BC parameter Type of boundary condition: 0 = Prescribed V 1 = Mixed 2 = Surface current density 3 = Periodic 4 = Antiperiodic • ci 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 BC to be modified is specified by "BdryName". 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.be applied below: propnum 0 1 2 3 4 5 6 to the specified property. The various properties that can be modified are listed below: 50 . The last number is the value to be applied to the specified property.propnum.

flag should be 0. • ci refreshview() Redraws the current view. As with the preprocessor commands. • ci attachouterspace() marks all selected block labels as members of the external region used for modeling unbounded axisymmetric problems via the Kelvin Transformation. In the exterior region. • ci detachouterspace() undefines all selected block labels as members of the external region used for modeling unbounded axisymmetric problems via the Kelvin Transformation.propnum 0 1 2 3 Symbol ConductorName Vc jc ConductorType Description Name of the conductor property Conductor voltage Total conductor current 0 = Prescribed current.e. These parameters are necessary to define the permeability variation in the external region. 1 = Prescribed voltage 10. • ci defineouterspace(Zo. these commands can be used with either the underscore naming or with the no-underscore naming convention. 51 . subject to the printf-type formatting explained previously for the ci saveas command. subject to the printf-type formatting explained previously for the ci saveas command. and the Ri parameter is the radius of the inner region (i.10 Miscellaneous • ci savebitmap("filename") saves a bitmapped screenshot of the current view to the file specified by "filename". To display the names.Ro. • ci shownames(flag) This function allow the user to display or hide the block label names on screen. • ci readdxf("filename") This function imports a dxf file specified by "filename". • ci close() closes the preprocessor window and destroys the current document. 11 Current Flow Post Processor Command Set There are a number of Lua scripting commands designed to operate in the postprocessor.Ri) defines an axisymmetric external region to be used in conjuction with the Kelvin Transformation method of modeling unbounded problems. the parameter should be set to 1. • ci savemetafile("filename") saves a metafile screenshot of the current view to the file specified by "filename". the region of interest). To hide the block label names. the Ro parameter is the radius of the outer region. The Zo parameter is the z-location of the origin of the outer region. the permeability varies as a function of distance from the origin of the external region.

2x frequency component Weighted Stress Tensor torque. 2x frequency component Returns a value that can be complex. in order.11. : Fx.y The return values. DC component y (or z) direction Weighted Stress Tensor force. are: 52 .g. Fy = co lineintegral(4) • co blockintegral(type) Calculate a block integral for the selected blocks type 0 1 2 3 4 5 6 7 8 9 10 11 Integral Real Power Reactive Power Apparent Power Time-Average Stored Energy Block cross-section area Block volume x (or r) direction Weighted Stress Tensor force.1 Data Extraction Commands • co lineintegral(type) Calculate the line integral for the defined contour type 0 1 2 3 4 5 Integral E ·t J·n Contour length Average voltage over contour Force from stress tensor Torque from stress tensor This integral returns either 1 or 2 values. 2x frequency component y (or z) direction Weighted Stress Tensor force.Y) Get the values associated with the point at x. DC component Weighted Stress Tensor torque. • co getpointvalues(X. e. as necessary. depending on the integral type. DC component x (or r) direction Weighted Stress Tensor force.

direction component of AC conductivity y.direction component of permittivity x.or r.or z. n (Normal displacement current density) Jd .FileFormat) Allows Lua access to the X-Y plot routines. If the FileFormat parameter is also.NumPoints.or r. 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.or z.direction component of permittivity y. If only PlotType or only PlotType and NumPoints are specified.or z. n (Normal current density) J .or z. the plot is instead written to disk to the specified file name as an extended metafile. Valid entries for PlotType are: PlotType 0 1 2 3 4 5 6 7 8 9 10 11 12 Definition V (Voltage) |J| (Magnitude of current density) J . if one wanted to plot V to the screen with 200 points evaluated to make the 53 .direction component of displacement current density x. t (Tangential current density) |E| (Magnitude of field intensity) E . the command is instead interpreted as a command to write the data to disk to the specfied file name. t (Tangential conduction current density) |Jd| (Magnitude of displacement current density) Jd .or z.direction component of permittivity y.direction component of current density y.or r.or r. n (Normal conduction current density) Jc .direction component of electric field intensity x.Filename.or z.or r.or r.direction component of permittivity x. If. rather than display it to make a graphical plot. n (Normal field intensity) E . the command is interpreted as a request to plot the requested plot type to the screen.direction component of current density x.or z.direction component of conduction current density • co makeplot(PlotType.Symbol V Jx Jy Kx Ky Ex Ey ex ey Jdx Jdy ox oy Jcx Jcy Definition Voltage x. the Filename parameter is specified. in addition.or r.direction component of AC conductivity x. t (Tangential field intensity) |Jc| (Magnitude of conduction current density) Jc .direction component of displacement current density y.direction component of conduction current density y.direction component of electric field intensity y.

the command would be of the form: co makeplot(0.200. • co selectconductor("name") Selects all nodes. If no number is specified (i. • co bendcontour(angle. • co addcontour(x. 54 .y) Select the block that contains point (x. The anglestep parameter must be greater than zero. • co selectblock(x. the command would be: co makeplot(0. Returns three values: Return value 1 2 3 Definition problem type frequency in Hz depth assumed for planar problems in meters. The angle parameter can take on values from -180 to 180 degrees.y).200) If this plot were to be written to disk as a metafile.e. 11. all blocks are selected. where the conductors are points or surfaces. this command is ignored.y).2 Selection Commands • co seteditmode(mode) Sets the mode of the postprocessor to point. co groupselectblock()). This command is used to select conductors for the purposes of the “weighted stress tensor” force and torque integrals.200.0) • co getprobleminfo() Returns info on problem description.emf") To write data instead of a plot to disk. Two values are returned: The voltage of the specified conductor. The arc is actually composed of many straight lines."c:temp."c:temp.graph. segments. 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"). If there are less than two points defined in the contour. each of which is constrained to span no more than anglestep degrees. or area mode. if there are existing points the contour runs from the previous point to this point.txt". rather than regions (i. can’t be selected with co selectblock). "contour".e.anglestep) Replaces the straight line formed by the last two points in the contour by an arc that spans angle degrees. and "area". the command would be: co makeplot(0. and the current on the specified conductor. Valid entries for mode are "point". • co groupselectblock(n) Selects all of the blocks that are labeled by block labels that are members of group n. If this is the first point then it starts a contour. contour. • co getconductorproperties("conductor") Properties are returned for the conductor property named ”conductor”.y) Adds a contour point at (x.

"type") Change the grid spacing. setting flag to ”off” turns off snap to grid. 55 .x2. Setting flag equal to "on" turns on smoothing. • co hidegrid() Hide the grid points points. 11. The selectpoint command has the same functionality as the left-button-click contour point selection when the program is running in interactive mode. and setting flag to "off" turns off smoothing. • co zoomout() Zoom out one level. • co showgrid() Show the grid points. • co setgrid(density. • co hidepoints() Hide the node points from the input geometry. • co zoom(x1. • co zoomin() Zoom in one level.• co selectpoint(x.y2) Zoom to the window defined by lower left corner (x1.y). • 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.y1.y2).3 Zoom Commands • co zoomnatural() Zoom to the natural boundaries of the geometry. • co showpoints() Show the node points from the input geometry.4 View Commands • co showmesh() Show the mesh. • co hidemesh() Hide the mesh. and the type parameter is set to "cart" for Cartesian coordinates or "polar" for polar coordinates. • co clearcontour() Clear a prevously defined contour • co clearblock() Clear block selection 11.y1) and upper right corner (x2. co gridsnap("flag") Setting flag to ”on” turns on snap to grid. a contour is added that traces along the arcsegment.y) Adds a contour point at the closest input point to (x. If the selected point and a previous selected points lie at the ends of an arcsegment. The density parameter specifies the space between grid points. • co hidedensityplot() hides the current density plot.

• co showcontourplot(numcontours. "imag".type) Shows the current density plot with options: legend Set to 0 to hide the plot legend or 1 to show the plot legend. the imaginary part of voltage. The type parameter can take on the following values: type 0 1 2 3 4 5 6 Description No vector plot Re(J) Re(E) The scalefactor determines the relative length of the vectors.scalefactor) controls the display of vectors denoting the field strength and direction. or "both".upper V). Specific choices for the type of density plot include: type 0 1 2 3 4 5 6 7 8 Description |V | |Re(V )| |Im(V )| |J| |Re(J)| |Im(J)| |E| |Re(E)| |Im(E)| • co hidecontourplot() Hides the contour plot. upper V Upper limit for contours. Im(J) Im(E) Re(J) and Im(J) Re(E) and Im(E) 56 .gscale. denoting the real part of voltage.lower.upper. gscale Set to 0 for a colour density plot or 1 for a grey scale density plot. type the type of contour plot to be rendered.• co showdensityplot(legend. upper Sets the upper display limit for the density plot. • co showvectorplot(type. show contour plot(-1) The type can take on the values of "real". lower V Lower limit for contours. or both components of voltage.g. If co numcontours is -1 all parameters are ignored and default values are used.type shows the V contour plot with options: numcontours Number of equipotential lines to be plotted. lower Sets the lower display limit for the density plot. e.lower V. type Sets the type of density plot.

file names like c:\program files\stuff) you must enclose the file name in (extra) quotes by using a \" sequence.bmp\"") • co savemetafile("filename") saves a metafile screenshot of the current view to the file specified by "filename". • co resize(width. • co shownames(flag) This function allow the user to display or hide the block label names on screen. Note that if you use a path you must use two backslashes (e.5 Miscellaneous • co close() close the current postprocessor window. • co restore() restores the active magnetics input view from a minimized or maximized state. 57 . "c:\\temp\\myfile. • co maximize() maximizes the active magnetics input view.height) resizes the active magnetics input window client area to width × height.g. • co savebitmap("filename") saves a bitmapped screen shot of the current view to the file specified by "filename". If the file name contains a space (e.If the scale is set to 1. • co minimize() minimizes the active magnetics input view. For example: co savebitmap("\"c:\\temp\\screenshot. • co refreshview() Redraws the current view.g. subject to the printf-type formatting explained previously for the savebitmap command. To hide the block label names. To display the names. flag should be 0. 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. 11. the parameter should be set to 1.bmp"). • co reload() Reloads the solution from disk.

Sign up to vote on this title
UsefulNot useful