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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

y).direction component of displacement y. an array with two elements is returned representing force in the x and y or r and z directions. the function returns an array with two elements is returned representing components in the x and y or r and z directions.y). The return value is a list with two element representing Dx and Dy for planar problems and Dr and Dz for axisymmetric problems.y). The return value is a list with two element representing εx and εy for planar problems and εr and εz for axisymmetric problems. • eo getd(x.y) Gets the values associated with the point at (x.y) Gets the electric field energy density associated with the point at (x. and torque.y) Gets the electric flux density associated with the point at (x.y) Gets the electric field intensity associated with the point at (x. • eo getperm(x. D and E.or r. The function returns an array of results whose elements represent: Symbol V Dx Dy Ex Ey ex ey nrg Definition Voltage x. The return value is a list with two element representing Ex and Ey for planar problems and Er and Ez for axisymmetric problems.or z. 28 . • eo getpointvalues(x.or z.direction component of electric field intensity y.This integral a single result for field intensity. flux density.or z.or r.y) Gets the voltage associated with the point at (x. y). contour length. For force.direction component of electric field intensity x. volume and torque.y).or r.y) Gets the electric permittivity associated with the point at (x. • eo blockintegral(type) Calculates a block integral for the selected blocks type 0 1 2 3 4 5 6 Integral Stored Energy Block Cross-section Block Volume Average D over the block Average E over the block Weighted Stress Tensor Force Weighted Stress Tensor Torque This integral a single result for energy.direction component of permittivity electric field energy density • eo getv(x.y). For force. • eo gete(x. • eo getenergydensity(x.direction component of permittivity y.direction component of displacement x.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Sign up to vote on this title
UsefulNot useful