Simscape multibody model is not following simulink output
2 views (last 30 days)
Omar Valladolid on 27 Apr 2021
I'm facing an unexpected behavior in my Simscape Multibody model (File attached).
I'm trying to build a model in Simscape Multibody that can represent the motion of two pendulums at the same time, one using linear equation of motion and the other using non-linear equation of motion, both starting at the same angle. Both equations are modeled in Simulink by block diagrams just as in the Matlab example called "Single Pendulum in Simulink and Simscape Multibody" (I took this example as a reference).
The Simulink model is passing the values of θ through variables defined in the second inetgrator (see Figure 1, highligthed in yellow) to the revolute joints of the pendulums modeled in Simscape Multimody.
Figure 1: Pendulum Linear tranfer function (top) and pendulum non-linear transfer function (bottom).
I was expecting to see a difference in the angular position θ according to the Simulink output (Figure 2), but the motion is the same for both cases linear and non-linear in the Simscape Multibody model (Figure 3).
Figure 1: Simulink output - Output 1 is linear equation, output 2 is non-linear equation.
Figure 2: Simscape multibody output - The output in the model is the same for linear and non-linear.
I would like to know why the Simscape Multibody is having the same output when the linear motion should be different
Hope you can help.
Edited: Vasco Lenzi on 3 May 2021
Simscape Multibody is an add on to Simscape and Simulink, and it works within the Simulink blank canvas, but his simulations are not "controlled" by Simulink signals in your case. Since in that model they are not connected by any signal, the two circuit (Simulink and Simscape Multibody) are completely independent.
One uses signals as an approach and solves differential equation (Simulink). Simscape Multibody instead uses phyiscal connection where you connect components together. Every component has an equation, and when you click "play" the system level equation is derived and implemented. The shipping example comparing Simulink and Simscape Multibody is there to showcase how two completely indipendent modeling approaches but with the same components/parameters will still give the same simulation results.
Try as well to completely cancel the Simulink part: the Simscape Multibody model will run just fine on his own.
Understanding how the Simscape simulation works is key to understand all your difficulties. Please follow-up on this links:
Basic Principles of Modeling Physical Networks
Analyze a Simple Pendulum
More Answers (1)
Your file doesn't work out of the box because the variable declaration or the data dictionary are missing. Can you add the parameter declaration? In the meantime I used the parameters from the shipping example you shared "Single Pendulum in Simulink and Simscape Multibody"
I noticed that your two revolute joints in Multibody are configured eactly the same. How are you expecting something different? Where do you plan to implement the non-inearity? I see that in Simulink you added a sinus to the angle feedback for the non-linear system. Right now that would be more convoluted to implement in Multibody, because off-the-shelf you can only parametrize linear mechanics element such as spring and damping:
If you want to implement a non-linear loss function, you have to program it by hand
hope this helps!