what exactly i need is the particular step responses of inputs 2 and 6, that is to be spcific my output matrix C = [ 0 1 0 0 0 1 0 ]. i need matrix c's step response
how to get step response for two inputs in for state space model ?
31 次查看(过去 30 天)
显示 更早的评论
A=[-0.0060 0.0014 0.0447 -8.8798 -8.0676 0 0;
0.0021 -0.0053 0.0671 3.0804 2.7986 0 0;
0.0038 0.0038 -0.1162 5.6007 5.0884 0 0;
9.1817 8.3716 8.3716 -0.0059 0.2848 0 0;
-8.9651 -8.1741 -8.1741 0.0058 -0.3134 0 0;
-0.317 -0.289 -0.289 0.306 0.278 -0.56 0;
0 0 0 0 0 1 0]
B=[-5.4145 1.8783 3.4150 0 0 0 0;
1.8783 -7.126 5.1226 0 0 0 0;
3.4150 5.1226 -8.8681 0 0 0 0;
0 0 0 -5.4010 5.2736 0 0;
0 0 0 5.2736 -5.8045 0 0;
0 0 0 0 0 0.5596 0;
0 0 0 0 0 0 -1]
C=[0 1 0 0 0 1 0]
D=[0 0 0 0 0 0 0]
sys=ss(A,B,C,D)
step(sys)
2 个评论
Jon
2022-5-5
编辑:Jon
2022-5-5
Please see my answer below. I think you are confused about the role, of the C matrix.
The output is given by y = Cx + Du where x is the system state and u are the inputs.
Your system, happens to have 7 states and also 7 inputs so maybe it is a little confusing. The C matrix combines the current values of the state into a contribution to the output. If you don't want to use some of the inputs then you need to either remove the corresponding columns from your B and D matrix (see below) and not use those inputs at all, or alternatively set the corresponding columns of the B and D matrix to zeros and keep all 7 inputs.
采纳的回答
Jon
2022-5-4
编辑:Jon
2022-5-4
Your system has 7 inputs and one output. Your code already plots the step responses to each of the seven inputs as shown in attached screenshot. If you only want the step response to two particular inputs, for example inputs 2 and 5, then you could do something like this:
sys=ss(A,B(:,[2,5]),C,D(:,[2,5]))
step(sys)
The inputs to the system are associated with the columns of the B and D matrix. So as shown above, just use the columns of the B and D matrix that you are interested in.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!