diff --git a/test/test_objective.jl b/test/test_objective.jl index 72bdcdc..d11f212 100644 --- a/test/test_objective.jl +++ b/test/test_objective.jl @@ -58,13 +58,13 @@ constraint!(ocp4, :initial, [0,0], :initial_constraint) constraint!(ocp4, :final, [1,0], :final_constraint) constraint!(ocp4, :control, -1, 1, :control_constraint) constraint!(ocp4, :variable, [0.1, 0.1], [10, 10], :variable_constraint) -constraint!(ocp4, :variable, v -> v[2]-v[1], 1.0, Inf ) +constraint!(ocp4, :variable, v -> v[2]-v[1], 0.1, Inf ) dynamics!(ocp4, (x, u, v) -> [x[2], u]) objective!(ocp4, :mayer, (x0, xf, v) -> v[1], :max) sol4 = solve(ocp4, grid_size=100, print_level=0, tol=1e-12) println("Target 8.0, found ", sol4.objective) # with non uniform grid -sol5 = solve(ocp4, time_grid=[0,0.1,0.6,0.95,1], print_level=5, tol=1e-12) +sol5 = solve(ocp4, time_grid=[0,0.1,0.3,0.5,0.6,0.8,0.95,1], print_level=5) plot(sol5, show=true) println("Target 8.0, found ", sol5.objective)