How to give initial velocity to a body in Simscape?

12 次查看(过去 30 天)
I am trying to simulate a double inverted pendulum (similar model) and I would like to give an initial velocity to mass 2. I have set other initial conditions for the model including initial angles but I am unable to give initial velocity to the model. I want the motion for the revolute joint (theta 2) to be automatically computed so can't add signal input to the joint.
Let me know if it is possible to do this in Simscape Models?

回答(1 个)

Karan Singh
Karan Singh 2023-9-29
Hi Divyansh,
From what I understand, the goal is to provide an initial velocity for mass 2, which is part of the double inverted pendulum model. However, the challenge is to assign an initial velocity to mass 2 without directly adding a signal input to the revolute joint representing mass 2.
You can achieve this by modifying the Simulink model as follows:
  1. Add a Zero-Order Hold block to the model.
  2. Connect the output of the Zero-Order Hold block to the input of the revolute joint representing mass 2 (theta 2).
  3. Configure the Zero-Order Hold block to hold the initial velocity value you desire.
Here is it step by step:
  1. From the Simulink Library Browser, locate the Signal Attributes category and expand it.
  2. Drag and drop the Zero-Order Hold block into your model.
  3. Connect the output of the Zero-Order Hold block to the input of the revolute joint representing mass 2 (theta 2).
  4. Double-click on the Zero-Order Hold block to open its block parameters.
  5. In the block parameters, set the Initial condition to the desired initial velocity value for mass 2.
The Zero-Order Hold block will hold the initial velocity value until the simulation starts.
Attached below are some documentation links that you may find helpful:
Hope this helps!
Karan Singh Khati

类别

Help CenterFile Exchange 中查找有关 Multibody Dynamics 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by