Example: biology

Finite Element Method Magnetics: OctaveFEMM

Finite Element Method Magnetics: OctaveFEMMV ersion s ManualOctober 16, 2010 David 20061 IntroductionOctaveFEMM is a Matlab toolbox that allows for the operationof Finite Element Method Magnet-ics (FEMM) via a set of Matlab functions. The toolbox works with Octave, a Matlab OctaveFEMM starts up a FEMM process, the usual FEMM userinterface is displayedand is fully functional. The user then has the choice of accomplishing modeling and analysis taskseither exclusively through functions implemented by the toolbox, or by a combination of manualand programmatic operations whichever is easiest for the task at syntax of the OctaveFEMM toolbox closely mirrors that ofFEMM s existing Lua scriptinglanguage interface associated with FEMM However, there are some differences between theLua functions and the analogous Octave/Matlab implementations: All strings are enclosed in single quotes, rather than double quotes as in Lua.

1 Introduction OctaveFEMM is a Matlab toolbox that allows for the operation of Finite Element Method Magnet-ics (FEMM) via a set of Matlab functions. The toolbox works with Octave, a Matlab clone. When OctaveFEMM starts up a FEMM process, the usual FEMM user interface is displayed and is fully functional.

Tags:

  Introduction, Methods, Elements, Finite, Finite element method

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Finite Element Method Magnetics: OctaveFEMM

1 Finite Element Method Magnetics: OctaveFEMMV ersion s ManualOctober 16, 2010 David 20061 IntroductionOctaveFEMM is a Matlab toolbox that allows for the operationof Finite Element Method Magnet-ics (FEMM) via a set of Matlab functions. The toolbox works with Octave, a Matlab OctaveFEMM starts up a FEMM process, the usual FEMM userinterface is displayedand is fully functional. The user then has the choice of accomplishing modeling and analysis taskseither exclusively through functions implemented by the toolbox, or by a combination of manualand programmatic operations whichever is easiest for the task at syntax of the OctaveFEMM toolbox closely mirrors that ofFEMM s existing Lua scriptinglanguage interface associated with FEMM However, there are some differences between theLua functions and the analogous Octave/Matlab implementations: All strings are enclosed in single quotes, rather than double quotes as in Lua.

2 Functions in Lua that have no arguments require a set of emptyparentheses after the functionname ( ()). In Octave or Matlab, no parentheses should be used needed ( the OctaveFEMM toolbox). Several commands have also been added to OctaveFEMM that have no analog in Lua. Thesecommands streamline the drawing of new geometries with the OctaveFEMM toolbox, aswell is the collection of data from the most remarkable difference between Lua and OctaveFEMM , however, is due tothe matrix-oriented nature of Octave/Matlab. In just aboutany OctaveFEMM function in whichit would be desiable to enter an array of points such that multiple copies of an operation are per-formed, OctaveFEMM will correctly interpret the input perform the requested operation on everyelement 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 sepa-rately.

3 In functions that require the specification of multiple points, those points can be entered asan array of two- Element Installation and Installation for Matlab and Octave 3 The OctaveFEMM distribution is automatically installed with FEMM in themfilessubdirec-tory. The absolute directory is typicallyc:\Program Files\femm42\mfiles. To use Octave-FEMM with Octave or Matlab, this path needs to be added to the program s search path. To addthis path to the search path, type the following lines at the Matlab or Octave commandprompt:addpath( c:\\progra 1\\femm42\\mfiles );savepath;Alternatively, in Matlab, the interactivepathtoolcommand can be used to add themfilesdirectory to the search Installation for Octave and Octave is recommended that you use a newer version of Octave that has support for theactxserverfunction. If this function exists, Octave will use ActiveX automation to communication withFEMM.

