You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/uncertainty_interface.jl
+33-2Lines changed: 33 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
using SparseArrays
1
2
abstract type UncertainElement{C, F} end
2
3
3
4
struct δ{C, F<:Real} <:UncertainElement{C, F}
@@ -477,11 +478,11 @@ using MonteCarloMeasurements: vecindex
477
478
478
479
Return the `i`th system from a system `P` with `Particles` coefficients.
479
480
480
-
If called without an index, return a vector of systems, one for each possibly `i`.
481
+
If called without an index, return a vector of systems, one for each possible `i`.
481
482
482
483
This function is used to convert from an uncertain representation using `Particles` to a "multi-model" representation using multiple `StateSpace` models.
483
484
484
-
See also [`ss2particles`](@ref) and `MonteCarloMeasurements.nominal`.
485
+
See also [`ss2particles`](@ref), [`mo_sys_from_particles`](@ref) and `MonteCarloMeasurements.nominal`.
485
486
"""
486
487
functionsys_from_particles(P, i)
487
488
A,B,C,D =ssdata(P)
@@ -502,6 +503,36 @@ function sys_from_particles(P)
Converts a state-space model with `Particles` coefficients to a single state-space model with the same number of inputs as `P`, but with `nparticles(P.A)` times the output and state dimensions.
510
+
511
+
If `sparse` is true, the resulting model will be a `HeteroStateSpace` with sparse `A`, `C`, and `D` matrices.
x =reduce(vcat, suffix_i(P.x, i) for i ineachindex(systems)),
531
+
u = P.u,
532
+
y =reduce(vcat, suffix_i(P.y, i) for i ineachindex(systems)),
533
+
)
534
+
end
535
+
505
536
506
537
function ControlSystemsBase.lsim(sys::DelayLtiSystem{T,S}, u, t::AbstractArray{<:Real}, args...; x0=fill(zero(T), nstates(sys)), kwargs...) where {T, S<:AbstractParticles}
0 commit comments