Simscape animation of Mass-spring-damper system

49 次查看(过去 30 天)
Hi.
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
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 个评论
Cosimo Mercuro
Cosimo Mercuro 2023-5-5
编辑:Cosimo Mercuro 2023-5-5
Hi Nathan.
Thanks for your reply.
I've seen yout attached .slx file but is seems that has a very low graphic quality .
Because I need a model to teach mass-spring-damper to my high school students, is there any (easy) way to have graphic like that in my original post?
Nathan Hardenberg
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 CenterFile Exchange 中查找有关 Multibody Modeling 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by