Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Transfer function to steady state
- % Chapter4 Example 1
- clear
- clc
- %% Input:
- numg = [24]; % Define numerator of G(s)
- deng = [1 9 26 24]; % Define denominator of G(s)
- %% Process
- G = tf(numg,deng) % Generate transfer function G(s)
- type = input("1-Phase Variable; 2-Controller Cononical; 3-Observer Cononical?\n");
- % Controller Cononical
- [Ac Bc Cc Dc] = tf2ss(numg,deng);
- % Phase Variable
- P = flip(eye(order(G)));
- A = inv(P)*Ac*P;
- B = inv(P)*Bc;
- C = Cc*P;
- D = Dc;
- % Observer Cononical
- Ao = Ac';
- Bo = Cc';
- Co = Bc';
- Do = Dc;
- if(type == 3)
- Ao
- Bo
- Co
- Do
- elseif(type == 2)
- Ac
- Bc
- Cc
- Dc
- else
- A
- B
- C
- D
- end
Add Comment
Please, Sign In to add comment