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

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

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

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

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

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

• mi deletematerial(’materialname’) deletes the material named ’materialname’. 2=parallel to y Hysteresis lag in x-direction for linear problems. degrees Iron fill fraction 0 = None/In plane. 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. MS/m Lamination thickness. • mi deletepointprop(’pointpropname’) deletes the point property named ’pointpropname’ • mi_modifymaterial(’BlockName’. mm Hysteresis lag angle for nonlinear problems. The last number is the value to be applied to the specified property. The various properties that can be modified are listed below: 11 . The material to be modified is specified by ’BlockName’. MA/m2 Electrical conductivity. 1 = parallel to x. so that current can be modified from run to run). degrees Hysteresis lag in y-direction for linear problems. degrees • mi_modifyboundprop(’BdryName’.g. • mi deleteboundprop(’propname’) deletes the boundary property named ’propname’. 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.value) This function allows for modification of a material’s properties without redefining the entire material (e. The next parameter is the number of the property to be set. The BC to be modified is specified by ’BdryName’.propnum.propnum. • mi deletecircuit(’circuitname’) deletes the circuit named circuitname.value) This function allows for modification of a boundary property.

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. 4.propnum. The last number is the value to be applied to the specified property.i) sets the current in the circuit specified by ’CircName’ to i. The circuit property to be modified is specified by ’CircName’. 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 next parameter is the number of the property to be set. 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’.10 Miscellaneous • mi savebitmap(’filename’) saves a bitmapped screenshot of the current view to the file specified by ’filename’. 1 = Series • mi setcurrent(’CircName’. The point property to be modified is specified by ’PointName’. Amps • mi_modifycircprop(’CircName’. Weber/Meter Nodal current.value) This function allows for modification of a circuit property. 12 .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 CircName i CircType Description Name of the circuit property Total current 0 = Parallel.propnum.

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

results. in order: 14 . the 2× results are only relevant for problems where ω = 0. For force and torque results. The function returns an array whose contents are.e.y) Get the values associated with the point at (x.y). • 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. moment of inertia / density) • mo getpointvalues(x.

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

If. 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.emf’) To write data instead of a plot to disk. the command would be: mo_makeplot(2.200. In order. the command would be: mo makeplot(2. in addition. Six values are returned by the function.200. the Filename parameter is specified.NumPoints.txt’.200) If this plot were to be written to disk as a metafile. Properties are returned for the circuit property named ’circuit’.’c:\temp\myfile. 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. If only PlotType or only PlotType and NumPoints are specified.’c:\temp\myfile. 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. rather than display it to make a graphical plot. if one wanted to plot B · n to the screen with 200 points evaluated to make the graph. these parameters are: 16 . the command would be of the form: mo_makeplot(2.Filename. the plot is instead written to disk to the specified file name as an extended metafile.0) • mo_getprobleminfo Returns info on problem description.FileFormat) Allows Octave access to FEMM’s X-Y plot routines.• mo_makeplot(PlotType.

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

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

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

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

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

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

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

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

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

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’.value) This function allows for modification of a conductor property. The last number is the value to be applied to the specified property. The BC to be modified is specified by ’BdryName’.value) This function allows for modification of a point property.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’.propnum.value) This function allows for modification of a boundary property. The next parameter is the number of the property to be set.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 point property to be modified is specified by ’PointName’. The next parameter is the number of the property to be set. The conductor property to be modified is specified by ’ConductorName’. 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. 1 = Prescribed voltage 26 . 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.

