Skip to content

Commit 57daebf

Browse files
committed
Some doc updates.
1 parent 3336938 commit 57daebf

File tree

1 file changed

+30
-35
lines changed

1 file changed

+30
-35
lines changed

src/matrix_comps.jl

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,15 @@ ctrb(sys::StateSpace) = ctrb(sys.A, sys.B)
147147

148148
"""`P = covar(sys, W)`
149149
150-
Calculate the stationary covariance `P = E[y(t)y(t)']` of an lti-model `sys`, driven by gaussian
151-
white noise 'w' of covariance `E[w(t)w(τ)]=W*δ(t-τ)` where δ is the dirac delta.
150+
Calculate the stationary covariance `P = E[y(t)y(t)']` of the output `y` of a
151+
`StateSpace` model `sys` driven by white Gaussian noise `w` with covariance
152+
`E[w(t)w(τ)]=W*δ(t-τ)` (δ is the Dirac delta).
152153
153-
The ouput is if Inf if the system is unstable. Passing white noise directly to
154-
the output will result in infinite covariance in the corresponding outputs
155-
(D*W*D' .!= 0) for contunuous systems."""
154+
Remark: If `sys` is unstable then the resulting covariance is a matrix of `Inf`s.
155+
Entries corresponding to direct feedthrough (D*W*D' .!= 0) will equal `Inf`
156+
for continuous-time systems."""
156157
function covar(sys::AbstractStateSpace, W)
157-
(A, B, C, D) = (sys.A, sys.B, sys.C, sys.D)
158+
(A, B, C, D) = ssdata(sys)
158159
if !isa(W, UniformScaling) && (size(B,2) != size(W, 1) || size(W, 1) != size(W, 2))
159160
error("W must be a square matrix the same size as `sys.B` columns")
160161
end
@@ -170,9 +171,9 @@ function covar(sys::AbstractStateSpace, W)
170171
P = C*Q*C'
171172
if iscontinuous(sys)
172173
#Variance and covariance infinite for direct terms
173-
directNoise = D*W*D'
174+
direct_noise = D*W*D'
174175
for i in 1:size(C,1)
175-
if directNoise[i,i] != 0
176+
if direct_noise[i,i] != 0
176177
P[i,:] .= Inf
177178
P[:,i] .= Inf
178179
end
@@ -199,22 +200,16 @@ covar(C::Union{AbstractMatrix,UniformScaling}, R) = C*R*C'
199200
200201
`norm(sys)` or `norm(sys,2)` computes the H2 norm of the LTI system `sys`.
201202
202-
`norm(sys, Inf)` computes the L∞ norm of the LTI system `sys`.
203-
The H∞ norm is the same as the L∞ for stable systems, and Inf for unstable systems.
203+
`norm(sys, Inf)` computes the H∞ norm of the LTI system `sys`.
204+
The H∞ norm is the same as the H∞ for stable systems, and Inf for unstable systems.
204205
If the peak gain frequency is required as well, use the function `hinfnorm` instead.
206+
See [`hinfnorm`](@ref) for further documentation.
205207
206208
`tol` is an optional keyword argument, used only for the computation of L∞ norms.
207209
It represents the desired relative accuracy for the computed L∞ norm
208210
(this is not an absolute certificate however).
209211
210-
sys is first converted to a state space model if needed.
211-
212-
The L∞ norm computation implements the 'two-step algorithm' in:
213-
N.A. Bruinsma and M. Steinbuch, 'A fast algorithm to compute the H∞-norm
214-
of a transfer function matrix', Systems and Control Letters 14 (1990), pp. 287-293.
215-
For the discrete-time version, see, e.g.,: P. Bongers, O. Bosgra, M. Steinbuch, 'L∞-norm
216-
calculation for generalized state space systems in continuous and discrete time',
217-
American Control Conference, 1991.
212+
`sys` is first converted to a `StateSpace` model if needed.
218213
"""
219214
function LinearAlgebra.norm(sys::AbstractStateSpace, p::Real=2; tol=1e-6)
220215
if p == 2
@@ -225,10 +220,8 @@ function LinearAlgebra.norm(sys::AbstractStateSpace, p::Real=2; tol=1e-6)
225220
error("`p` must be either `2` or `Inf`")
226221
end
227222
end
223+
LinearAlgebra.norm(sys::TransferFunction, p::Real=2; tol=1e-6) = norm(ss(sys), p, tol=tol)
228224

229-
function LinearAlgebra.norm(sys::TransferFunction, p::Real=2; tol=1e-6)
230-
return norm(ss(sys), p, tol=tol)
231-
end
232225

233226
"""
234227
` (Ninf, ω_peak) = hinfnorm(sys; tol=1e-6)`
@@ -244,14 +237,15 @@ the computed H∞ norm (not an absolute certificate).
244237
245238
`sys` is first converted to a state space model if needed.
246239
247-
The L∞ norm computation implements the 'two-step algorithm' in:
248-
N.A. Bruinsma and M. Steinbuch, 'A fast algorithm to compute the H∞-norm
249-
of a transfer function matrix', Systems and Control Letters 14 (1990), pp. 287-293.
250-
For the discrete-time version, see: P. Bongers, O. Bosgra, M. Steinbuch, 'L∞-norm
251-
calculation for generalized state space systems in continuous and discrete time',
252-
American Control Conference, 1991.
240+
The continuous-time L∞ norm computation implements the 'two-step algorithm' in:\\
241+
**N.A. Bruinsma and M. Steinbuch**, 'A fast algorithm to compute the H∞-norm of
242+
a transfer function matrix', Systems and Control Letters (1990), pp. 287-293.
253243
254-
See also `linfnorm`.
244+
For the discrete-time version, see:\\
245+
**P. Bongers, O. Bosgra, M. Steinbuch**, 'L∞-norm calculation for generalized
246+
state space systems in continuous and discrete time', American Control Conference, 1991.
247+
248+
See also [`linfnorm`](@ref).
255249
"""
256250
function hinfnorm(sys::AbstractStateSpace; tol=1e-6)
257251
if iscontinuous(sys)
@@ -275,14 +269,15 @@ the computed L∞ norm (this is not an absolute certificate however).
275269
276270
`sys` is first converted to a state space model if needed.
277271
278-
The L∞ norm computation implements the 'two-step algorithm' in:
279-
N.A. Bruinsma and M. Steinbuch, 'A fast algorithm to compute the H∞-norm
280-
of a transfer function matrix', Systems and Control Letters 14 (1990), pp. 287-293.
281-
For the discrete-time version, see:
282-
P. Bongers, O. Bosgra, M. Steinbuch, 'L∞-norm calculation for generalized state
283-
space systems in continuous and discrete time', American Control Conference, 1991.
272+
The continuous-time L∞ norm computation implements the 'two-step algorithm' in:\\
273+
**N.A. Bruinsma and M. Steinbuch**, 'A fast algorithm to compute the H∞-norm of
274+
a transfer function matrix', Systems and Control Letters (1990), pp. 287-293.
275+
276+
For the discrete-time version, see:\\
277+
**P. Bongers, O. Bosgra, M. Steinbuch**, 'L∞-norm calculation for generalized
278+
state space systems in continuous and discrete time', American Control Conference, 1991.
284279
285-
See also `hinfnorm`.
280+
See also [`hinfnorm`](@ref).
286281
"""
287282
function linfnorm(sys::AbstractStateSpace; tol=1e-6)
288283
if iscontinuous(sys)

0 commit comments

Comments
 (0)