Simscape animation of Mass-spring-damper system

37 ビュー (過去 30 日間)
Cosimo Mercuro
Cosimo Mercuro 2023 年 5 月 5 日
コメント済み: Nathan Hardenberg 2023 年 5 月 6 日
Following this tutorial I've succesfully learned how to build a working mass-sping-damper mode in Simscape:
Anyway, I'd like to simulate the real beahaviour creating anything like this:
The question is:
Is it possible in Simscape, and if yes, how?
Any idea ?
Thanks in advance.

回答 (1 件)

Nathan Hardenberg
Nathan Hardenberg 2023 年 5 月 5 日
Yes this can be done, but there are multiple ways of doing this.
For once you can use the Block "Spring and Damper Force". There you can set the inital length, Spring siffness and Damping Coefficient. Just connect two not ridgidly connected frames. With this setting the initial position to be not in the relaxed state seems to be a bit tricky.
The in my opinion smarter way is to use a "Prismatic Joint" Block only. In the block settings you can directly define Equilibrium Position, Spring Stiffness and Damping Coefficient. By Setting Equilibrium Position to a Value other than 0 you set up the spring-damper-system in a non relaxed state (which is in your case desired).
The attachment is simulink-file with two prismatic joints set up in a way like your example.
  3 件のコメント
Nathan Hardenberg
Nathan Hardenberg 2023 年 5 月 6 日
No this is not possible in Simscape! If you want to create a pretty animation you have to do this with a matlab skript and not in simulink. Doing this is probably not as easy as you like.
But I found the following, which might already be the solution you are looking for, or at least something you can look into:
When you really want to use the Simscape simulation, you could send the displacement values of the simulation to the matlab workspace and then animate those. This has the disatvantage of having to always run the simulate first



Help Center および File ExchangeAssembly についてさらに検索




Community Treasure Hunt

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

Start Hunting!

Translated by