How to simulate a simple spring using Simscape
3 次查看(过去 30 天)
显示 更早的评论
Hello Everyone,
I am using simscape to simulate a simple spring driven by a step input.
I am giving a step input (force) to a spring and then, I want to monitor the Oscillations in spring. I am giving a step input = 1N to the spring (K = 1N/m. Intial deformation =0m). I was expecting the spring to extend to a maximum length of 1m and hold constant there, instead I am seeing Oscillations in the spring extension. I have attached my Simscape file here. Can you help me here?
0 个评论
回答(1 个)
SYED IMTIAZ ALI SHAH
2019-8-2
编辑:SYED IMTIAZ ALI SHAH
2019-8-2
You don't have any damper in your system, I tried this mathematically and gives me the same result (Oscillation). You must add damper if you want your system to stay at a specific position.
Here is the mathematical model for your system with and without damper.
>> n = [1] ;
>> d = [1 0 1];
>> fn = tf(n,d)
fn =
1
-------
s^2 + 1
Continuous-time transfer function.
>> t = 0:0.1:10;
>> wref = zeros(1,length(t));
>> wref(1:length(t)) = 1;
>> [y,t] = lsim(wref,fn,t);
>> plot(t,y)
After adding damper
d = [1 1 1]; % rest of the code remain the same
Here is the modified Simscape model (Damper value is kept 1,rest of the parameters are exactly the same as provided by you)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simscape Multibody 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!