Skip to content

Commit

Permalink
Merge pull request #773 from JuliaReach/schillic/quadrotor
Browse files Browse the repository at this point in the history
Fixes in Quadrotor script
  • Loading branch information
schillic authored Feb 9, 2024
2 parents 5cbf157 + 09ed7a3 commit 027a944
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions examples/Quadrotor/Quadrotor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ const l = 0.5 # distance of motors to center mass in m
const Mrotor = 0.1 # motor mass in kg
const M = 1.0 # center mass in kg
const m = M + 4 * Mrotor # total mass in kg
const mg = m * g
const mg = m * g;

# moments of inertia
const Jx = (2 / 5) * M * R^2 + 2 * l^2 * Mrotor
const Jy = Jx
const Jz = (2 / 5) * M * R^2 + 4 * l^2 * Mrotor
const Cyzx = (Jy - Jz) / Jx
const Czxy = (Jz - Jx) / Jy
const Cxyz = 0.0 #(Jx - Jy)/Jz
const Cxyz = 0.0; #(Jx - Jy)/Jz

# considering the control parameters as *parameters*
const u₁ = 1.0
Expand Down Expand Up @@ -210,7 +210,7 @@ function quadrotor(; T=5.0, plot_vars=[0, 3],
prob = @ivp(x' = quadrotor!(x), dim:12, x(0) X0)

return prob
end
end;

#-

Expand All @@ -223,7 +223,7 @@ cases = ["Δ=0.1", "Δ=0.4", "Δ=0.8"];
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)
alg = TMJets(; abstol=1e-7, orderT=5, orderQ=1, adaptive=false);

# warm-up run
sol1 = solve(prob; tspan=Tspan, alg=alg);
Expand All @@ -234,22 +234,22 @@ solz1 = overapproximate(sol1, Zonotope);
Wpos = 0.4
Wvel = 0.4
prob = quadrotor(; project_reachset=false, Wpos=Wpos, Wvel=Wvel)
alg = TMJets(; abstol=1e-7, orderT=5, orderQ=1, adaptive=false)
alg = TMJets(; abstol=1e-7, orderT=5, orderQ=1, adaptive=false);

# warm-up run
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)")
## verify that specification holds
## property = quad_property(solz2)
## println("Validate property, case $(cases[2]) : $(property)")

# ### 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)
alg = TMJets(; abstol=1e-7, orderT=5, orderQ=1, adaptive=false);

# warm-up run
sol3 = solve(prob; tspan=Tspan, alg=alg);
Expand Down

0 comments on commit 027a944

Please sign in to comment.