Setting Up an External Circuit Using Simulink
In addition to using the Maxwell Circuit Editor to set up an external circuit, you also can use MATLAB® Simulink® to set up an external circuit for both Maxwell 2D and 3D transient designs.
Supported Simulink versions are
- R2019b
- R2020a
- R2020b
- R2021a
- R2021b
- R2022a
- R2022b
- R2023a
In addition to winding sources, motion sources can also be linked in the external circuit.
- Winding sources ("External" type only): voltage, current, and flux linkage.
- Motion sources: speed, position, and force/torque
To set up an external circuit using Simulink:
-
In the Maxwell Project Manager, right-click Excitations and select Setup Cosimulation with Simulink to open the Setup Cosimulation with Simulink dialog box. You can also open the dialog box from the main Maxwell 2D or 3D > Excitations menu. If an external Simulink circuit has already been created and linked, To Simulink and From Simulink connections information is shown. Otherwise, these table cells are empty.
-
On the Maxwell-Simulink Link tab, click the Edit Circuit button to launch Simulink. The Maxwell sources are listed in the in the Maxwell Link Assignment Dialog box. If a circuit has already been created, the circuit also displays in the Simulink circuit editor window.
-
Add Link SIMULINK - IN and SIMULINK- OUT connections to the desired Maxwell parameters to set up the Maxwell component ports. You can also Unlink connections as needed. Click OK once the ports are set up. The ports will show in the Simulink circuit editor window.
If changes are needed, click Edit Circuit to reopen the Maxwell Link Assignment dialog box.
-
Modify (or create) the circuit in the Simulink circuit editor window as needed, and save the Simulink circuit project.
-
In the Maxwell Setup Cosimulation with Simulink dialog box, click the Import Circuit button to import the Simulink circuit project into the Maxwell project. The linked connections appear in the Edit External Circuit dialog box. The Circuit Path tab shows the path to the location from which the Simulink circuit file was imported.
Note: You can also modify an existing Simulink circuit by opening the circuit file directly in Simulink, and then importing the modified circuit file back into the Maxwell design. - When you start the Maxwell design analysis, the cosimulations are started between Maxwell and Simulink.
- Making changes to the Maxwell winding and motion setups invalidate the external circuit.
- Making changes to the external Simulink circuit setup invalidates the solutions.
Related Topics
Setting Up an External Circuit Using the Maxwell Circuit Editor