- The input u is an array having as many rows as time samples (length(t)) and as many columns as system inputs.
What is Input for lsim?
3 次查看(过去 30 天)
显示 更早的评论
When using the lsim function, the second variable to input is the "input" to the system. This seems very straightforward for a single dimensional system. However, when you have a multi-degree of freedom system. What is the input, inputing too?
1) For example, if I had two masses between three springs, then would the input be toward the first or second mass or to the container that they are attached to?
2) Is the input to the system, a force or a displacement?
3) Why do you need an input variable? In a code like below, you define your inputs in the BB and DD matrices.
AA = [A11 A12; A21 A22];
BB = [zeros(NN,1); M\Q];
CC = [eye(NN), zeros(NN)]
DD = [0];
% -------------------------------------------------------
% Short Simulation
time = (0:.01:22.5)';
P = 0*(time+1)./(time+1);
P(1) = 500;
P(2) = 500;
timesize = size(time);
P = 0*(time+1)./(time+1);
P(1:timesize) = 500;
%P(2) = 500;
%P = zeros(timesize(1),1);
SYS = ss(AA,BB,CC,DD);
[YY, TT] = lsim(SYS, P, time);
% -------------------------------------------------------
4) Should I be defining my inputs in the BB and DD matrices or the "P" input or both?
2 个评论
Star Strider
2018-12-10
I can’t run your code.
The documentation states:
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Robust Control Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!