How to give initial velocity to a body in Simscape?

조회 수: 9 (최근 30일)
Divyansh Gupta
Divyansh Gupta 2022년 7월 6일
답변: Karan Singh 2023년 9월 29일
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에서 Assembly에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by