Getting Started with the MapleSimConnector for JMAG-RT

Copyright © Maplesoft, a division of Waterloo Maple Inc.
2023

Getting Started with the MapleSim Connector for JMAG-RT
Copyright
Maplesoft, Maple, and MapleSim are all trademarks of Waterloo Maple Inc.
© Maplesoft, a division of Waterloo Maple Inc. 2012-2023. All rights reserved.
No part of this book may be reproduced, stored in a retrieval system, or transcribed, in any form or by any means — electronic, mechanical, photocopying, recording, or otherwise. Information in this document is subject to change without notice and does not represent a commitment on the partof the vendor. The software described in this document is furnished under a license agreement and may be used or copied only in accordance withthe agreement. It is against the law to copy the software on any medium except as specifically allowed in the agreement.
JMAG is a registered trademark by JSOL Corp. in the US and other countries.
MATLAB and Simulink are registered trademarks of The MathWorks, Inc.
Linux is a registered trademark of Linus Torvalds.
Microsoft, Windows, Windows Server, Windows Vista, Excel, and Internet Explorer are registered trademarks of Microsoft Corporation.
All other trademarks are the property of their respective owners.
This document was produced using Maple and DocBook.

ContentsIntroduction ..................................................................................................................................... iv
1 Getting Started ................................................................................................................................. 1
1.1 Generating a JMAG-RT Motor File ................................................................................................ 1
1.2 Configuring MapleSim to Use the JMAG-RT Motor File .................................................................... 1
1.3 Running Your Simulation ............................................................................................................. 2iii

Introduction
The MapleSim™ Connector for JMAG-RT simulation package provides all of the tools you need to import JMAG®RT motor files into your MapleSim model and then use them as a component in your simulations.

Scope of Model Support
MapleSim is a comprehensive modeling tool where it is possible to create models that could go beyond the scope of
this Connector. In general, the MapleSim Connector for JMAG-RT supports systems of any complexity, including
systems of DAEs of any index, in any mix of domains.

Requirements
Requires JMAG-Designer version 19.0.
Also requires Microsoft Visual Studio.
For details on supported platforms and a complete list of system requirements, visit the Maplesoft System Requirements
website at http://www.maplesoft.com/products/system_requirements.aspx.
For installation instructions, see the Install.html file on the product disc or the website at
http://www.maplesoft.com/documentation_center/installation_instructions.aspx.

Library Requirements for Other Connectors
You can export your model with a JMAG-RT component to other systems using other MapleSim connectors. For example, you can export your model to Simulink® as an S-function block using the MapleSim™ Connector or you canexport your model as an FMU archive file using the MapleSim FMI Connector.
In order to do this, you first need to add the directory that contains the JMAG-RT library file (either RTTCalculator.dll
or libRTTCalculator.so) to your search path. This involves appending this directory to either your PATH environment
variable (for Windows) or your LD_LIBRARY_PATH environment variable (for Linux).
To add the JMAG-RT library directory to your search path
1. Determine your Maple installation directory.
If you are not sure where Maple is installed, perform the following steps.
a. Start Maple.
b. At the command prompt, enter the following command:kernelopts(mapledir);The output of kernelopts(mapledir) is the installation directory for Maple. We will refer this directory as $MAPLE
for this procedure.
2. Determine the directory that contains the JMAG-RT library file for your operating system from the table below.
Operating System
64-bit Windows
64-bit Linux

Directory$MAPLE\toolbox\JMAGRTConnector\bin.X86_64_WINDOWS$MAPLE/toolbox/JMAGRTConnector/bin.X86_64_LINUX

Note: $MAPLE is your Maple installation directory, found in step 1.
3. Add the library directory found in step 2 to the appropriate environment variable for your operating system.
• For Windows, add the library directory to your PATH environment variable.

iv

Introduction• For Linux, add the library directory to your LD_LIBRARY_PATH environment variable.
Consult the help for your operating system for instructions on how to edit these environment variables.
4. Restart your computer.

1 Getting Started
This chapter describes how to use the MapleSim Connector for JMAG-RT. With this connector you configure a JMAGRT component with a motor file created in JMAG-RT (that is, an .rtt file) and then use the component in your simulations.
This is accomplished by performing the following steps.
1. Generating a JMAG-RT Motor File (page 1)
2. Configuring MapleSim to Use the JMAG-RT Motor File (page 1)
3. Running Your Simulation (page 2)
For information about the JMAG-RT components, refer to the MapleSimJMAGRTConnector,Overview help page.

1.1 Generating a JMAG-RT Motor File
After you have configured your motor in JMAG-RT, save the model as an .rtt file. The MapleSim Connector for JMAGRT works directly with this file.

1.2 Configuring MapleSim to Use the JMAG-RT Motor File
The code in the .rtt file is used by the JMAG-RT component to model your motor. In order for MapleSim to use thiscode, the .rtt file must first be attached to the model, and then the JMAG-RT component has to be configured to usethe file.
To configure MapleSim to use the JMAG-RT motor file:
1. Open or build the MapleSim model in which you want to use the JMAG-RT motor file.
2. Select the Attached Files tab ().

3. Right-click Documents, and then select Attach File.
4. Browse to the location of the .rtt motor file, select it, and then click Attach....
The motor file is attached to your MapleSim model in the Documents palette.
5. Select the Library Components tab (), expand the JMAG palette, open either the Rotational or Translational
sub-palette, and then drag the desired JMAG-RT component on to the Model Workspace.
6. Select the JMAG-RT component.
7. Select the Properties tab (the rtt_filename list.

), open the Parameters > General section, and then select the attached .rtt file from

8. Connect the JMAG-RT component to the other components in your model.
The JMAG-RT component is configured to simulate your motor in MapleSim using the attached motor file. To
have the motor file available for future simulations, save your MapleSim model.
Note:
All JMAG-RT components have an optional support connection which provides a second 1D mechanical flange sothat the torque/force generated by the component is applied between the two flanges.
• To enable the support connection, select the JMAG-RT component, select the Properties tab (Parameters > General section, and then select use support.

1), open the2 • Getting Started

1.3 Running Your Simulation
After you have built your model with the JMAG-RT component connected, you can run your simulation.
To run your simulation
1. Select the Settings tab ().

2. Select Fixed from the Solver Type list.
3. Click Run Simulation () in the Main Toolbar.

When the simulation is complete, a graph for each specified quantity is displayed in the Simulation Results tabof the Analysis window.
For more information on MapleSim, building MapleSim models, attaching files to MapleSim models, and simulating
a model with MapleSim, see the MapleSim Help system.
Note: If you plan to export your MapleSim model using another MapleSim connector, see Library Requirements for
Other Connectors (page iv) for instructions on how to add the path to the JMAG-RT library file to your search path.