diff --git a/docs/src/tutorial-solve.md b/docs/src/tutorial-solve.md index 33978239..8ada8bca 100644 --- a/docs/src/tutorial-solve.md +++ b/docs/src/tutorial-solve.md @@ -148,7 +148,7 @@ for i in 1:n # state end for i in 1:n # costate - plot!(plt[n+i], t, t -> p(t)[i]; color=2, linestyle=:dash, label=:none) + plot!(plt[n+i], t, t -> -p(t)[i]; color=2, linestyle=:dash, label=:none) end for i in 1:m # control diff --git a/ext/Descriptions/quadrotor.md b/ext/Descriptions/quadrotor.md deleted file mode 100644 index 517946d2..00000000 --- a/ext/Descriptions/quadrotor.md +++ /dev/null @@ -1,90 +0,0 @@ -This problem models the **minimum-time maneuvering of a quadrotor** from an initial position to a target position while respecting thrust and tilt constraints. -The quadrotor is modelled as a rigid body with translational and rotational dynamics, subject to actuator limits and tilt angle restrictions. - -### System Description - -The system has **8 states** and **4 controls**: - -- **States**: - - $p_1, p_2, p_3$: position coordinates of the quadrotor - - $v_1, v_2, v_3$: linear velocities - - $\phi$: roll angle - - $\theta$: pitch angle - -- **Controls**: - - $a_t$: total thrust magnitude - - $\dot{\phi}$: roll rate - - $\dot{\theta}$: pitch rate - - $\psi$: yaw angle - -### Constraints - -- **Time horizon**: $t_f \ge 0.1$ -- **State constraints**: - -```math --\pi/2 \le \phi(t), \theta(t) \le \pi/2 -``` - -- **Control constraints**: - -```math -a_{\min} \le a_t(t) \le a_{\max}, \quad --d_{\text{tilt,max}} \le \dot{\phi}(t), \dot{\theta}(t) \le d_{\text{tilt,max}} -``` - -- **Tilt path constraint**: - -```math -\cos\theta(t) \cos\phi(t) \ge \cos(\text{tiltmax}) -``` - -- **Boundary conditions**: - -```math -p(0) = p_0, \quad v(0) = v_0, \quad \phi(0) = \phi_0, \quad \theta(0) = \theta_0 -``` - -```math -p(t_f) = p_f, \quad v(t_f) = v_f -``` - -### Dynamics - -The quadrotor dynamics are described by - -```math -\dot{p} = v, \quad \dot{v} = a -``` - -```math -\dot{\phi} = \dot{\phi}_{\rm control}, \quad \dot{\theta} = \dot{\theta}_{\rm control} -``` - -where the acceleration $a$ is computed from the total thrust $a_t$ and orientation angles $(\phi, \theta, \psi)$: - -```math -R = -\begin{bmatrix} -c_\psi c_\theta & c_\psi s_\theta s_\phi - s_\psi c_\phi & c_\psi s_\theta c_\phi + s_\psi s_\phi \\ -s_\psi c_\theta & s_\psi s_\theta s_\phi + c_\psi c_\phi & s_\psi s_\theta c_\phi - c_\psi s_\phi \\ --s_\theta & c_\theta s_\phi & c_\theta c_\phi -\end{bmatrix}, \quad -a = R \begin{bmatrix} 0 \\ 0 \\ a_t \end{bmatrix} + \begin{bmatrix} 0 \\ 0 \\ -g \end{bmatrix} -``` - -with $c_\phi = \cos\phi$, $s_\phi = \sin\phi$, etc. - -### Objective - -The goal is to **minimize the final time** $t_f$, with a small regularization on control inputs and yaw angle: - -```math -J = t_f + \int_0^{t_f} \Big( 1e-8 (a_t^2 + \phi^2 + \theta^2 + \psi^2) + 1e2 (\psi - \psi_0)^2 \Big) dt \to \min -``` - -### References - -- Vanroye, L., Sathya, A., De Schutter, J., & Decré, W. (2023). FATROP: A Fast Constrained Optimal Control Problem Solver for Robot Trajectory Optimization and Control. *arXiv preprint arXiv:2303.16746*. Retrieved from https://arxiv.org/pdf/2303.16746 -- Mellinger, D., & Kumar, V. (2011). Minimum snap trajectory generation and control for quadrotors. *2011 IEEE International Conference on Robotics and Automation*, 2520–2525. -- Faessler, M., Franchi, A., & Scaramuzza, D. (2018). Differential flatness of quadrotor dynamics subject to rotor drag for accurate tracking of high-speed trajectories. *IEEE Robotics and Automation Letters*, 3(2), 620–626. diff --git a/ext/JuMPModels/quadrotor.jl b/ext/JuMPModels/quadrotor.jl deleted file mode 100644 index 4740e835..00000000 --- a/ext/JuMPModels/quadrotor.jl +++ /dev/null @@ -1,153 +0,0 @@ -""" -$(TYPEDSIGNATURES) - -Constructs and returns a JuMP model for the **Quadrotor Optimal Control Problem**. -The model represents the 3D dynamics of a quadrotor with translational and rotational states, subject to thrust and tilt constraints. -The objective is to minimise the final time (`tf`) to reach a specified target position while respecting path and actuation constraints. - -# Arguments - -- `::JuMPBackend`: Specifies the backend for building the JuMP model. -- `N::Int=50`: (Keyword) Number of discretisation steps for the time grid. - -# Returns - -- `model::JuMP.Model`: A JuMP model representing the Quadrotor optimal control problem. - -# Example - -```julia-repl -julia> using OptimalControlProblems -julia> using JuMP - -julia> model = OptimalControlProblems.quadrotor(JuMPBackend(); N=20) -``` - -# References - -- Problem formulation available at: https://arxiv.org/pdf/2303.16746 -""" -function OptimalControlProblems.quadrotor( - ::JuMPBackend, args...; N::Int=steps_number_data(:quadrotor), kwargs... -) - - # parameters - g = 9.81 - atmin = 0 - atmax = 9.18 * 5 - tiltmax = 1.1 / 2 - dtiltmax = 6 / 2 - p0 = [0, 0, 2.5] - v0 = [0, 0, 0] - u0 = [9.81, 0, 0, 0] - pf = [0.01, 5, 2.5] - vf = [0, 0, 0] - - # model - model = JuMP.Model(args...; kwargs...) - - # - @variables( - model, - begin - - # variable - 0.1 <= tf, (start = 1) - - # state - p₁[0:N], (start = 0.1) - p₂[0:N], (start = 0.1) - p₃[0:N], (start = 0.1) - v₁[0:N], (start = 0.1) - v₂[0:N], (start = 0.1) - v₃[0:N], (start = 0.1) - -π / 2 <= ϕ[0:N] <= π / 2, (start = 0.1) - -π / 2 <= θ[0:N] <= π / 2, (start = 0.1) - - # control - atmin <= at[0:N] <= atmax, (start = 10) - -dtiltmax <= dϕ[0:N] <= dtiltmax, (start = 0.1) - -dtiltmax <= dθ[0:N] <= dtiltmax, (start = 0.1) - ψ[0:N], (start = 0.1) - end - ) - - # path constraints - @constraints( - model, - begin - cond_tiltmax[i = 0:N], cos(θ[i]) * cos(ϕ[i]) >= cos(tiltmax) - end - ) - - # initial and final conditions - @constraints( - model, - begin - p₁_i, p₁[0] == p0[1] - p₂_i, p₂[0] == p0[2] - p₃_i, p₃[0] == p0[3] - v₁_i, v₁[0] == v0[1] - v₂_i, v₂[0] == v0[2] - v₃_i, v₃[0] == v0[3] - ϕ_i, ϕ[0] == u0[2] - θ_i, θ[0] == u0[3] - p₁_f, p₁[N] == pf[1] - p₂_f, p₂[N] == pf[2] - p₃_f, p₃[N] == pf[3] - v₁_f, v₁[N] == vf[1] - v₂_f, v₂[N] == vf[2] - v₃_f, v₃[N] == vf[3] - end - ) - - # dynamics - @expressions( - model, - begin - - # - step, tf / N - - # dynamics - cr[i = 0:N], cos(ϕ[i]) - sr[i = 0:N], sin(ϕ[i]) - cp[i = 0:N], cos(θ[i]) - sp[i = 0:N], sin(θ[i]) - cy[i = 0:N], cos(ψ[i]) - sy[i = 0:N], sin(ψ[i]) - R[i = 0:N], - [ - (cy[i] * cp[i]) (cy[i] * sp[i] * sr[i] - sy[i] * cr[i]) (cy[i] * sp[i] * cr[i] + sy[i] * sr[i]) - (sy[i] * cp[i]) (sy[i] * sp[i] * sr[i] + cy[i] * cr[i]) (sy[i] * sp[i] * cr[i] - cy[i] * sr[i]) - (-sp[i]) (cp[i] * sr[i]) (cp[i] * cr[i]) - ] - at_[i = 0:N], R[i] * [0; 0; at[i]] - g_, [0; 0; -g] - a[i = 0:N], at_[i] + g_ - - # objective - dc[i = 0:N], - 1e-8 * (at[i]^2 + ϕ[i]^2 + θ[i]^2 + ψ[i]^2) + 1e2 * (ψ[i] - u0[3])^2 - end - ) - - @constraints( - model, - begin - ∂p₁[i = 1:N], p₁[i] == p₁[i - 1] + 0.5 * step * (v₁[i] + v₁[i - 1]) - ∂p₂[i = 1:N], p₂[i] == p₂[i - 1] + 0.5 * step * (v₂[i] + v₂[i - 1]) - ∂p₃[i = 1:N], p₃[i] == p₃[i - 1] + 0.5 * step * (v₃[i] + v₃[i - 1]) - ∂v₁[i = 1:N], v₁[i] == v₁[i - 1] + 0.5 * step * (a[i][1] + a[i - 1][1]) - ∂v₂[i = 1:N], v₂[i] == v₂[i - 1] + 0.5 * step * (a[i][2] + a[i - 1][2]) - ∂v₃[i = 1:N], v₃[i] == v₃[i - 1] + 0.5 * step * (a[i][3] + a[i - 1][3]) - ∂ϕ[i = 1:N], ϕ[i] == ϕ[i - 1] + 0.5 * step * (dϕ[i] + dϕ[i - 1]) - ∂θ[i = 1:N], θ[i] == θ[i - 1] + 0.5 * step * (dθ[i] + dθ[i - 1]) - end - ) - - # objective - @objective(model, Min, tf + 0.5 * step * sum(dc[i] + dc[i - 1] for i in 1:N)) - - return model -end diff --git a/ext/MetaData/quadrotor.jl b/ext/MetaData/quadrotor.jl deleted file mode 100644 index 72cfabfa..00000000 --- a/ext/MetaData/quadrotor.jl +++ /dev/null @@ -1,10 +0,0 @@ -quadrotor_meta = OrderedDict( - :name => "quadrotor", - :N => 50, - :minimise => true, - :state_name => ["p₁", "p₂", "p₃", "v₁", "v₂", "v₃", "ϕ", "θ"], - :costate_name => ["∂p₁", "∂p₂", "∂p₃", "∂v₁", "∂v₂", "∂v₃", "∂ϕ", "∂θ"], - :control_name => ["at", "dϕ", "dθ", "ψ"], - :variable_name => ["tf"], - :final_time => (:free, 1), # first component of the variable -) diff --git a/ext/OptimalControlModels/quadrotor.jl b/ext/OptimalControlModels/quadrotor.jl deleted file mode 100644 index 65a0debd..00000000 --- a/ext/OptimalControlModels/quadrotor.jl +++ /dev/null @@ -1,126 +0,0 @@ -""" -$(TYPEDSIGNATURES) - -Constructs an **OptimalControl problem** for the Quadrotor benchmark model. -This function defines the state and control variables, system dynamics, bounds, initial and final conditions, and the cost functional, which minimises the final time to reach a target position while including small penalties on control inputs. -It returns both a discretised direct optimal control problem (DOCP) and the corresponding nonlinear programming (NLP) model. - -# Arguments - -- `::OptimalControlBackend`: Placeholder type specifying the OptimalControl backend or solver interface. -- `N::Int=50`: (Keyword) Number of discretisation points for the direct transcription grid. - -# Returns - -- `docp`: The direct optimal control problem object representing the Quadrotor problem. -- `nlp`: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation. - -# Example - -```julia-repl -julia> using OptimalControlProblems - -julia> docp = OptimalControlProblems.quadrotor(OptimalControlBackend(); N=50); -``` -""" -function OptimalControlProblems.quadrotor( - ::OptimalControlBackend, description::Symbol...; N::Int=steps_number_data(:quadrotor), kwargs... -) - - # parameters - g = 9.81 - atmin = 0 - atmax = 9.18 * 5 - tiltmax = 1.1 / 2 - dtiltmax = 6 / 2 - p0 = [0, 0, 2.5] - v0 = [0, 0, 0] - u0 = [9.81, 0, 0, 0] - pf = [0.01, 5, 2.5] - vf = [0, 0, 0] - - ocp = @def begin - tf ∈ R, variable - t ∈ [0, tf], time - x = (p₁, p₂, p₃, v₁, v₂, v₃, ϕ, θ) ∈ R⁸, state - u = (at, dϕ, dθ, ψ) ∈ R⁴, control - - # state constraints - tf ≥ 0.1, (tf_con) - -π / 2 ≤ ϕ(t) ≤ π / 2, (ϕ_con) - -π / 2 ≤ θ(t) ≤ π / 2, (θ_con) - - # control constraints - atmin ≤ at(t) ≤ atmax, (at_con) - -dtiltmax ≤ dϕ(t) ≤ dtiltmax, (ϕdot_con) - -dtiltmax ≤ dθ(t) ≤ dtiltmax, (θdot_con) - - # path constraints - cos(θ(t)) * cos(ϕ(t)) ≥ cos(tiltmax), (tiltmax_con) - - # initial constraints - p₁(0) == p0[1], (p₁_i) - p₂(0) == p0[2], (p₂_i) - p₃(0) == p0[3], (p₃_i) - v₁(0) == v0[1], (v₁_i) - v₂(0) == v0[2], (v₂_i) - v₃(0) == v0[3], (v₃_i) - ϕ(0) == u0[2], (ϕ_i) - θ(0) == u0[3], (θ_i) - - # final constraints - p₁(tf) == pf[1], (p₁_f) - p₂(tf) == pf[2], (p₂_f) - p₃(tf) == pf[3], (p₃_f) - v₁(tf) == vf[1], (v₁_f) - v₂(tf) == vf[2], (v₂_f) - v₃(tf) == vf[3], (v₃_f) - - # dynamics - ẋ(t) == dynamics(x(t), u(t)) - - # objective - tf + ∫(1e-8 * (at(t)^2 + ϕ(t)^2 + θ(t)^2 + ψ(t)^2) + 1e2 * (ψ(t) - u0[3])^2) → min - end - - function dynamics(x, u) - p₁, p₂, p₃, v₁, v₂, v₃, ϕ, θ = x - at, dϕ, dθ, ψ = u - - cr = cos(ϕ) - sr = sin(ϕ) - cp = cos(θ) - sp = sin(θ) - cy = cos(ψ) - sy = sin(ψ) - R = [ - (cy * cp) (cy * sp * sr - sy * cr) (cy * sp * cr + sy * sr) - (sy * cp) (sy * sp * sr + cy * cr) (sy * sp * cr - cy * sr) - (-sp) (cp * sr) (cp * cr) - ] - at_ = R * [0; 0; at] - g_ = [0; 0; -g] - a = at_ + g_ - - return [v₁, v₂, v₃, a[1], a[2], a[3], dϕ, dθ] - end - - # initial guess - xinit = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1] # [p₁, p₂, p₃, v₁, v₂, v₃, ϕ, θ] - uinit = [10, 0.1, 0.1, 0.1] # [at, dϕ, dθ, ψ] - varinit = [1] # [tf] - init = (state=xinit, control=uinit, variable=varinit) - - # DOCP and NLP - docp = direct_transcription( - ocp, - description...; - lagrange_to_mayer=false, - init=init, - grid_size=N, - disc_method=:trapeze, - kwargs... - ) - - return docp -end diff --git a/test/Project.toml b/test/Project.toml index b71fe07e..89cf12fd 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -14,6 +14,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] Aqua = "0.8" CTBase = "0.16" +CTDirect = "0.16" Interpolations = "0.15, 0.16" Ipopt = "1" JuMP = "1" diff --git a/test/figures/init/beam.pdf b/test/figures/init/beam.pdf index 18fe472c..4631f547 100644 Binary files a/test/figures/init/beam.pdf and b/test/figures/init/beam.pdf differ diff --git a/test/figures/init/bioreactor.pdf b/test/figures/init/bioreactor.pdf index 27ce0fc9..91249ce4 100644 Binary files a/test/figures/init/bioreactor.pdf and b/test/figures/init/bioreactor.pdf differ diff --git a/test/figures/init/cart_pendulum.pdf b/test/figures/init/cart_pendulum.pdf index 427b0a8a..17140a66 100644 Binary files a/test/figures/init/cart_pendulum.pdf and b/test/figures/init/cart_pendulum.pdf differ diff --git a/test/figures/init/chain.pdf b/test/figures/init/chain.pdf index b15e00ec..195d6bca 100644 Binary files a/test/figures/init/chain.pdf and b/test/figures/init/chain.pdf differ diff --git a/test/figures/init/dielectrophoretic_particle.pdf b/test/figures/init/dielectrophoretic_particle.pdf index 6314dcbb..2a8f3270 100644 Binary files a/test/figures/init/dielectrophoretic_particle.pdf and b/test/figures/init/dielectrophoretic_particle.pdf differ diff --git a/test/figures/init/double_oscillator.pdf b/test/figures/init/double_oscillator.pdf index cfa9de1b..220597ba 100644 Binary files a/test/figures/init/double_oscillator.pdf and b/test/figures/init/double_oscillator.pdf differ diff --git a/test/figures/init/ducted_fan.pdf b/test/figures/init/ducted_fan.pdf index a845506a..9356ce84 100644 Binary files a/test/figures/init/ducted_fan.pdf and b/test/figures/init/ducted_fan.pdf differ diff --git a/test/figures/init/electric_vehicle.pdf b/test/figures/init/electric_vehicle.pdf index 989696c4..d9544d82 100644 Binary files a/test/figures/init/electric_vehicle.pdf and b/test/figures/init/electric_vehicle.pdf differ diff --git a/test/figures/init/glider.pdf b/test/figures/init/glider.pdf index a7c3875d..844451ca 100644 Binary files a/test/figures/init/glider.pdf and b/test/figures/init/glider.pdf differ diff --git a/test/figures/init/insurance.pdf b/test/figures/init/insurance.pdf index 57c40b8c..cd3c3e11 100644 Binary files a/test/figures/init/insurance.pdf and b/test/figures/init/insurance.pdf differ diff --git a/test/figures/init/jackson.pdf b/test/figures/init/jackson.pdf index 438dadfe..b90a9e1c 100644 Binary files a/test/figures/init/jackson.pdf and b/test/figures/init/jackson.pdf differ diff --git a/test/figures/init/moonlander.pdf b/test/figures/init/moonlander.pdf index 756257c9..bac2e36d 100644 Binary files a/test/figures/init/moonlander.pdf and b/test/figures/init/moonlander.pdf differ diff --git a/test/figures/init/robbins.pdf b/test/figures/init/robbins.pdf index 576a95d8..299a93ae 100644 Binary files a/test/figures/init/robbins.pdf and b/test/figures/init/robbins.pdf differ diff --git a/test/figures/init/robot.pdf b/test/figures/init/robot.pdf index faf4f7a8..fd55b787 100644 Binary files a/test/figures/init/robot.pdf and b/test/figures/init/robot.pdf differ diff --git a/test/figures/init/rocket.pdf b/test/figures/init/rocket.pdf index 73e42406..ae7dd14b 100644 Binary files a/test/figures/init/rocket.pdf and b/test/figures/init/rocket.pdf differ diff --git a/test/figures/init/space_shuttle.pdf b/test/figures/init/space_shuttle.pdf index 6e635947..6149a5d1 100644 Binary files a/test/figures/init/space_shuttle.pdf and b/test/figures/init/space_shuttle.pdf differ diff --git a/test/figures/init/steering.pdf b/test/figures/init/steering.pdf index 52b17002..95e8da72 100644 Binary files a/test/figures/init/steering.pdf and b/test/figures/init/steering.pdf differ diff --git a/test/figures/init/truck_trailer.pdf b/test/figures/init/truck_trailer.pdf index 173398a9..7e3a3522 100644 Binary files a/test/figures/init/truck_trailer.pdf and b/test/figures/init/truck_trailer.pdf differ diff --git a/test/figures/init/vanderpol.pdf b/test/figures/init/vanderpol.pdf index 1ac19d5e..96ea7506 100644 Binary files a/test/figures/init/vanderpol.pdf and b/test/figures/init/vanderpol.pdf differ diff --git a/test/figures/solution/beam.pdf b/test/figures/solution/beam.pdf index 8865e13d..311dcfeb 100644 Binary files a/test/figures/solution/beam.pdf and b/test/figures/solution/beam.pdf differ diff --git a/test/figures/solution/bioreactor.pdf b/test/figures/solution/bioreactor.pdf index 7bf0959e..d5dedaeb 100644 Binary files a/test/figures/solution/bioreactor.pdf and b/test/figures/solution/bioreactor.pdf differ diff --git a/test/figures/solution/cart_pendulum.pdf b/test/figures/solution/cart_pendulum.pdf index dca20486..a8796c9f 100644 Binary files a/test/figures/solution/cart_pendulum.pdf and b/test/figures/solution/cart_pendulum.pdf differ diff --git a/test/figures/solution/chain.pdf b/test/figures/solution/chain.pdf index 6ddd318e..6aeaa820 100644 Binary files a/test/figures/solution/chain.pdf and b/test/figures/solution/chain.pdf differ diff --git a/test/figures/solution/dielectrophoretic_particle.pdf b/test/figures/solution/dielectrophoretic_particle.pdf index 6b235497..6fe975a5 100644 Binary files a/test/figures/solution/dielectrophoretic_particle.pdf and b/test/figures/solution/dielectrophoretic_particle.pdf differ diff --git a/test/figures/solution/double_oscillator.pdf b/test/figures/solution/double_oscillator.pdf index b37b2a19..7744a0e6 100644 Binary files a/test/figures/solution/double_oscillator.pdf and b/test/figures/solution/double_oscillator.pdf differ diff --git a/test/figures/solution/ducted_fan.pdf b/test/figures/solution/ducted_fan.pdf index 62e16b83..e8304c7d 100644 Binary files a/test/figures/solution/ducted_fan.pdf and b/test/figures/solution/ducted_fan.pdf differ diff --git a/test/figures/solution/electric_vehicle.pdf b/test/figures/solution/electric_vehicle.pdf index 0e93f337..a3151548 100644 Binary files a/test/figures/solution/electric_vehicle.pdf and b/test/figures/solution/electric_vehicle.pdf differ diff --git a/test/figures/solution/glider.pdf b/test/figures/solution/glider.pdf index 71eae8bd..4be1a221 100644 Binary files a/test/figures/solution/glider.pdf and b/test/figures/solution/glider.pdf differ diff --git a/test/figures/solution/insurance.pdf b/test/figures/solution/insurance.pdf index 3e01376f..cbe6996a 100644 Binary files a/test/figures/solution/insurance.pdf and b/test/figures/solution/insurance.pdf differ diff --git a/test/figures/solution/jackson.pdf b/test/figures/solution/jackson.pdf index 893c4715..6fc6c93d 100644 Binary files a/test/figures/solution/jackson.pdf and b/test/figures/solution/jackson.pdf differ diff --git a/test/figures/solution/moonlander.pdf b/test/figures/solution/moonlander.pdf index c4940786..62b7c641 100644 Binary files a/test/figures/solution/moonlander.pdf and b/test/figures/solution/moonlander.pdf differ diff --git a/test/figures/solution/robbins.pdf b/test/figures/solution/robbins.pdf index f4fad0a8..e752cb0d 100644 Binary files a/test/figures/solution/robbins.pdf and b/test/figures/solution/robbins.pdf differ diff --git a/test/figures/solution/robot.pdf b/test/figures/solution/robot.pdf index ee2e2650..883df745 100644 Binary files a/test/figures/solution/robot.pdf and b/test/figures/solution/robot.pdf differ diff --git a/test/figures/solution/rocket.pdf b/test/figures/solution/rocket.pdf index b325d5ec..ccdd6363 100644 Binary files a/test/figures/solution/rocket.pdf and b/test/figures/solution/rocket.pdf differ diff --git a/test/figures/solution/space_shuttle.pdf b/test/figures/solution/space_shuttle.pdf index df3006e0..70d8f3e5 100644 Binary files a/test/figures/solution/space_shuttle.pdf and b/test/figures/solution/space_shuttle.pdf differ diff --git a/test/figures/solution/steering.pdf b/test/figures/solution/steering.pdf index 1c6a9f7c..4be292ca 100644 Binary files a/test/figures/solution/steering.pdf and b/test/figures/solution/steering.pdf differ diff --git a/test/figures/solution/truck_trailer.pdf b/test/figures/solution/truck_trailer.pdf index 20cd932f..ea5788f5 100644 Binary files a/test/figures/solution/truck_trailer.pdf and b/test/figures/solution/truck_trailer.pdf differ diff --git a/test/figures/solution/vanderpol.pdf b/test/figures/solution/vanderpol.pdf index 88e5a08d..f3bebda9 100644 Binary files a/test/figures/solution/vanderpol.pdf and b/test/figures/solution/vanderpol.pdf differ diff --git a/test/runtests.jl b/test/runtests.jl index e7fc0377..a4df4153 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -30,7 +30,7 @@ end # Remove from the tests the following problems # problems_to_exclude = [ - +# :quadrotor # ] # list_of_problems = setdiff(list_of_problems, problems_to_exclude) diff --git a/test/utils.jl b/test/utils.jl index 107e12a0..4355ae31 100644 --- a/test/utils.jl +++ b/test/utils.jl @@ -258,9 +258,7 @@ function comparison(; max_iter, test_name) L2_jp = L2_norm(t_oc, xi_jp) L2_bd = max(0.5*(L2_oc + L2_jp)*ε_rel_state, ε_abs_state) res = @my_test_broken L2_di < L2_bd - if f != :quadrotor - keep_problem = keep_problem && (typeof(res) == Test.Pass) - end + keep_problem = keep_problem && (typeof(res) == Test.Pass) DEBUG && println("├─ state $(x_vars[i])") DEBUG && println("│") @@ -293,9 +291,7 @@ function comparison(; max_iter, test_name) L2_jp = L2_norm(t_oc, ui_jp) L2_bd = max(0.5*(L2_oc + L2_jp)*ε_rel_control, ε_abs_control) res = @my_test_broken L2_di < L2_bd - if f != :quadrotor - keep_problem = keep_problem && (typeof(res) == Test.Pass) - end + keep_problem = keep_problem && (typeof(res) == Test.Pass) DEBUG && println("├─ control $(u_vars[i])") DEBUG && println("│") @@ -414,7 +410,7 @@ function comparison(; max_iter, test_name) end # JuMP - labelJP = (test_name == :solution) ? "JuMP: " * string(i_oc) * " it" : "JuMP" + labelJP = (test_name == :solution) ? "JuMP: " * string(i_jp) * " it" : "JuMP" for i in eachindex(x_vars) # state xi_jp = [x_jp[k][i] for k in eachindex(t_jp)] label = i == 1 ? labelJP : :none