From 6f36279a2685ca8d7cf565c39c8950b9a492bf1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Thu, 31 Oct 2024 10:38:14 +0100 Subject: [PATCH] Delete double pendulum --- .../solvers/Double_Pendulum_Safety.jl | 54 ------------------- 1 file changed, 54 deletions(-) delete mode 100644 docs/src/examples/solvers/Double_Pendulum_Safety.jl diff --git a/docs/src/examples/solvers/Double_Pendulum_Safety.jl b/docs/src/examples/solvers/Double_Pendulum_Safety.jl deleted file mode 100644 index ed667e059..000000000 --- a/docs/src/examples/solvers/Double_Pendulum_Safety.jl +++ /dev/null @@ -1,54 +0,0 @@ -using Test #src -using StaticArrays, Plots - -# At this point, we import the useful Dionysos sub-modules. -using Dionysos -const DI = Dionysos -const UT = DI.Utils -const DO = DI.Domain -const ST = DI.System -const SY = DI.Symbolic -const OP = DI.Optim -const AB = OP.Abstraction - -include( - joinpath( - dirname(dirname(pathof(Dionysos))), - "problems/double_pendulum", - "safety_stable_equilibrium.jl", - ), -) - -# and we can instantiate the DC system with the provided system -concrete_problem = DoublePendulum.problem(; approx_mode = "growth") -concrete_system = concrete_problem.system - -x0 = SVector(0.0, 0.0, 0.0, 0.0) -hx = SVector(0.1, 0.1, 0.1, 0.1) -state_grid = DO.GridFree(x0, hx) - -u0 = SVector(0.0); -h = SVector(0.3); -input_grid = DO.GridFree(u0, h); - -using JuMP -optimizer = MOI.instantiate(AB.UniformGridAbstraction.Optimizer) -MOI.set(optimizer, MOI.RawOptimizerAttribute("concrete_problem"), concrete_problem) -MOI.set(optimizer, MOI.RawOptimizerAttribute("state_grid"), state_grid) -MOI.set(optimizer, MOI.RawOptimizerAttribute("input_grid"), input_grid) -MOI.optimize!(optimizer) - -abstract_controller = MOI.get(optimizer, MOI.RawOptimizerAttribute("abstract_controller")) -concrete_controller = MOI.get(optimizer, MOI.RawOptimizerAttribute("concrete_controller")) - -# ### Trajectory display -# We choose the number of steps `nsteps` for the sampled system, i.e. the total elapsed time: `nstep`*`tstep` -# as well as the true initial state `x0` which is contained in the initial state-space defined previously. -nstep = 100 -x0 = SVector(0.15, 0.0, 0.0, 0.0) # SVector(0.15,0.0) # -control_trajectory = - ST.get_closed_loop_trajectory(concrete_system.f, concrete_controller, x0, nstep) - -fig = plot(; aspect_ratio = :equal); -plot!(concrete_system.X); -plot!(control_trajectory; markersize = 1, arrows = false)