book examples

book examples -...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: %------------------------------------------------% Chapter 1. State-Space Description %------------------------------------------------J = 1; b = 4; kR = 40; A = [0 1;-kR/J -b/J]; B = [0;1/J]; C = [1 0]; D = [0]; JbkR = ss(A,B,C,D); JbkRtf = tf(JbkR); JbkRzpk = zpk(JbkR); [num,den] = tfdata(JbkR,'v'); [z,p,k] = zpkdata(JbkR,'v'); JbkRss = ss(JbkRtf) % Define the % state-space % realization % Define model from % state-space % Convert to % transfer function % Convert to % zero-pole % description % Extract transfer % function % description % Extract zero-pole % description % Convert to % state-space % description %----------------------------------------------% Chapter 2. Simulation of State-Space Systems %----------------------------------------------t = [0:.01:4]; % Define array of time % values U = [zeros(size(t))]; % Zero single input of % proper size to go with t x0 = [0.4; 0.2]; % Define initial state % vector [x10; x20] CharPoly = poly(A) % Find characteristic % polynomial from A Poles = roots(CharPoly) EigsO = eig(A); damp(A); [Yo,t,Xo] = lsim(JbkR,U,t,x0); Xo(101,:); X1 = expm(A*1)*X0; % Find the system poles % Calculate open-loop % system eigenvalues % Calculate eigenvalues, % zeta, and wn from ABCD % Open-loop response % (zero input, given ICs) % State vector value at % t=1 sec % Compare with state % transition matrix % method % Open-loop State Plots figure; subplot(211), plot(t,Xo(:,1)); grid; axis([0 4 -0.2 0.5]); set(gca,'FontSize',18); ylabel('{\itx}−1 (\itrad)') subplot(212), plot(t,Xo(:,2)); grid; axis([0 4 -2 1]); set(gca,'FontSize',18); xlabel('\ittime (sec)'); ylabel('{\itx}−2 (\itrad/s)'); ...
View Full Document

Page1 / 2

book examples -...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online