Skip to content

Commit

Permalink
make balance_statespace work for more system types
Browse files Browse the repository at this point in the history
closes #835
  • Loading branch information
baggepinnen committed May 12, 2023
1 parent ba2713d commit d3c75c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/ControlSystemsBase/src/types/conversion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,10 @@ end
# balance_statespace(A2, B2, C2, perm)
# end

function balance_statespace(sys::StateSpace, perm::Bool=false)
function balance_statespace(sys::AbstractStateSpace, perm::Bool=false)
A, B, C, T = balance_statespace(sys.A,sys.B,sys.C, perm)
return ss(A,B,C,sys.D,sys.timeevol), T

return basetype(sys)(A,B,C,sys.D, ntuple(i->getfield(sys, i+4), fieldcount(T)-4)...), T
end

# Method that might fail for some exotic types, such as TrackedArrays
Expand Down

0 comments on commit d3c75c6

Please sign in to comment.