4 However, OctaveFEMM can still be used with versions ofOctave ( ) that do not support ActiveX. Ifactxserveris not available, a much slower interpro-cess communication mechanism based on temporary files will be , to use OctaveFEMM , the directory where the OctaveFEMM mfiles are located mustbe permanently added to the search path. This directory can be added to the search path by anappropriate modification of file. For example, in the Octave , Octave looks the directory:C:\Program Files\GNU Octave \octave_filesTo insert OctaveFEMM into the search path, one can create fileand add theline:LOADPATH = [ /cygdrive/c/progra 1/femm42/mfiles// , LOADPATH ];to add the directory containing the OctaveFEMM commands to the Octave search StartupTo start an OctaveFEMM session, use theopenfemmfunction. This function starts up a FEMM process to which OctaveFEMM calls are sent.

5 When done with OctaveFEMM , the FEMM processcan be shut down via number of examples that use OctaveFEMM to analyze various problems are included in thedirectorycd c:\Program Files\femm42\examples3 Common Command SetThere are a number of FEMM-specific Octave that are not associated with any particular prob-lem type. These functions manipulate the appearance of the main window and other top-levelcomponents like the Lua console and Point Properties outputwindow. clearconsoleClears the output window of the Lua console. newdocument(doctype)Creates a new preprocessor document and opens up a new prepro-cessor window. Specifydoctypeto be0for a magnetics problem,1for an electrostaticsproblem,2for a heat flow problem, or3for a current flow problem. Alternative syntax forthis function iscreate(doctype) hideconsoleHides the floating Lua console window.

6 HidepointpropsHides the floating FEMM Properties display window. messagebox( message )displays the message string to the screen in a pop-up messagebox. opendocument( filename )Opens a document specified print(item1,item2,..)This is standard Lua print command directed to the output ofthe Lua console window. Any number of comma-separated itemscan be printed at once viathe print command. prompt( message )This function allows a FEMM script to prompt a user for command is used, a dialog box pops up with the message string on the title bar of thedialog box. The user can enter in a single line of input via thedialog box. Prompt returnsthe user s input to Octave and parses it using Octave sevalcommand. showconsoleDisplays the floating Lua console window. showpointpropsDisplays the floating FEMM Properties display window. mainminimizeminimizes the main FEMM window.

7 Mainmaximizemaximizes the main FEMM window. mainrestorerestores the main FEMM window from a minimized or maximized state. mainresize(width,height)resizes the main FEMM window client area to width Magnetics Preprocessor Command SetA number of different commands are available in the Object Add/Remove Commands miaddnode(x,y)Add a new node at x,y miaddsegment(x1,y1,x2,y2)Add a new line segment from node closest to (x1,y1) tonode closest to (x2,y2) miaddblocklabel(x,y)Add a new block label at (x,y) miaddarc(x1,y1,x2,y2,angle,maxseg)Add a new arc segment from the nearest nodeto (x1,y1) to the nearest node to (x2,y2) with angle angle divided into maxseg segments. midrawline(x1,y1,x2,y2)Adds nodes at (x1,y1) and (x2,y2) and adds a line betweenthe nodes. midrawpolyline([x1,y1;x2,y2 ..])Adds nodes at each of the specified points andconnects them with segments.

8 Midrawpolygon([x1,y1;x2,y2 ..])Adds nodes at each of the specified points andconnects them with segments to form a closed contour. midrawarc(x1,y1,x2,y2,angle,maxseg)Adds nodes at (x1,y1) and (x2,y2) and addsan arc of the specified angle and discretization connecting the midrawrectangle(x1,y1,x2,y2)Adds nodes at the corners of a rectangle defined by thepoints (x1,y1) and (x2,y2), then adds segments connecting the corners of the rectangle. mideleteselectedDelete all selected objects. mideleteselectednodesDelete selected nodes. mideleteselectedlabelsDelete selected block labels. mideleteselectedsegmentsDelete selected segments. mideleteselectedarcsegmentsDelete selects Geometry Selection Commands miclearselectedClear all selected nodes, blocks, segments and arc segments. miselectsegment(x,y)Select the line segment closest to (x,y) miselectnode(x,y)Select the node closest to (x,y).

9 Returns the coordinates ofthe se-lected node. miselectlabel(x,y)Select the label closet to (x,y). Returns the coordinates ofthe se-lected label. miselectarcsegment(x,y)Select the arc segment closest to (x,y) miselectgroup(n)Select thenthgroup of nodes, segments, arc segments and function will clear all previously selected elements and leave the editmode in 4 (group) Object Labeling Commands misetnodeprop( propname ,groupno)Set the selected nodes to have the nodal property propname and group numbergroupno. misetblockprop( 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 inmeshsize, 1 = mesherautomatically chooses the mesh density. meshsize: size constraint on the mesh in the block marked by this label.

10 Block is a member of the circuit named incircuit The magnetization is directed along an angle in measured in degrees denoted by theparametermagdir A member of group numbergroup The number of turns associated with this label is denoted misetsegmentprop( propname , elementsize, automesh, hide, group)Set the se-lected segments to have: Boundary property propname Local Element size along segment no greater thanelementsize automesh: 0 = mesher defers to the Element constraint defined byelementsize, 1 =mesher automatically chooses mesh size along the selected segments hide: 0 = not hidden in post-processor, 1 == hidden in post processor A member of group numbergroup misetarcsegmentprop(maxsegdeg, propname , hide, group)Set the selected arcsegments to: Meshed with elements that span at mostmaxsegdegdegrees per Element Boundary property propname hide: 0 = not hidden in post-processor, 1 == hidden in post processor A member of group numbergroup misetgroup(n)Set the group associated of the selected items to Problem Commands miprobdef(freq,units,type,precision,dept h,minangle,(acsolver))changes theproblem definition.


Related search queries