Spring mass damper system shows position of mass only to be on positive side
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I have been out of touch with simulink and wanted to restart with a simple spring mass damper system. Here is the model I used:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/526004/image.jpeg)
Here is the script that contains inputs and plot commands:
sim_Time=150;
k=.5;
b=.2;
m=4.5;
F=2;
sim('MassSpringDamper_Trial.slx');
plot(Position.data)
legend('Position of mass')
hold all
plot(Force.data)
legend('Position of mass','Force')
And I got the output, close and not exactly, what I would like to see:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/526009/image.jpeg)
There are two things that concern me:
- Why are the 'Position of mass' plot values always on the positive side? The spring mass system vibrates between both the negative and positive limits from its neutral position, doesn't it?
- The step input force is set with an initial value 0 and final value 'F'. So I was thinking the 'Position of mass' to have a non zero value right from time t = 0. But almost till t=8, I see the 'Position of mass' to be zero.
Can someone explain the reason(s) pl.? Thanks already!
0 个评论
回答(1 个)
Paul
2021-2-20
The transfer function from Force to Position has dc gain of 2. The input F has a value of 2, so the steady state of the output should be 4, as shown.
However, the rest of the results look suspect. The period if the oscilations should be ~18 secs. Note that
plot(Position.Data)
is just plotting points vs an index. Shouldn't that command either be
plot(Position)
or
plot(Position.Time,Position.Data)
Let's see what one of those plots look like.
Also, what is the value of the Step Time parameter in the Force block?
4 个评论
Paul
2021-2-21
One way to obtain oscilations around 0 position is to set F to 0 and set the Initial Condtion on the integrator (from xdot to x) to a non-zero value.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Gain Scheduling 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!