Simscape animation of Mass-spring-damper system

43 visualizzazioni (ultimi 30 giorni)
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.

Risposte (1)

Nathan Hardenberg
Nathan Hardenberg il 5 Mag 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 Commenti
Cosimo Mercuro
Cosimo Mercuro il 5 Mag 2023
Modificato: Cosimo Mercuro il 5 Mag 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 il 6 Mag 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

Accedi per commentare.

Categorie

Scopri di più su Multibody Modeling in Help Center e File Exchange

Prodotti


Release

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by