We have to calculate the steady state response of the state space A in my code. The MATLAB function tf(sys) gives me the transfer functions. Now I want to multiply these tf functions with a step input 0.0175/s. Next, I have to take the limit s->0, which will give me the steady-state response. However, I'm not sure how I would program this in MATLAB. I have no idea how to deal with the outputs of the tf(sys) command. Could anyone provide some insight? The code I wrote is below:
A=[ 0.00501 0.00464 -72.90 -31.34;
-0.08570 -0.545 309 -7.4;
0.00185 -0.00767 -0.395 0.00132;
0 0 1 0];
B=[5.63 -23.8 -4.51576 0]';
C=[1 0 0 0;
0 1 0 0;
0 0 1 0;
0 0 0 1];
D=0;
sys=ss(A,B,C,D);
tf=tf(sys)
All you need to use is the dcgain function to infer what the steady-state value is for each of the input/output relationships in your state-space model once converted to their equivalent transfer functions. The DC gain is essentially taking the limit as s->0 when calculating the step response. However, though it's not really required to plot the step response, it may be useful to verify graphically that dcgain is giving you the right results. In this case, use step. It finds the step response of linear dynamical systems, including a state-space model. In your case, once you convert to a tf object, you would have to scale your transfer function by 0.0175, then invoke step, as well as dcgain.
I also renamed your last variable to T because tf is an actual function, yet you'll be overshadowing the function with the variable tf.
Simply put:
%// Your code
clear all; clc;
A=[ 0.00501 0.00464 -72.90 -31.34;
-0.08570 -0.545 309 -7.4;
0.00185 -0.00767 -0.395 0.00132;
0 0 1 0];
B=[5.63 -23.8 -4.51576 0]'; %'
C=[1 0 0 0;
0 1 0 0;
0 0 1 0;
0 0 0 1];
D=0;
sys=ss(A,B,C,D);
T=0.0175*tf(sys); %// Change
%// New - find the step response
[y,t] = step(T);
%// Plot the step response
plot(t, y);
legend('x1', 'x2', 'x3', 'x4');
%// Determine the steady-state values
format long g;
ss_values = dcgain(T);
disp(ss_values);
I get these for my steady-state values:
>> ss_values
ss_values =
23.7245028635498
-4.57981861496758
0
0.00625827699339293
I also get this plot:

The steady-state values more or less line up with what we see in the plot.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With