Borrar filtros
Borrar filtros

Simscape animation of Mass-spring-damper system

32 visualizaciones (últimos 30 días)
Cosimo Mercuro
Cosimo Mercuro el 5 de Mayo de 2023
Comentada: Nathan Hardenberg el 6 de Mayo de 2023
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.

Respuestas (1)

Nathan Hardenberg
Nathan Hardenberg el 5 de Mayo de 2023
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 comentarios
Cosimo Mercuro
Cosimo Mercuro el 5 de Mayo de 2023
Editada: Cosimo Mercuro el 5 de Mayo de 2023
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
Nathan Hardenberg el 6 de Mayo de 2023
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

Iniciar sesión para comentar.

Categorías

Más información sobre Assembly en Help Center y File Exchange.

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by