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

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

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

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

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

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

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

12 .propnum.value) This function allows for modification of a point property.propnum 0 1 2 3 4 5 6 7 8 9 Symbol BdryName A0 A1 A2 φ µ σ c0 c1 BdryFormat Description Name of boundary property Prescribed A parameter Prescribed A parameter Prescribed A parameter Prescribed A phase Small skin depth relative permeability Small skin depth conductivity.propnum. The circuit property to be modified is specified by ’CircName’. 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. 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. 1 = Series • mi setcurrent(’CircName’. 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’. 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.value) This function allows for modification of a circuit property. The next parameter is the number of the property to be set. The point property to be modified is specified by ’PointName’.i) sets the current in the circuit specified by ’CircName’ to i. Weber/Meter Nodal current. Amps • mi_modifycircprop(’CircName’.10 Miscellaneous • mi savebitmap(’filename’) saves a bitmapped screenshot of the current view to the file specified by ’filename’. 4.

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

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

y) Get the ohmic loss density associated with the point at (x.y).y) Get the relative magnetic permeability associated with the point at (x. • mo getpe(x.y). • mo getfill(x.y) Get the magnetic field intensity associated with the point at (x. The return value is a list with two element representing Hx and Hy for planar problems and Hr and Hz for axisymmetric problems. the reported potential is vector potential A.y). Hz if axisymmetric eddy current density source current density µx if planar.y) Get the winding factor (i.y). • mo getconductivity(x. • mo getj(x. For axisymmetric problems.y) Gets the conductivity associated with the point at (x.y) Get the potential associated with the point at (x.y). • mo geth(x.y) Get the hysteresis/laminated eddy current loss density associated with the point at (x. The return value is a list with two element representing µx and µy for planar problems and µr and µz for axisymmetric problems.y).y) Gets the magnetic field energy density associated with the point at (x.y) Get the magnetic flux density associated with the point at (x.Symbol A B1 B2 Sig E H1 H2 Je Js Mu1 Mu2 Pe Ph ff Definition Potential A or flux φ Bx if planar. For planar problems. Hr if axisymmetric Hy if planar.e. • mo getmu(x. Bz if axisymmetric conductivity σ stored energy density Hx if planar. • mo getph(x. • mo geta(x.y) Get the electric current density associated with the point at (x.y). 15 . Br if axisymmetric By if planar.y).y). • mo getb(x. µr if axisymmetric µy if planar. • mo getenergydensity(x. 2πrA is reported.y). the average fraction of the volume filled with conductor) associated with the point at (x. The return value is a list with two element representing Bx and By for planar problems and Br and Bz for axisymmetric problems. µ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 command would be: mo_makeplot(2. 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. Valid entries for PlotType are: PlotType 0 1 2 3 4 5 6 7 8 Valid file formats are FileFormat 0 1 2 Definition Multi-column text with legend Multi-column text with no legend Mathematica-style formatting Definition Potential |B| B·n B·t |H| H ·n H ·t Jeddy Jsource + Jeddy For example.emf’) To write data instead of a plot to disk.txt’.0) • mo_getprobleminfo Returns info on problem description. the command is instead interpreted as a command to write the data to disk to the specfied file name.200. if one wanted to plot B · n to the screen with 200 points evaluated to make the graph.200) If this plot were to be written to disk as a metafile. If. the plot is instead written to disk to the specified file name as an extended metafile. Six values are returned by the function.NumPoints. in addition. the command is interpreted as a request to plot the requested plot type to the screen. If the FileFormat parameter is also. these parameters are: 16 . Properties are returned for the circuit property named ’circuit’.• mo_makeplot(PlotType. the Filename parameter is specified.Filename. rather than display it to make a graphical plot.200.’c:\temp\myfile. If only PlotType or only PlotType and NumPoints are specified. In order.FileFormat) Allows Octave access to FEMM’s X-Y plot routines.’c:\temp\myfile. the command would be of the form: mo_makeplot(2. the command would be: mo makeplot(2.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Sign up to vote on this title
UsefulNot useful