Excel with MagNet
This Gallery page provides a good example of how you can customize and automate the construction of your models, and how easily this can be accomplished using MagNet’s ActiveX® capabilities in tandem with Microsoft® Excel. The data (column F in the illustration to the left) entered in the Excel spreadsheet is used to build a Switch Reluctance Motor (SRM) in MagNet. To the right of the data in column F are the lists of possible values for the Stator Poles, Length Unit, Rotor Poles, and Lamination Materials, along with the permissible Stator Poles-to-Rotor Poles combinations. What follows is a description of the various stages in the process.
Results
|
| Click image to see full size version |
- length unit - Unit
- number of stator poles - ns (validated)
- stator outer radius - stator (validated)
- radius of stator slot bottom - statslotr (validated)
- stator pole arc (in mechanical degrees) - betaS (validated)
- number of turns/coil - turns (validated)
- peak winding current (A) - AMP (validated)
- airgap length - gap (validated)
- active length of motor - Length (validated)
- number of rotor poles - nr (validated)
- rotor outer radius - r1 (validated)
- radius of rotor slot bottom - r0 (validated)
- rotor pole arc (in mechanical degrees) - betaR (validated)
- lamination material - Material
|
| Click image to see full size version |
Once the data has been validated, MagNet is opened. It sets the default length unit (in this example, millimetre) and then proceeds to build the Stator component using the following variables, scripting commands, and constants:
- r1 = 50.00
- gap = 2.00
- ns = 4
- Material = MU3
Variables
- Scripting commands - addRotation, deleteSelection, makeComponentInALine, newArc, newCircle, newLine, redraw, selectAt, selectAtWithObjectCode, selectScaledToFit, viewAll
Constants - infoSetSelection, infoSliceSurface
|
| Click image to see full size version |
- nr = 6
- r0 = 30.00
- r1 = 50.00
- Material = MU3
Variables
- Scripting commands - deleteSelection, getCurrentView, getDocument, makeComponentInALine, newArc, newLine, redraw, selectAll, selectAt
Constants - infoSetSelection, infoSliceLine, infoSliceSurface
|
| Click image to see full size version |
- Variables
- ns = 4
- Length = 80.00
- Scripting commands - deleteSelection, getCurrentView, getDocument, getSlice, makeCoil, makeComponentInALine, makeComponentInAnArc, moveInALine, newCircle, newLine, redraw, rotateComponent, selectAll, selectAt, selectDeviceObject, viewAll
Constants - infoSetSelection, infoSliceArc, infoSliceLine, infoSliceSurface
|
| Click image to see full size version |
- Scripting commands - createAnimation, createAnimationFrame, setScaledToFit, solveStatic2D, viewMagnetostaticFields


