Question

Use matlab to obtain a state-space representation of C(s) G(s)= E(s) 25° +4.88² +9.65 +16 S+5 Using the state-space model and

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:

If you found this solution useful then please upvote

Thank you

MATLAB Script

clc;
clear;
close all;
%% To obtain the state space representation
num = [1, 5];
den = [2, 4.8, 9.6, 16];

[A, B, C, D] = tf2ss(num, den);

disp('The state space representation of G(s) is:');

G = ss(A, B, C, D)

%% To obtain and plot the response c(t) for a step input e(t) = 2

t = 0:0.0001:40;
c = 2*step(G, t);

plot(t, c, 'k', 'linewidth',2);
grid;
xlabel('Time, t (sec)');
ylabel('c(t)');
title('Response of the system to an input e(t) = 2');


%% To obtain and plot the response c(t) for e(t) = 2.sin(0.01t)
T = 2*pi/0.01;
t = 0:T/1000:5*T;
e = 2*sin(0.01*t);

c = lsim(G, e, t);

figure
subplot(2,1,1)
plot(t, e, 'k', 'linewidth',2);
grid;
xlabel('Time, t (sec)');
ylabel('e(t)');
title('Input e(t) = 2.sin(0.01t)');

subplot(2,1,2)
plot(t, c, 'k', 'linewidth',2);
grid;
xlabel('Time, t (sec)');
ylabel('c(t)');
title('Response of the system to an input e(t) = 2.sin(0.01t)');

After executing we get

In the command window

The state space representation of G(s) is:

G =

A =
x1 x2 x3
x1 -2.4 -4.8 -8
x2 1 0 0
x3 0 1 0

B =
u1
x1 1
x2 0
x3 0

C =
x1 x2 x3
y1 0 0.5 2.5

D =
u1
y1 0

Continuous-time state-space model.

>>

Response of the system to an input e(t) = 2 0.9 0.8 0.7 Mm 0.6 량 0.5 04 0.3 02. 0.1 0 0 5 10 15 25 30 35 40 20 Time, t (sec)

Input e(t) = 2.sin(0.01t) 1 eo M -1 -2 0 500 1000 1500 2000 2500 3000 3500 Time, t (sec) Response of the system to an input e

Add a comment
Know the answer?
Add Answer to:
Use matlab to obtain a state-space representation of C(s) G(s)= E(s) 25° +4.88² +9.65 +16 S+5...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT