Skip to content

Commit

Permalink
test homogenization
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Jan 10, 2025
1 parent 480c2e8 commit b5e8840
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/algorithms/BOX.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# continuous algorithm
sol = solve(ivp; tspan=tspan, alg=alg)
@test isa(sol.alg, BOX)
@test setrep(sol) <: Hyperrectangle
@test setrep(sol) == Hyperrectangle{Float64,Array{Float64,1},Array{Float64,1}}
@test dim(sol) == 1
# discrete algorithm
Expand All @@ -15,6 +14,18 @@
NSTEPS = 500
fp_d = ReachabilityAnalysis.post(alg, ivp_discr, NSTEPS)

# homogenization
A = hcat(state_matrix(ivp))
X = stateset(ivp)
X0 = initial_state(ivp)
B = Id(1, 1.0) # TODO implement for different multiple
U = ConstantInput(Singleton([0.0]))
ivp2 = @ivp(ConstrainedLinearControlContinuousSystem(A, B, X, U), X(0) X0)
sol2 = solve(ivp2; tspan=(0.0, 1.0), alg=alg, homogenize=true)
@test isa(sol2.alg, BOX)
@test setrep(sol2) == Hyperrectangle{Float64,Array{Float64,1},Array{Float64,1}}
@test dim(sol2) == 2

# higher-dimensional homogeneous
ivp, tspan = linear5D_homog()
sol = solve(ivp; tspan=tspan, alg=BOX(; δ=0.01))
Expand Down

0 comments on commit b5e8840

Please sign in to comment.