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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

The various properties that can be modified are listed below: propnum Symbol Description 0 PointName Name of the point property 1 Tp Prescribed nodal temperature 2 qp Point heat generation in W/m • hi modifyconductorprop("ConductorName". The last number is the value to be applied to the specified property.value) This function allows for modification of a point property. 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 various properties that can be modified are listed below: propnum Symbol Description 0 BdryName Name of boundary property 1 BdryFormat Type of boundary condition: 0 = Prescribed temperature 1 = Heat Flux 2 = Convection 3 = Radiation 4 = Periodic 5 = Antiperiodic 2 Tset Fixed Temperature 3 qs Prescribed heat flux density Tinf External temperature 4 5 h Heat transfer coefficient 6 beta Emissivity • hi modifypointprop("PointName". The conductor property to be modified is specified by "ConductorName".value) This function allows for modification of a boundary property.propnum.be applied below: propnum 0 1 2 3 to the specified property. The BC to be modified is specified by "BdryName". The point property to be modified is specified by "PointName". The various properties that can be modified are listed below: 38 . The next parameter is the number of the property to be set.value) This function allows for modification of a conductor property.propnum.propnum. The last number is the value to be applied to the specified property. The last number is the value to be applied to the specified property. The next parameter is the number of the property to be set. The next parameter is the number of the property to be set.

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

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

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

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

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

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

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

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

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

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

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

value) This function allows for modification of a conductor property. The conductor property to be modified is specified by "ConductorName". The last number is the value to be applied to the specified property. The next parameter is the number of the property to be set. The various properties that can be modified are listed below: propnum 0 1 2 3 4 5 Symbol BdryName Vs js c0 c1 BdryFormat Description Name of boundary property Fixed Voltage Prescribed current density Mixed BC parameter Mixed BC parameter Type of boundary condition: 0 = Prescribed V 1 = Mixed 2 = Surface current density 3 = Periodic 4 = Antiperiodic • ci modifypointprop("PointName". The 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".be applied below: propnum 0 1 2 3 4 5 6 to the specified property. The various properties that can be modified are listed below: propnum Symbol Description 0 PointName Name of the point property 1 Vp Prescribed nodal voltage 2 jp Point current density in A/m • ci modifyconductorprop("ConductorName". The 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 point property. The BC to be modified is specified by "BdryName". The various properties that can be modified are listed below: 50 .propnum.propnum. The point property to be modified is specified by "PointName".value) This function allows for modification of a boundary property. The last number is the value to be applied to the specified property. The next parameter is the number of the property to be set.

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

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

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

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

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

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

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

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.