P. 1
octavefemm

octavefemm

|Views: 437|Likes:
Published by abdo-dz

More info:

Published by: abdo-dz on Mar 06, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

01/21/2014

pdf

text

original

Sections

  • 1 Introduction
  • 2 Installation and Startup
  • 4.1 Object Add/Remove Commands
  • 4.2 Geometry Selection Commands
  • 4.3 Object Labeling Commands
  • 4.4 Problem Commands
  • 4.5 Mesh Commands
  • 4.6 Editing Commands
  • 4.7 Zoom Commands
  • 4.8 View Commands
  • 4.9 Object Properties
  • 4.10 Miscellaneous
  • 5.1 Data Extraction Commands
  • 5.2 Selection Commands
  • 5.3 Zoom Commands
  • 5.4 View Commands
  • 5.5 Miscellaneous
  • 6.1 Object Add/Remove Commands
  • 6.2 Geometry Selection Commands
  • 6.3 Object Labeling Commands
  • 6.4 Problem Commands
  • 6.5 Mesh Commands
  • 6.6 Editing Commands
  • 6.7 Zoom Commands
  • 6.8 View Commands
  • 6.9 Object Properties
  • 6.10 Miscellaneous
  • 7.1 Data Extraction Commands
  • 7.2 Selection Commands
  • 7.3 Zoom Commands
  • 7.4 View Commands
  • 7.5 Miscellaneous
  • 8.1 Object Add/Remove Commands
  • 8.2 Geometry Selection Commands
  • 8.3 Object Labeling Commands
  • 8.4 Problem Commands
  • 8.5 Mesh Commands
  • 8.6 Editing Commands
  • 8.7 Zoom Commands
  • 8.8 View Commands
  • 8.9 Object Properties
  • 8.10 Miscellaneous
  • 9.1 Data Extraction Commands
  • 9.2 Selection Commands
  • 9.3 Zoom Commands
  • 9.4 View Commands
  • 9.5 Miscellaneous
  • 10.1 Object Add/Remove Commands
  • 10.2 Geometry Selection Commands
  • 10.3 Object Labeling Commands
  • 10.4 Problem Commands
  • 10.5 Mesh Commands
  • 10.6 Editing Commands
  • 10.7 Zoom Commands
  • 10.8 View Commands
  • 10.9 Object Properties
  • 10.10 Miscellaneous
  • 11.1 Data Extraction Commands
  • 11.2 Selection Commands
  • 11.3 Zoom Commands
  • 11.4 View Commands
  • 11.5 Miscellaneous

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

y2). • ei hidegrid Hide the grid points points. 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.– ’nodes’ . • ei resize(width.height) resizes the active electrostatics input window client area to width × height. • ei setgrid(density. • ei zoomout zooms out by a factor of 50%.nodes – ’segments’ .line segments – ’arcsegments’ .y1) to the top right corner specified by (x2. • ei refreshview Redraws the current view.y2) Set the display area to be from the bottom left corner specified by (x1.8 View Commands • ei showgrid Show the grid points.x2. • 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. 24 . if they are used WITHOUT the editaction parameter. • ei minimize minimizes the active electrostatics input view.selected group This command will affect all subsequent uses of the other editing commands. • ei zoom(x1. 6.y1.’type’) Change the grid spacing. • ei maximize maximizes the active electrostatics input view.arc segments – ’blocks’ .block labels – ’group’ . The density parameter specifies the space between grid points. • ei zoomin zoom in by a factor of 200%.7 Zoom Commands • ei zoomnatural zooms to a “natural” view with sensible extents. 6.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->