Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >> A = [1 1 ; 4 -2]
- A =
- 1 1
- 4 -2
- >> B = [1 -1; 1 -1]
- B =
- 1 -1
- 1 -1
- >> D = 0
- D =
- 0
- >> Co = ctrb(A,B)
- Co =
- 1 -1 2 -2
- 1 -1 2 -2
- >> unicon_states = length(A) - rank(Co)
- unicon_states =
- 1
- >> Ob = obav(A,B)
- Undefined function or variable 'obav'.
- Did you mean:
- >> Ob = obsv(A,B)
- Ob =
- 1 -1
- 1 -1
- -3 3
- -3 3
- >> Ob = obav(A,C)
- Undefined function or variable 'C'.
- >> Ob = obav(A,Co)
- Undefined function or variable 'obav'.
- Did you mean:
- >> Ob = obsv(A,Co)
- Error using obsv (line 28)
- In the "obsv(A,C)" command, the A matrix must be square with as many columns as C.
- >> unicon_states = length(A) - rank(B)
- unicon_states =
- 1
- >> unicon_states = length(A) - rank(Co)
- unicon_states =
- 1
- >> Co = ctrb(A,B)
- Co =
- 1 -1 2 -2
- 1 -1 2 -2
- >> unicon_states = length(A) - rank(Co)
- unicon_states =
- 1
- >> Ob = obav(A,Co)
- Undefined function or variable 'obav'.
- Did you mean:
- >> Ob = obsv(A,Co)
- Error using obsv (line 28)
- In the "obsv(A,C)" command, the A matrix must be square with as many columns as C.
- >> Ob = obsv(A,Co)
- Error using obsv (line 28)
- In the "obsv(A,C)" command, the A matrix must be square with as many columns as C.
- >> Ob = obsv(A,B)
- Ob =
- 1 -1
- 1 -1
- -3 3
- -3 3
- >> neosmotrivaStanja = length(A) - rank(Ob)
- neosmotrivaStanja =
- 1
- >> Gs = tf([1 0], 1)
- Gs =
- s
- Continuous-time transfer function.
- >> num1 = [2,0]; den1 = [4,1];
- >> num2 = [3]; den2=[5,1];
- >> Gs1=tf(num1,den1);
- >> Gs2=tf(num2,den2);
- >> Gs = [Gs1, Gs2]
- Gs =
- From input 1 to output:
- 2 s
- -------
- 4 s + 1
- From input 2 to output:
- 3
- -------
- 5 s + 1
- Continuous-time transfer function.
- >> %prvi deo nije nesto tacan za Co
- >> num = {[1 1]; 1}; den = {[1 2 2]; [1 0]};
- >> Gs = tf(num,den)
- Gs =
- From input to output...
- s + 1
- 1: -------------
- s^2 + 2 s + 2
- 1
- 2: -
- s
- Continuous-time transfer function.
- >> numd = [1 0.5]; dend = [1,1.5,2]; Tsd = 0.4;
- >> Ob = obav(A,Co)
- Undefined function or variable 'obav'.
- Did you mean:
- >> Ob = obsv(A,Co)
- Error using obsv (line 28)
- In the "obsv(A,C)" command, the A matrix must be square with as many columns as C.
- >> Ob = obsv(A,Co)
- Error using obsv (line 28)
- In the "obsv(A,C)" command, the A matrix must be square with as many columns as C.
- >> Gz = tf(numd, dend, Tsd)
- Gz =
- z + 0.5
- ---------------
- z^2 + 1.5 z + 2
- Sample time: 0.4 seconds
- Discrete-time transfer function.
- >> s = tf('s');
- >> Gs = s/(s^2 + 2*s + 10);
- >> Gs = tf([1 0], [1 2 10]);
- >> F = [0,1; -4,-2];
- >> G = [0;-2];
- >> H = [1,0];
- >> D = [0];
- >> ss1 = ss(F,G,H,D)
- ss1 =
- a =
- x1 x2
- x1 0 1
- x2 -4 -2
- b =
- u1
- x1 0
- x2 -2
- c =
- x1 x2
- y1 1 0
- d =
- u1
- y1 0
- Continuous-time state-space model.
- >> ss1.a
- ans =
- 0 1
- -4 -2
- >> F = [-1 0; 0 -1];
- >> G = [1;0];
- >> H = eye(2);
- >> D = zeros(2,1);
- >> sys = ss(F,G,H,D,0.4)
- sys =
- a =
- x1 x2
- x1 -1 0
- x2 0 -1
- b =
- u1
- x1 1
- x2 0
- c =
- x1 x2
- y1 1 0
- y2 0 1
- d =
- u1
- y1 0
- y2 0
- Sample time: 0.4 seconds
- Discrete-time state-space model.
- >> %ss2tf, tf2ss, tf2zp, ss2zp, c2d, d2c, size [*broj izlaza i ulaza sistema]
- >> sys = ss(F,G,H,D)
- sys =
- a =
- x1 x2
- x1 -1 0
- x2 0 -1
- b =
- u1
- x1 1
- x2 0
- c =
- x1 x2
- y1 1 0
- y2 0 1
- d =
- u1
- y1 0
- y2 0
- Continuous-time state-space model.
- >> tf(sys)
- ans =
- From input to output...
- 1
- 1: -----
- s + 1
- 2: 0
- Continuous-time transfer function.
- >> [num, den] = ss2tf(F,G,H,D,1) %poslednji argument broj izlaza
- num =
- 0 1 1
- 0 0 0
- den =
- 1 2 1
- >>
- >> [num,den] = mason{'zadatak.net', 1, 7}
- Undefined variable "mason" or class "mason".
- >> [num,den] = mason('zadatak.net', 1, 7)
- 1 1 2
- 2 2 3
- 3 3 4
- 4 4 5
- 5 5 6
- 6 6 7
- 7 2 4
- 8 2 5
- 9 6 5
- 10 6 4
- 11 6 3
- '(1)' '(-3)' '(1/z)' '(1/z)' '(1/z)' '(1)' '(2)' '(1)' '(-6)' '(-12)' '(-8)'
- -- Network Info --
- Net File : zadatak.net
- Start Node : 1
- Stop Node : 7
- ----- Paths -----
- P1 : 1 2 3 4 5 6
- P2 : 1 7 4 5 6
- P3 : 1 8 5 6
- - Order 1 Loops -
- L11 : 3 4 5 11
- L12 : 4 5 10
- L13 : 5 9
- The variables returned are strings describing
- the numerator and Denominator of the transfer equation.
- If you have the symbolic toolbox, use Denominator=sym(Denominator)
- and Numerator=sym(Numerator) to make these symbolic equations.
- You can now use simple(Numerator/Denominator) to boil the whole
- thing down. You could also use simple(Numerator) to simplify the
- Numerator on it' own.
- num =
- ((((1)*(-3)*(1/z)*(1/z)*(1/z)*(1)*(1)-0)+(1)*(2)*(1/z)*(1/z)*(1)*(1)-0)+(1)*(1)*(1/z)*(1)*(1)-0)
- den =
- 1-((1/z)*(1/z)*(1/z)*(-8)+(1/z)*(1/z)*(-12)+(1/z)*(-6))
- >> num = sym(num)
- num =
- 1/z + 2/z^2 - 3/z^3
- >> den = sym(den)
- den =
- 6/z + 12/z^2 + 8/z^3 + 1
- >> Gz = simplify(num/den)
- Gz =
- (z^2 + 2*z - 3)/(z + 2)^3
- >> %odrediti nule i polove ove prenosne funkcije i da se ispita upravljivost i osmotrivost ovog sistema
- >> [num,den] = numden(Gz)
- num =
- z^2 + 2*z - 3
- den =
- (z + 2)^3
- >> [F,G,H] = tf2ss(sym2poly(num), sym2poly(den))
- F =
- -6 -12 -8
- 1 0 0
- 0 1 0
- G =
- 1
- 0
- 0
- H =
- 1 2 -3
- >> C = ctrb(F,G)
- C =
- 1 -6 24
- 0 1 -6
- 0 0 1
- >> upravljivost = length(F) - rank(C)
- upravljivost =
- 0
- >> %jeste upravljiva jer ima nula neupravljivih stanja
- >> O = obav(F,H)
- Undefined function or variable 'obav'.
- Did you mean:
- >> O = obsv(F,H)
- O =
- 1 2 -3
- -4 -15 -8
- 9 40 32
- >> neosmotrivastanja = length(F) - rank(O)
- neosmotrivastanja =
- 0
- >>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement