Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes in Quadrotor script #773

Merged
merged 2 commits into from
Feb 9, 2024
Merged
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
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
Loading