Information Center

Product Selector

Choose the right software for your design & analysis needs.

Loudspeaker analysis -- Automation

In this gallery page, we will show five examples that use scripting to analyze loudspeakers:

  • The first example is a script written in VBscript and runs directly from MagNet -- the input data is programmed in the script itself.
  • The second still runs from MagNet but uses a scripting form for parameter input.
  • <;>The third is a program written in Excel and VBA, and shows how the user can control MagNet from an external application, such as Excel or MATLAB.
  • The last two examples (4a and 4b)show a Visual Basic program that provides its own interface and runs MagNet in the background. The program extracts the data from MagNet and displays the results in its own display window.


Examples

Click image to see full size version
Example #1 A script written in VBScript.

Click image to see full size version
Example #2 The previous example is limited since the end user needs to know some programming and the parameters have to be changed in the program. The next level of scripting uses a scripting form for the parameter input. This illustration shows a form for generating loudspeaker geometry.

The underlying program uses the same program code, as in example #1, to generate the final model.

Click image to see full size version
Example #3 This example uses an Excel spreadsheet as an interface to MagNet. The geometric parameters are taken from the spreadsheet, or calculated and placed in cells of the spreadsheet. A macro or button can be created to generate the geometry building code that is attached to the spreadsheet. This programming code can be the same as the one used for the original example, with the added flexibility of having parameter inputs in a spreadsheet format. Since many engineers use spreadsheets for their basic calculations, this method can prove to be a very practical approach.

To build the speaker model with this spreadsheet, the user enters the data in the appropriate cells, and then clicks the “Build Loudspeaker” button to build the geometry.

 

Click image to see full size version
Example #4a An alternative application of scripting is the use of a stand-alone program with its own user interface.

This type of application of scripting is particularly useful when the program designer wants to build a program that acts as a shell over the MagNet program. All of the user interaction in that case is done through the program interface, thereby “hiding” the actual finite element analysis.

The results of selecting the "Build Loudspeaker" button are shown here.

 

Click image to see full size version
Example #4b This example shows the result of pressing the "Flux Density Analysis" button in the stand-alone program.