octavefemm | Matlab | Command Line Interface

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

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

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

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

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

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

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

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

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

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

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

Returns two values: Return value Definition 1 problem type 2 frequency in Hz • mo_getcircuitproperties(’circuit’) Used primarily to obtain impedance information associated with circuit properties. the command is instead interpreted as a command to write the data to disk to the specfied file name. the command would be: mo makeplot(2. the command is interpreted as a request to plot the requested plot type to the screen. the command would be: mo_makeplot(2.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 would be of the form: mo_makeplot(2.NumPoints. the plot is instead written to disk to the specified file name as an extended metafile.txt’.’c:\temp\myfile. in addition.Filename. the Filename parameter is specified.200. Valid entries for PlotType are: PlotType 0 1 2 3 4 5 6 7 8 Valid file formats are FileFormat 0 1 2 Definition Multi-column text with legend Multi-column text with no legend Mathematica-style formatting Definition Potential |B| B·n B·t |H| H ·n H ·t Jeddy Jsource + Jeddy For example. In order. these parameters are: 16 . If only PlotType or only PlotType and NumPoints are specified. Properties are returned for the circuit property named ’circuit’.• mo_makeplot(PlotType.’c:\temp\myfile.emf’) To write data instead of a plot to disk. if one wanted to plot B · n to the screen with 200 points evaluated to make the graph. rather than display it to make a graphical plot. Six values are returned by the function. If the FileFormat parameter is also.200.0) • mo_getprobleminfo Returns info on problem description. If.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 conductor property to be modified is specified by "ConductorName". The various properties that can be modified are listed below: 38 .be applied below: propnum 0 1 2 3 to the specified property. The point property to be modified is specified by "PointName". The various properties that can be modified are listed below: propnum Symbol Description 0 PointName Name of the point property 1 Tp Prescribed nodal temperature 2 qp Point heat generation in W/m • hi modifyconductorprop("ConductorName".value) This function allows for modification of a point property. The last number is the value to be applied to the specified property.value) This function allows for modification of a conductor property. The BC to be modified is specified by "BdryName".value) This function allows for modification of a boundary property.propnum. The next parameter is the number of the property to be set.propnum. The various properties that can be modified are listed Symbol BlockName kx ky qs Description Name of the material x (or r) direction thermal conductivity y (or z) direction thermal conductivity Volume heat generation • hi modifyboundprop("BdryName". The last number is the value to be applied to the specified property. The next parameter is the number of the property to be set.propnum. The 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 parameter should be set to 1. 39 . and the Ri parameter is the radius of the inner region (i. the permeability varies as a function of distance from the origin of the external region. • hi refreshview() Redraws the current view.k) to the thermal conductivity vs. • hi savemetafile("filename") saves a metafile screenshot of the current view to the file specified by "filename". To display the names. • hi shownames(flag) This function allow the user to display or hide the block label names on screen. 8. • hi close() closes the preprocessor window and destroys the current document.Ri) defines an axisymmetric external region to be used in conjuction with the Kelvin Transformation method of modeling unbounded problems. temperature curve for the material specified by "materialname". • hi cleartkpoints("materialname") erases all of the thermal conductivity points that have been defined for the material named "materialname". The Zo parameter is the z-location of the origin of the outer region. • hi readdxf("filename") This function imports a dxf file specified by "filename".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. • hi detachouterspace() undefines all selected block labels as members of the external region used for modeling unbounded axisymmetric problems via the Kelvin Transformation. the region of interest).10 Miscellaneous • hi savebitmap("filename") saves a bitmapped screenshot of the current view to the file specified by "filename". flag should be 0. the Ro parameter is the radius of the outer region. To hide the block label names.k) adds the point (T. • hi defineouterspace(Zo. In the exterior region. subject to the printf-type formatting explained previously for the hi saveas command.Ro. These parameters are necessary to define the permeability variation in the external region. subject to the printf-type formatting explained previously for the hi saveas command.T. • hi attachouterspace() marks all selected block labels as members of the external region used for modeling unbounded axisymmetric problems via the Kelvin Transformation. 1 = Prescribed temperature • hi addtkpoint("materialname".e.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Sign up to vote on this title
UsefulNot useful