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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

The next parameter is the number of the property to be set.value) This function allows for modification of a conductor property. 1 = Prescribed voltage 26 . The BC to be modified is specified by ’BdryName’.value) This function allows for modification of a boundary property. The last number is the value to be applied to the specified property.propnum.propnum. The next parameter is the number of the property to be set.propnum 0 1 2 3 Symbol BlockName ex ey qs Description Name of the material x (or r) direction relative permittivity y (or z) direction relative permittivity Volume charge • ei modifyboundprop(’BdryName’.propnum. The various properties that can be modified are listed below: propnum Symbol Description 0 PointName Name of the point property Vp Prescribed nodal voltage 1 2 qp Point charge density in C/m • ei modifyconductorprop(’ConductorName’. The next parameter is the number of the property to be set. The conductor property to be modified is specified by ’ConductorName’. The point property to be modified is specified by ’PointName’. 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’.value) This function allows for modification of a point 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 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 permeability varies as a function of distance from the origin of the external region. To display the names.6. • ei refreshview Redraws the current view. the parameter should be set to 1. the region of interest). • ei shownames(flag) This function allow the user to display or hide the block label names on screen.e.10 Miscellaneous • ei savebitmap(’filename’) saves a bitmapped screenshot of the current view to the file specified by ’filename’. • ei savemetafile(’filename’) saves a metafile screenshot of the current view to the file specified by ’filename’. In the exterior region. 7 Electrostatics Post Processor Command Set There are a number of scripting commands designed to operate in the postprocessor. • ei defineouterspace(Zo.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 . 7. • ei detachouterspace undefines all selected block labels as members of the external region used for modeling unbounded axisymmetric problems via the Kelvin Transformation. • ei attachouterspace marks all selected block labels as members of the external region used for modeling unbounded axisymmetric problems via the Kelvin Transformation.Ri) defines an axisymmetric external region to be used in conjuction with the Kelvin Transformation method of modeling unbounded problems. these commands can be used with either the underscore naming or with the no-underscore naming convention. and the Ri parameter is the radius of the inner region (i. As with the preprocessor commands.Ro. the Ro parameter is the radius of the outer region. • ei readdxf(’filename’) This function imports a dxf file specified by ’filename’. These parameters are necessary to define the permeability variation in the external region. To hide the block label names. • ei close closes the preprocessor window and destroys the current document. flag should be 0. The Zo parameter is the z-location of the origin of the outer region.

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

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

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

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

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

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

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

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

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

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

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.value) This function allows for modification of a conductor property.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 last number is the value to be applied to the specified property. The last number is the value to be applied to the specified property. The various properties that can be modified are listed below: 38 . 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".be applied below: propnum 0 1 2 3 to the specified property.propnum. The BC to be modified is specified by "BdryName". The next parameter is the number of the property to be set.value) This function allows for modification of a boundary property. The conductor property to be modified is specified by "ConductorName". The next parameter is the number of the property to be set. The point property to be modified is specified by "PointName".value) This function allows for modification of a point property. The various properties that can be modified are listed below: propnum Symbol Description 0 PointName Name of the point property 1 Tp Prescribed nodal temperature 2 qp Point heat generation in W/m • hi modifyconductorprop("ConductorName".

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

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

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

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

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

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

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

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

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

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

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

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

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

as necessary. are: 52 . e. in order. • co getpointvalues(X.Y) Get the values associated with the point at x. DC component x (or r) direction Weighted Stress Tensor force.1 Data Extraction Commands • co lineintegral(type) Calculate the line integral for the defined contour type 0 1 2 3 4 5 Integral E ·t J·n Contour length Average voltage over contour Force from stress tensor Torque from stress tensor This integral returns either 1 or 2 values. 2x frequency component y (or z) direction Weighted Stress Tensor force. depending on the integral type. DC component Weighted Stress Tensor torque. 2x frequency component Weighted Stress Tensor torque.y The return values. 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.g.11. 2x frequency component Returns a value that can be complex. : Fx. DC component y (or z) direction Weighted Stress Tensor force.

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

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

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

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

height) resizes the active magnetics input window client area to width × height. • co restore() restores the active magnetics input view from a minimized or maximized state.bmp").g. • co maximize() maximizes the active magnetics input view. 57 .If the scale is set to 1. the parameter should be set to 1. Note that if you use a path you must use two backslashes (e.5 Miscellaneous • co close() close the current postprocessor window. • co reload() Reloads the solution from disk.bmp\"") • co savemetafile("filename") saves a metafile screenshot of the current view to the file specified by "filename". 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. For example: co savebitmap("\"c:\\temp\\screenshot. flag should be 0.g. • co savebitmap("filename") saves a bitmapped screen shot of the current view to the file specified by "filename". "c:\\temp\\myfile. • co minimize() minimizes the active magnetics input view. To display the names. • co resize(width. • co refreshview() Redraws the current view. To hide the block label names. 11. 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. 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.

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.