I am pondering to change the definition of the basic object DescriptorStateSpace
used in the DescriptorSystems package from
struct DescriptorStateSpace{T, ET <: ETYPE{T}} <: AbstractDescriptorStateSpace
A::Matrix{T}
E::ET
B::Matrix{T}
C::Matrix{T}
D::Matrix{T}
Ts::Float64
function DescriptorStateSpace{T}(A::Matrix{T}, E::ETYPE{T},
B::Matrix{T}, C::Matrix{T}, D::Matrix{T}, Ts::Real) where {T}
dss_validation(A, E, B, C, D, Ts)
new{T, typeof(E)}(A, E, B, C, D, Float64(Ts))
end
end
to
struct DescriptorStateSpace{T, ET <: ETYPE{T}} <: AbstractDescriptorStateSpace
A::AbstractMatrix{T}
E::ET
B::AbstractMatrix{T}
C::AbstractMatrix{T}
D::AbstractMatrix{T}
Ts::Float64
function DescriptorStateSpace{T}(A::AbstractMatrix{T}, E::ETYPE{T},
B::AbstractMatrix{T}, C::AbstractMatrix{T},
D::AbstractMatrix{T}, Ts::Real) where {T}
dss_validation(A, E, B, C, D, Ts)
new{T, typeof(E)}(A, E, B, C, D, Float64(Ts))
end
end
I must confess, I can not see all implications of such a change regarding the performance of the package (especially regarding compilation times).
With this change, all tests run without any problem, as before.
My motivation for this change is to allow the use of sparse matrices in descriptor system models. I need this functionality in the PeriodicSystems package on which I am currently working (at this moment, simply as a container for lifted systems). I can of course manage without the above modification, by working directly with the system matrices, but the possibility of handling systems models with sparse matrix data is for me appealing for further extensions of the DescriptorSystems
package.
Note: This issue would be easy (i.e., without any modification) if the SparseMatrixCSC
type would be a subtype of Matrix
, but unfortunately it is not (it is only a subtype of AbstractMatrix
).
I would appreciate any opinion on this issue.