Skip to content

Commit 14986d1

Browse files
committed
doc: precision in LinMode outer constructor
1 parent 2045d9a commit 14986d1

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/model/linmodel.jl

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ with the state ``\mathbf{x}`` and output ``\mathbf{y}`` vectors. The ``\mathbf{z
8282
comprises the manipulated inputs ``\mathbf{u}`` and measured disturbances ``\mathbf{d}``,
8383
in any order. `i_u` provides the indices of ``\mathbf{z}`` that are manipulated, and `i_d`,
8484
the measured disturbances. The constructor automatically discretizes continuous systems,
85-
resamples discrete ones if `Ts ≠ sys.Ts`, computes a new realization if not minimal, and
86-
separates the ``\mathbf{z}`` terms in two parts (details in Extended Help). The rest of the
87-
documentation assumes discrete dynamics since all systems end up in this form.
85+
resamples discrete ones if `Ts ≠ sys.Ts`, computes a new balancing and minimal state-space
86+
realization, and separates the ``\mathbf{z}`` terms in two parts (details in Extended Help).
87+
The rest of the documentation assumes discrete models since all systems end up in this form.
8888
8989
See also [`ss`](@extref ControlSystemsBase.ss)
9090
@@ -119,10 +119,11 @@ LinModel with a sample time Ts = 0.1 s and:
119119
`sys` is discrete and the provided argument `Ts ≠ sys.Ts`, the system is resampled by
120120
using the aforementioned discretization methods.
121121
122-
Note that the constructor transforms the system to its minimal realization using [`minreal`](@extref ControlSystemsBase.minreal)
123-
for controllability/observability. As a consequence, the final state-space
124-
representation may be different from the one provided in `sys`. It is also converted
125-
into a more practical form (``\mathbf{D_u=0}`` because of the zero-order hold):
122+
Note that the constructor transforms the system to its minimal and balancing realization
123+
using [`minreal`](@extref ControlSystemsBase.minreal) for controllability/observability.
124+
As a consequence, the final state-space representation will be presumably different from
125+
the one provided in `sys`. It is also converted into a more practical form
126+
(``\mathbf{D_u=0}`` because of the zero-order hold):
126127
```math
127128
\begin{aligned}
128129
\mathbf{x}(k+1) &= \mathbf{A x}(k) + \mathbf{B_u u}(k) + \mathbf{B_d d}(k) \\
@@ -207,7 +208,7 @@ LinModel with a sample time Ts = 0.5 s and:
207208
```
208209
"""
209210
function LinModel(sys::TransferFunction, Ts::Union{Real,Nothing} = nothing; kwargs...)
210-
sys_min = minreal(ss(sys)) # remove useless states with pole-zero cancellation
211+
sys_min = ss(sys) # minreal is automatically called during conversion
211212
return LinModel(sys_min, Ts; kwargs...)
212213
end
213214

0 commit comments

Comments
 (0)