• ei savemetafile(’filename’) saves a metafile screenshot of the current view to the file specified by ’filename’. • ei refreshview Redraws the current view. As with the preprocessor commands. The Zo parameter is the z-location of the origin of the outer region. 7 Electrostatics Post Processor Command Set There are a number of scripting commands designed to operate in the postprocessor. • ei readdxf(’filename’) This function imports a dxf file specified by ’filename’. the region of interest). 7.10 Miscellaneous • ei savebitmap(’filename’) saves a bitmapped screenshot of the current view to the file specified by ’filename’. In the exterior region.Ri) defines an axisymmetric external region to be used in conjuction with the Kelvin Transformation method of modeling unbounded problems. • ei shownames(flag) This function allow the user to display or hide the block label names on screen. • ei detachouterspace undefines all selected block labels as members of the external region used for modeling unbounded axisymmetric problems via the Kelvin Transformation. • ei defineouterspace(Zo. flag should be 0. the permeability varies as a function of distance from the origin of the external region.e. To hide the block label names.6.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 . the parameter should be set to 1. These parameters are necessary to define the permeability variation in the external region. these commands can be used with either the underscore naming or with the no-underscore naming convention. the Ro parameter is the radius of the outer region.Ro. • ei close closes the preprocessor window and destroys the current document. • ei attachouterspace marks all selected block labels as members of the external region used for modeling unbounded axisymmetric problems via the Kelvin Transformation. To display the names. and the Ri parameter is the radius of the inner region (i.

For force.y) Gets the electric field intensity associated with the point at (x. flux density. and torque.y) Gets the voltage associated with the point at (x. For force.y).y). D and E. The return value is a list with two element representing εx and εy for planar problems and εr and εz for axisymmetric problems.direction component of permittivity y. • eo getperm(x.or r.direction component of electric field intensity y.or z. the function returns an array with two elements is returned representing components in the x and y or r and z directions. The return value is a list with two element representing Dx and Dy for planar problems and Dr and Dz for axisymmetric problems.direction component of permittivity electric field energy density • eo getv(x. • eo getd(x. an array with two elements is returned representing force in the x and y or r and z directions.direction component of displacement y.direction component of displacement x. The function returns an array of results whose elements represent: Symbol V Dx Dy Ex Ey ex ey nrg Definition Voltage x. • eo gete(x. The return value is a list with two element representing Ex and Ey for planar problems and Er and Ez for axisymmetric problems. 28 .or z.y) Gets the values associated with the point at (x.y). y). contour length.y) Gets the electric flux density associated with the point at (x. • eo getpointvalues(x.This integral a single result for field intensity. • eo getenergydensity(x.direction component of electric field intensity x.or r.y) Gets the electric permittivity associated with the point at (x.or z.or r. • 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. volume and torque.y) Gets the electric field energy density associated with the point at (x.y).y).

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

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

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

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

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

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

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

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

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

The next parameter is the number of the property to be set.value) This function allows for modification of a point property. The conductor property to be modified is specified by "ConductorName". The last number is the value to be applied to the specified property.propnum. 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".be applied below: propnum 0 1 2 3 to the specified property.propnum. 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".propnum. 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.value) This function allows for modification of a conductor property. 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. The various properties that can be modified are listed below: 38 . The point property to be modified is specified by "PointName". The BC to be modified is specified by "BdryName".value) This function allows for modification of a boundary property.

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

direction component of thermal conductivity Example: To catch all values at (0. If only PlotType or only PlotType and NumPoints are specified.FileFormat) Allows Lua access to the X-Y plot routines. 9.or r. Gy = ho blockintegral(4) • ho getpointvalues(X.or r.: Gx.9 Heat Flow Post Processor Command Set There are a number of Lua scripting commands designed to operate in the postprocessor.0) • ho makeplot(PlotType.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. depending on the integral type.Fy.or r. these commands can be used with either the underscore naming or with the no-underscore naming convention. 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.ky= ho getpointvalues(0.g.Gx. in order.Fx. : Ftot.Gy.01. in addition. If.direction component of heat flux density Gx x. the command is interpreted as a request to plot the requested plot type to the screen.direction component of temperature gradient Gy y.direction component of temperature gradient kx x.NumPoints.01.kx.or z.direction component of thermal conductivity ky y.Y) Get the values associated with the point at x.or z.direction component of heat flux density Fy y.or z.Filename. e.y The return values. 40 .0) use T. e. As with the preprocessor commands.g. are: Symbol Definition V Temperature Fx x.

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

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

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

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

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

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

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

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

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

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. 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 point property to be modified is specified by "PointName".be applied below: propnum 0 1 2 3 4 5 6 to the specified property. The next parameter is the number of the property to be set.value) This function allows for modification of a point 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".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.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.value) This function allows for modification of a boundary property. The BC to be modified is specified by "BdryName". The conductor property to be modified is specified by "ConductorName". 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".

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

e.y The return values. depending on the integral type. 2x frequency component Returns a value that can be complex.11. DC component y (or z) 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. are: 52 . as necessary. • co getpointvalues(X. in order. 2x frequency component y (or z) direction Weighted Stress Tensor force. DC component Weighted Stress Tensor torque. DC component x (or r) direction Weighted Stress Tensor force.Y) Get the values associated with the point at x. 2x frequency component Weighted Stress Tensor torque.g. : Fx. 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.

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

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

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

lower. "imag".• co showdensityplot(legend. e.type shows the V contour plot with options: numcontours Number of equipotential lines to be plotted. or both components of voltage. 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. gscale Set to 0 for a colour density plot or 1 for a grey scale density plot. type Sets the type of density plot. lower Sets the lower display limit for the density plot. If co numcontours is -1 all parameters are ignored and default values are used. 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.lower V. the imaginary part of voltage. Im(J) Im(E) Re(J) and Im(J) Re(E) and Im(E) 56 .scalefactor) controls the display of vectors denoting the field strength and direction.type) Shows the current density plot with options: legend Set to 0 to hide the plot legend or 1 to show the plot legend. upper Sets the upper display limit for the density plot.upper. upper V Upper limit for contours. show contour plot(-1) The type can take on the values of "real". or "both".g. denoting the real part of voltage.upper V).gscale. lower V Lower limit for contours. • co showcontourplot(numcontours. • co showvectorplot(type. type the type of contour plot to be rendered.

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

Sign up to vote on this title
UsefulNot useful