is it possible to use step for a state space dynamic system with multi input?

Hi all I have a dynamic system with A, B, C, and D that identify the state space model, this system has two inputs one is a constant value while the other is a vector with data that changes with time. can i use step function for two input channel or can I identify the two inputs directly to B and C matrices. Thanks in advance
A = [0 1 0 0;a1 a2 a3 a4;0 -1 0 1;0 a5 a5 a7];
B = [-1 0 0 0]';
C = [1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1; 0 -1 0 1];
D = 0;
q = ss(A,B,C,D);
where a1,....., a7 are a constant values.

 Accepted Answer

Yes. You can use stepDataOptions to define an option set and then pass it into the step function.
For a 2-input system, you can say:
opts = stepDataOptions('InputOffset',[1 0],'StepAmplitude',[0 2])
step(sys,opts)
This means that the first input is a constant value (offset 1, amplitude 0), and the second input is a step that starts at 0 and ends at 2.
Alternatively, you could use the lsim function to define your own input vector and have it do whatever you'd like.
Sebastian

7 Comments

Thanks for your response. what can I do if one input is a force (constant value) and the other input is displacement (with a certain amplitude value). I appreciate your kindly help. Regards
I think whatever the inputs map to would depend on your state-space model.
Either way, you should be able to either use stepDataOptions/step or lsim to define an input trajectory.
Thanks for your response. So in my state-space model, can I use the first input channel (the constant force ( f) directly in the state-space model) and identify the second input channel ( step input ( r) with amplitude 0.1 m) directly in the state space model. and in this case B matrix will be
B = [-f 0; 0 0;0 r; f 0 ]
Can I do that ?. Thanks in advance
Yeah, you can do that. Each column of the B matrix is a separate input, and it makes sense that they act on separate states (rows).
Thanks again for your help. When I try to fit B matrix I get this error. Kindly, can you assist me to figure out the error. Best Regards
ms = 325;
mus = 65;
|monospaced| kus = 232.5e3;
k=20954;
c=1366.47;
Aqcar = [0 1 0 0;...
-kus/mus -c/mus k/mus c/mus;...
0 -1 0 1;...
0 c/ms -k/ms -c/ms];
Bqcar=[0 -0.1;...
-100/mu 0;...
0 0; ...
100/ms 0];
Cqcar = [1 0 0 0;...
0 1 0 0;...
0 0 1 0;...
0 0 0 1];
Dqcar = 0;
qcar = ss(Aqcar,Bqcar,Cqcar,Dqcar);
the error:
Warning: usage: [bnds,rowd,sens,rowp,rowg] = mu(matin,blk,opt)
> In mu at 45
In RobustControlofanActiveSuspension at 53
Error in ==> mu at 44
if nargin < 1 | nargin > 4
??? Output argument "bnds" (and maybe others) not assigned during call to
"E:\Program
Files\MATLAB\R2011a\toolbox\robust\rctobsolete\mutools\commands\mu.m>mu".
Error in ==> RobustControlofanActiveSuspension at 53
Bqcar=[0 -0.1;...
You are attempting to use a variable mu which you didn't define (you defined mus)... instead, it finds a built-in function mu.
Thanks Sebastian for your answer and for all your comments. I appreciate your help. All the best for you Best regards

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!