Skip to content

Commit

Permalink
Merge pull request #758 from JuliaReach/schillic/757
Browse files Browse the repository at this point in the history
#757 - Fix invalid comments in examples
  • Loading branch information
schillic authored Jan 3, 2024
2 parents 13b8283 + 47756c4 commit b44929c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 28 deletions.
15 changes: 6 additions & 9 deletions examples/LotkaVolterraTangential/LotkaVolterraTangential
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ validation = []
final_area = []
intersect_time = []

# ----------------------------------------
# Case 1:
# ----------------------------------------

# ## Case 1

ε_ext = 1e-4
prob = lotka_volterra(; nsplit=4, ε_ext=ε_ext)
alg = TMJets(abstol=1e-14, orderT=7, orderQ=1)
Expand Down Expand Up @@ -259,9 +259,7 @@ SUITE[model][cases[1]] = @benchmarkable solve($prob,
disjointness_method = BoxEnclosure())


# ==============================================================================
# Execute benchmarks and save benchmark results
# ==============================================================================
# ## Execute benchmarks and save benchmark results

# tune parameters
tune!(SUITE)
Expand All @@ -287,9 +285,8 @@ for (i, c) in enumerate(cases)
" $(final_area[i]), $(intersect_time[i])\n")
end

# ==============================================================================
# Create plots
# ==============================================================================

# ## Create plots

fig = plot()

Expand Down
25 changes: 11 additions & 14 deletions examples/Quadrotor/Quadrotor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ using ReachabilityAnalysis: is_intersection_empty

# ## Reachability settings
#
#The task is to change the height from ``0``~[m] to ``1``~[m] within ``5``~[s].
# The task is to change the height from ``0``~[m] to ``1``~[m] within ``5``~[s].
# A goal region ``[0.98,1.02]`` of the height ``x_3`` has to be reached within
# ``5``~[s] and the height has to stay below ``1.4`` for all times. After
# ``1``~[s] the height should stay above ``0.9``~[m]. The initial value for the
Expand Down Expand Up @@ -218,21 +218,19 @@ end

cases = ["Δ=0.1", "Δ=0.4", "Δ=0.8"];

# ----------------------------------------
# Case 1: smaller uncertainty
# ----------------------------------------
# ### Case 1: smaller uncertainty

Wpos = 0.1
Wvel = 0.1
prob = quadrotor(; project_reachset=false, Wpos=Wpos, Wvel=Wvel)
alg = TMJets(; abstol=1e-7, orderT=5, orderQ=1, adaptive=false)

# Warm-up run
# warm-up run
sol1 = solve(prob; tspan=Tspan, alg=alg);
solz1 = overapproximate(sol1, Zonotope);

# ----------------------------------------
# Case 2: intermediate uncertainty
# ----------------------------------------
# ### Case 2: intermediate uncertainty

Wpos = 0.4
Wvel = 0.4
prob = quadrotor(; project_reachset=false, Wpos=Wpos, Wvel=Wvel)
Expand All @@ -243,18 +241,17 @@ sol2 = solve(prob; tspan=Tspan, alg=alg);
solz2 = overapproximate(sol2, Zonotope);

# verify that specification holds
#property = quad_property(solz2)
#println("Validate property, case $(cases[2]) : $(property)")
# property = quad_property(solz2)
# println("Validate property, case $(cases[2]) : $(property)")

# ### Case 3: large uncertainty

# ----------------------------------------
# Case 3: large uncertainty
# ----------------------------------------
Wpos = 0.8
Wvel = 0.8
prob = quadrotor(; project_reachset=false, Wpos=Wpos, Wvel=Wvel)
alg = TMJets(; abstol=1e-7, orderT=5, orderQ=1, adaptive=false)

# Warm-up run
# warm-up run
sol3 = solve(prob; tspan=Tspan, alg=alg);
solz3 = overapproximate(sol3, Zonotope);

Expand Down
5 changes: 0 additions & 5 deletions test/models/generated/Quadrotor.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using ReachabilityAnalysis
using ReachabilityAnalysis: is_intersection_empty

#The task is to change the height from ``0``~[m] to ``1``~[m] within ``5``~[s].

const g = 9.81 # gravity constant in m/s^2
const R = 0.1 # radius of center mass in m
const l = 0.5 # distance of motors to center mass in m
Expand Down Expand Up @@ -145,9 +143,6 @@ alg = TMJets(; abstol=1e-7, orderT=5, orderQ=1, adaptive=false)
sol2 = solve(prob; tspan=Tspan, alg=alg);
solz2 = overapproximate(sol2, Zonotope);

#property = quad_property(solz2)
#println("Validate property, case $(cases[2]) : $(property)")

Wpos = 0.8
Wvel = 0.8
prob = quadrotor(; project_reachset=false, Wpos=Wpos, Wvel=Wvel)
Expand Down

0 comments on commit b44929c

Please sign in to comment.