Skip to content

Commit 9e8b307

Browse files
committed
update and move stab_unstab to ControlSystems
1 parent d40cb81 commit 9e8b307

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
2525
[compat]
2626
ChainRulesCore = "1"
2727
ComponentArrays = "0.9, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15"
28-
ControlSystemsBase = "1.7"
28+
ControlSystemsBase = "1.12"
2929
DescriptorSystems = "1.2"
3030
Distributions = "0.25"
3131
GenericSchur = "0.5.2"

src/descriptor.jl

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ Coprime-factor reduction performs a coprime factorization of the model into \$P(
100100
101101
# Arguments:
102102
- `factorization`: The function to perform the coprime factorization. A non-normalized factorization may be used by passing `RobustAndOptimalControl.DescriptorSystems.glcf`.
103-
- `kwargs`: Are passed to `DescriptorSystems.gbalmr`
103+
- `kwargs`: Are passed to `DescriptorSystems.gbalmr`, the docstring of which is reproduced below:
104+
$(@doc(DescriptorSystems.gbalmr))
104105
"""
105106
function baltrunc_coprime(sys, info=nothing; residual=false, n=missing, factorization::F = DescriptorSystems.gnlcf, kwargs...) where F
106107
if info !== nothing && hasproperty(info, :NM)
@@ -140,25 +141,16 @@ function baltrunc_unstab(sys::LTISystem, info=nothing; residual=false, n=missing
140141
if info !== nothing && hasproperty(info, :stab)
141142
@unpack stab, unstab = info
142143
else
143-
stab, unstab = DescriptorSystems.gsdec(dss(sys); job="stable", kwargs...)
144+
stab, unstab, sep = stab_unstab(sys; kwargs...)
144145
end
145146
nx_unstab = size(unstab.A, 1)
146147
if n isa Integer && n < nx_unstab
147148
error("The model contains $(nx_unstab) poles outside the stability region, the reduced-order model must be of at least this order.")
148149
end
149150
sysr, hs = DescriptorSystems.gbalmr(stab; matchdc=residual, ord=n-nx_unstab, kwargs...)
150-
ss(sysr + unstab), hs, (; stab, unstab)
151+
ss(sysr + unstab), hs, (; stab, unstab, sep)
151152
end
152153

153-
"""
154-
stab, unstab = stab_unstab(sys; kwargs...)
155-
156-
Decompose `sys` into `sys = stab + unstab` where `stab` contains all stable poles and `unstab` contains unstable poles. See $(@doc(DescriptorSystems.gsdec)) for keyword arguments (argument `job` is set to `"stable"` in this function).
157-
"""
158-
function stab_unstab(sys; kwargs...)
159-
stab, unstab = DescriptorSystems.gsdec(dss(sys); job="stable", kwargs...)
160-
ss(stab), ss(unstab)
161-
end
162154

163155
##
164156

src/named_systems2.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ end
365365
366366
Return a system with specified state variables as measurement outputs.
367367
368-
See also [`add_output`](@ref).
368+
See also [`ControlSystemsBase.add_output`](@ref).
369369
"""
370370
function measure(s::NamedStateSpace, names)
371371
inds = names2indices(names, s.x)

0 commit comments

Comments
 (0)