How can you set the initital condition 'displacement' of the mass in a simple spring-damper-mass system in Simscape?

11 次查看(过去 30 天)
In Simscape I want a Mass in a simple mass spring damper system to have initial displacement and velocity. When I doubleclick on the mass symbol, I can only set the initital velocity. I already tried to solve this problem by applying initial deformation on the spring, but this ended up as a constant offset. Is there a certain block I have to use?

回答(2 个)

Zhao Wang
Zhao Wang 2016-9-29
I understand that you want to set the initial displacement of the "Mass" block in a Mass-Spring-Damper model in Simscape. I assume that you want to change this initial value without double-clicking blocks in the model.
The initial displacement of the "Mass" block is determined by the initial deformation value in the "Spring" Block. For more details of how to initialize variables of a Mass-Spring-Damper system, refer to the following link:
If you want to change this initial value, you can use a variable (for example 'x') in the field of 'Beginning Value' of the 'Deformation' variable. You can define this variable in the base workspace. Every time you change the value of 'x' and click the 'Run' button, the changed initial displacement will be applied to the simulation of the Mass-Spring-Damper system.
  1 个评论
Maximilian Joerg
Maximilian Joerg 2016-9-30
Hi Zhao, thanks for your reply.
It's not an issue of setting initial values. I'm familiar with both double-clicking and initializing a variable in the wokspace. Besides this I'm familiar with the Variable Viewer, setting priorities and solving conflicts between initital values.
My question is: Is there any way to define the initital (t=0) displacement of a mass directly as a property of the mass, without using the Spring Block's Parameters?
Because I have already tried your solution, using the initital deformation parameter of the Spring Block. But as I described earlier this ended up as a constant offset, meaning the mass's rest postion continued to be the same as the deformation of the spring throughout the entire simulation and not d=0 as one would expect. I assume this Parameter covers some kind of preload or pretention on the Spring

请先登录,再进行评论。


Tomorrow
Tomorrow 2018-11-26
编辑:Tomorrow 2018-12-11
I have read the link you give and followed the same process.
However, I have set the initial position for spring and sensor, and they are the same as -3mm, after the updating the variable, the data are all strange.
attached please find my model. thanks for your help.
can anyone help?

类别

Help CenterFile Exchange 中查找有关 Couplings and Drives 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by