Hi N/A,
I understand from your issue that you need to create a Simulink block that simulates the behavior of your defined Equations of Motion (EoMs). It cannot be done directly from the code that you have written. However,you can do it by implementing the same equations directly in Simulink. You can find the following steps to achieve the same:
- Create a Subsystem by using the Subsystem block (available at Simulink / Ports & Subsystems).
- Use the same number of Inport blocks (available at Simulink / Ports & Subsystems) and Outport blocks (available at Simulink / Ports & Subsystems) in the subsystem as the number of inputs and outputs for the block to implement the equations.
- Implement the equations in the Subsystem using various blocks of Simulink.
- Create a "Mask" for the subsystem and define the parameters and their properties.
- Create a custom library and put your block in the library for future use.
You can find further information on "Create Custom Library" , "Create Block Masks" in the following documentations.
- "Create Custom Library" : https://www.mathworks.com/help/simulink/ug/creating-block-libraries.html
- "Create Block Masks" : https://www.mathworks.com/help/simulink/block-masks.html
Hope this helps in resolving the issue.