Skip to content

Commit 8b5e6b3

Browse files
committed
test: increase tolerance with hard constraints
1 parent a954c3f commit 8b5e6b3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

test/5_test_extensions.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030
end
3131
N = 50
3232
u_data1, u_data2 = sim_both(model, mpc1, mpc2, N)
33-
@test u_data1 u_data2 atol=1e-3 rtol=1e-3 # looser tol due to different softening
33+
@test u_data1 u_data2 atol=1e-3 rtol=1e-3 # looser tols due to different softening
3434

3535
mpc1_hard = LinMPC(model, Hp=15, Cwt=Inf, optim=optim)
3636
mpc1_hard = setconstraint!(mpc1_hard, ymin=[48, -Inf], umax=[Inf, 30])
3737
mpc2_hard = LinearMPC.MPC(mpc1_hard)
3838
u_data1_hard, u_data2_hard = sim_both(
3939
model, mpc1_hard, mpc2_hard, N
4040
)
41-
@test u_data1_hard u_data2_hard atol=1e-12 # exact match for hard constraints
41+
@test u_data1_hard u_data2_hard atol=1e-10 rtol=1e-10 # tighter tols for hard constraints
4242

4343
mpc_ms = LinMPC(model; transcription=MultipleShooting(), optim)
4444
@test_throws ErrorException LinearMPC.MPC(mpc_ms)

0 commit comments

Comments
 (0)