@@ -264,7 +264,7 @@ function feedback(sys1::StateSpace,sys2::StateSpace)
264
264
sys2. B* sys1. C sys2. A+ sys2. B* sys1. D* (- sys2. C)]
265
265
B = [sys1. B; sys2. B* sys1. D]
266
266
C = [sys1. C sys1. D* (- sys2. C)]
267
-
267
+
268
268
ss (A, B, C, sys1. D, sys1. Ts)
269
269
end
270
270
@@ -292,12 +292,10 @@ See Zhou etc. for similar (somewhat less symmetric) formulas.
292
292
error (" Sampling time mismatch" )
293
293
end
294
294
295
- #= must define allunique(c::Colon) = true for the following checks to work
296
- if !allunique(Y1); @warn "Connecting single output to multiple inputs Y1=$Y1"; end
297
- if !allunique(Y2); @warn "Connecting single output to multiple inputs Y2=$Y2"; end
298
- if !allunique(U1); @warn "Connecting multiple outputs to a single input U1=$U1"; end
299
- if !allunique(U2); @warn "Connecting a single output to multiple inputs U2=$U2"; end
300
- =#
295
+ if ! (isa (Y1, Colon) || allunique (Y1)); @warn " Connecting single output to multiple inputs Y1=$Y1 " ; end
296
+ if ! (isa (Y2, Colon) || allunique (Y2)); @warn " Connecting single output to multiple inputs Y2=$Y2 " ; end
297
+ if ! (isa (U1, Colon) || allunique (U1)); @warn " Connecting multiple outputs to a single input U1=$U1 " ; end
298
+ if ! (isa (U2, Colon) || allunique (U2)); @warn " Connecting a single output to multiple inputs U2=$U2 " ; end
301
299
302
300
if (U1 isa Colon ? size (sys1, 2 ) : length (U1)) != (Y2 isa Colon ? size (sys2, 1 ) : length (Y2))
303
301
error (" Lengths of U1 ($U1 ) and Y2 ($Y2 ) must be equal" )
@@ -341,13 +339,13 @@ See Zhou etc. for similar (somewhat less symmetric) formulas.
341
339
R1 = try
342
340
inv (α* I - s2_D22* s1_D22) # slightly faster than α*inv(I - α*s2_D22*s1_D22)
343
341
catch
344
- error (" Illposed feedback interconnection, I - α*s2_D22*s1_D22 or I - α*s2_D22*s1_D22 not invertible" )
342
+ error (" Ill-posed feedback interconnection, I - α*s2_D22*s1_D22 or I - α*s2_D22*s1_D22 not invertible" )
345
343
end
346
344
347
345
R2 = try
348
346
inv (I - α* s1_D22* s2_D22)
349
347
catch
350
- error (" Illposed feedback interconnection, I - α*s2_D22*s1_D22 or I - α*s2_D22*s1_D22 not invertible" )
348
+ error (" Ill-posed feedback interconnection, I - α*s2_D22*s1_D22 or I - α*s2_D22*s1_D22 not invertible" )
351
349
end
352
350
353
351
A = [sys1. A + s1_B2* R1* s2_D22* s1_C2 s1_B2* R1* s2_C2;
0 commit comments