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

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

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

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

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

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

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

value) This function allows for modification of a point property. 12 .propnum.i) sets the current in the circuit specified by ’CircName’ to i.value) This function allows for modification of a circuit property. The point property to be modified is specified by ’PointName’. 1 = Series • mi setcurrent(’CircName’. 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 0 1 2 Symbol PointName A J Description Name of the point property Nodal potential. The circuit property to be modified is specified by ’CircName’. MS/m Mixed BC parameter Mixed BC parameter Type of boundary condition: 0 = Prescribed A 1 = Small skin depth 2 = Mixed 3 = Strategic Dual Image 4 = Periodic 5 = Antiperiodic • mi_modifypointprop(’PointName’. Amps • mi_modifycircprop(’CircName’. 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 Symbol CircName i CircType Description Name of the circuit property Total current 0 = Parallel. Weber/Meter Nodal current. 4.10 Miscellaneous • mi savebitmap(’filename’) saves a bitmapped screenshot of the current view to the file specified by ’filename’.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.

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

y) Get the values associated with the point at (x. The function returns an array whose contents are. the 2× results are only relevant for problems where ω = 0.e. in order: 14 . For force and torque results.y). • 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. moment of inertia / density) • mo getpointvalues(x.results.

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

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

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

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

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

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

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

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

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

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

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

value) This function allows for modification of a conductor property.propnum. The various properties that can be modified are listed below: propnum 0 1 2 3 4 5 Symbol BdryName Vs qs c0 c1 BdryFormat Description Name of boundary property Fixed Voltage Prescribed charge density Mixed BC parameter Mixed BC parameter Type of boundary condition: 0 = Prescribed V 1 = Mixed 2 = Surface charge density 3 = Periodic 4 = Antiperiodic • ei modifypointprop(’PointName’. The next parameter is the number of the property to be set.propnum. 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’.propnum 0 1 2 3 Symbol BlockName ex ey qs Description Name of the material x (or r) direction relative permittivity y (or z) direction relative permittivity Volume charge • ei modifyboundprop(’BdryName’. The conductor property to be modified is specified by ’ConductorName’.value) This function allows for modification of a boundary property. 1 = Prescribed voltage 26 . The next parameter is the number of the property to be set. The various properties that can be modified are listed below: propnum Symbol Description 0 ConductorName Name of the conductor property 1 Vc Conductor voltage 2 qc Total conductor charge 3 ConductorType 0 = Prescribed charge. The last number is the value to be applied to the specified property.propnum.value) This function allows for modification of a point property. The last number is the value to be applied to the specified 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 permeability varies as a function of distance from the origin of the external region. To display the names. • ei detachouterspace undefines all selected block labels as members of the external region used for modeling unbounded axisymmetric problems via the Kelvin Transformation.e. These parameters are necessary to define the permeability variation in the external region. the parameter should be set to 1. In the exterior region. • ei shownames(flag) This function allow the user to display or hide the block label names on screen. 7 Electrostatics Post Processor Command Set There are a number of scripting commands designed to operate in the postprocessor. • ei savemetafile(’filename’) saves a metafile screenshot of the current view to the file specified by ’filename’. As with the preprocessor commands. The Zo parameter is the z-location of the origin of the outer region. flag should be 0. 7. the Ro parameter is the radius of the outer region.6. the region of interest). To hide the block label names. • ei close closes the preprocessor window and destroys the current document. • ei readdxf(’filename’) This function imports a dxf file specified by ’filename’. these commands can be used with either the underscore naming or with the no-underscore naming convention. • ei defineouterspace(Zo. and the Ri parameter is the radius of the inner region (i.10 Miscellaneous • ei savebitmap(’filename’) saves a bitmapped screenshot of the current view to the file specified by ’filename’.Ri) defines an axisymmetric external region to be used in conjuction with the Kelvin Transformation method of modeling unbounded problems.Ro. • ei attachouterspace marks all selected block labels as members of the external region used for modeling unbounded axisymmetric problems via the Kelvin Transformation.1 Data Extraction Commands • eo lineintegral(type) Calculates the line integral for the defined contour type 0 1 2 3 4 Integral E ·t D·n Contour length Force from stress tensor Torque from stress tensor 27 . • ei refreshview Redraws the current view.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Sign up to vote on this title
UsefulNot useful