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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

in order. 2x frequency component Weighted Stress Tensor torque.y The return values.11. 2x frequency component Returns a value that can be complex. DC component y (or z) direction Weighted Stress Tensor force. 2x frequency component y (or z) direction Weighted Stress Tensor force. e. are: 52 .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.g. depending on the integral type. DC component Weighted Stress Tensor torque. DC component x (or r) direction Weighted Stress Tensor force. : Fx. Fy = co lineintegral(4) • co blockintegral(type) Calculate a block integral for the selected blocks type 0 1 2 3 4 5 6 7 8 9 10 11 Integral Real Power Reactive Power Apparent Power Time-Average Stored Energy Block cross-section area Block volume x (or r) direction Weighted Stress Tensor force. • co getpointvalues(X.Y) Get the values associated with the point at x. as necessary.

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

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

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

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

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

Sign up to vote on this title
UsefulNot useful