Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/named_systems2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,9 @@ function Base.:*(s1::NamedStateSpace{T}, s2::NamedStateSpace{T}) where {T <: CS.
end

function Base.:*(s1::Number, s2::NamedStateSpace{T, S}) where {T <: CS.TimeEvolution, S}
return NamedStateSpace{T,S}(
s1*s2.sys,
s3 = s1*s2.sys
return NamedStateSpace{T, typeof(s3)}(
s3,
s2.x,
s2.u,
[Symbol(string(y)*"_scaled") for y in s2.y],
Expand All @@ -443,8 +444,9 @@ function Base.:*(s1::Number, s2::NamedStateSpace{T, S}) where {T <: CS.TimeEvolu
end

function Base.:*(s1::NamedStateSpace{T, S}, s2::Number) where {T <: CS.TimeEvolution, S}
return NamedStateSpace{T,S}(
s1.sys*s2,
s3 = s1.sys*s2
return NamedStateSpace{T,typeof(s3)}(
s3,
s1.x,
[Symbol(string(u)*"_scaled") for u in s1.u],
s1.y,
Expand Down
3 changes: 3 additions & 0 deletions test/test_named_systems2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ s2 = named_ss(G2, x = [:z], u = [:u2], y=[:y2])

s11 = s1*s1
@test allunique(s11.x)

@test ControlSystemsBase.numeric_type(big(1.0)*s1) <: BigFloat
@test ControlSystemsBase.numeric_type(s1*big(1.0)) <: BigFloat
end

@testset "Concatenation" begin
Expand Down
Loading