Skip to content

Commit 6e6e8eb

Browse files
committed
use 'scale' for linear map with IdentityMultiple
1 parent 866387c commit 6e6e8eb

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/Continuous/normalization.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ end
507507
_wrap_invariant(X::LazySet, ::Int) = X
508508
_wrap_invariant(::Nothing, n::Int) = Universe(n)
509509

510-
_wrap_inputs(U::AbstractInput, B::IdentityMultiple) = isidentity(B) ? U : map(u -> B * u, U)
510+
_wrap_inputs(U::AbstractInput, B::IdentityMultiple) = isidentity(B) ? U : map(u -> scale(B.M.λ, u), U)
511511
_wrap_inputs(U::AbstractInput, B::AbstractMatrix) = map(u -> B * u, U)
512512

513513
function _wrap_inputs(U::LazySet, B::IdentityMultiple)

test/algorithms/BOX.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,20 @@
1818
A = hcat(state_matrix(ivp))
1919
X = stateset(ivp)
2020
X0 = initial_state(ivp)
21-
B = Id(1, 1.0) # TODO implement for different multiple
22-
U = ConstantInput(Singleton([0.0]))
21+
B = Id(1, 1.0)
22+
U = ConstantInput(Singleton([1.0]))
2323
ivp2 = @ivp(ConstrainedLinearControlContinuousSystem(A, B, X, U), X(0) X0)
2424
sol2 = solve(ivp2; tspan=(0.0, 1.0), alg=alg, homogenize=true)
2525
@test isa(sol2.alg, BOX)
2626
@test setrep(sol2) == Hyperrectangle{Float64,Array{Float64,1},Array{Float64,1}}
2727
@test dim(sol2) == 2
28+
# multiple of identity
29+
B = Id(1, 2.0)
30+
ivp3 = @ivp(ConstrainedLinearControlContinuousSystem(A, B, X, U), X(0) X0)
31+
sol3 = solve(ivp3; tspan=(0.0, 1.0), alg=alg, homogenize=true)
32+
@test isa(sol3.alg, BOX)
33+
@test setrep(sol3) == Hyperrectangle{Float64,Array{Float64,1},Array{Float64,1}}
34+
@test dim(sol3) == 2
2835

2936
# higher-dimensional homogeneous
3037
ivp, tspan = linear5D_homog()

0 commit comments

Comments
 (0)