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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Sign up to vote on this title
UsefulNot useful