How to use position input in simscape multibody

3 views (last 30 days)
Please, I need some help.
Probably it is an easy task. I am trying to simulate a basic system on simscape multibody very similar to a double pendulum using revolute joints. I have the angle of the pendulum at specific points in time and I am trying to make it move using those values as an input to revolute joint. I can do it for a fixed value like 10 degrees and it maintain the 10 degrees the whole simulation now I want to use the values on a vector that varies at .1s. How could I do it? This is what I do for constant values.

Answers (2)

Steve Miller
Steve Miller on 18 Nov 2022
If you put an integrator block between the Constant block and the Simulink-PS block, your input to the joint will increase linearly with time. The block is expecting you in this configuration to specify the angle, so increase the angle at the rate you wish the joint to spin.
--Steve

Divesh Shet
Divesh Shet on 9 Dec 2022
Edited: Divesh Shet on 9 Dec 2022
For this particular case, of linealy varying input you can follow simple approach of adding an integrator block as steve pointed out. However if you want to give more complex input you may use a MATLAB function block and create desired function in it. you may also make use of clock - simulink block and wire it as input to MATLAB function block, as indicated in the figure below.
Sample code for complex input generating function:

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!