Type of output using the 'lsim' command
2 次查看(过去 30 天)
显示 更早的评论
[EDIT: 20110723 20:32 CDT - reformat - WDR]
Hi guys,
I built a simple 6DOF spring-mass-damper system in Matlab and using the state space solver built a LTI model and used 'tf' get a transfer function for the model. I used the 'lsim' command to get the system response to arbitrary inputs.
I wanted to know what the output units on response vector would be. Does it output velocity or acceleration? If its velocity, then would simple differentiation be ok to convert it to acceleration?
Below is my code for it. Thanks in advance.
%%%%%%%%
m=[10 7 9 9 5 5];
k=[10,10,10,10,0,0,5,1,5,1];
M=diag(m);
K=10000*[26 -10 0 0 -5 -1
-10 35 -10 -10 0 -5
0 -10 18 0 0 0
0 -10 0 22 0 0
-5 0 0 0 6 -1
-1 -5 0 0 -1 7];
C=.0001*K;
% define State Space Matrices
A=[zeros(size(M)) eye(size(M));-inv(M)*K -inv(M)*C];
B=[zeros(size(M)); inv(M)];
C=[zeros(size(M)) eye(size(M))];
D=[zeros(size(M))];
sys1=ss(A,B,C,D);
H=tf(sys1);
% Define Forcing Function
time=linspace(0,15,10000)';
F=0*time;
F(find(time<.5))=20+F(find(time<.5)); % 20N step 0 to .5 seconds
% Apply force to DOF 1
u=inv(M)*[1,0,0,0,0,0]'*F';
x=lsim(H,u,time);
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Model Identification 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!