Skip to content

Commit 4015f97

Browse files
committed
changed: DimensionMistmatch instead of ArgumentError in setconstraint!
1 parent 6429c6e commit 4015f97

4 files changed

Lines changed: 94 additions & 85 deletions

File tree

src/controller/construct.jl

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -349,84 +349,84 @@ function setconstraint!(
349349
nϵ, nw, nc = mpc.nϵ, con.nw, con.nc
350350
notSolvedYet = (JuMP.termination_status(optim) == JuMP.OPTIMIZE_NOT_CALLED)
351351
if isnothing(Umin) && !isnothing(umin)
352-
size(umin) == (nu,) || throw(ArgumentError("umin size must be $((nu,))"))
352+
size(umin) == (nu,) || throw(DimensionMismatch("umin size must be $((nu,))"))
353353
for i = 1:nu*Hp
354354
con.U0min[i] = umin[(i-1) % nu + 1] - mpc.Uop[i]
355355
end
356356
elseif !isnothing(Umin)
357-
size(Umin) == (nu*Hp,) || throw(ArgumentError("Umin size must be $((nu*Hp,))"))
357+
size(Umin) == (nu*Hp,) || throw(DimensionMismatch("Umin size must be $((nu*Hp,))"))
358358
con.U0min .= Umin .- mpc.Uop
359359
end
360360
if isnothing(Umax) && !isnothing(umax)
361-
size(umax) == (nu,) || throw(ArgumentError("umax size must be $((nu,))"))
361+
size(umax) == (nu,) || throw(DimensionMismatch("umax size must be $((nu,))"))
362362
for i = 1:nu*Hp
363363
con.U0max[i] = umax[(i-1) % nu + 1] - mpc.Uop[i]
364364
end
365365
elseif !isnothing(Umax)
366-
size(Umax) == (nu*Hp,) || throw(ArgumentError("Umax size must be $((nu*Hp,))"))
366+
size(Umax) == (nu*Hp,) || throw(DimensionMismatch("Umax size must be $((nu*Hp,))"))
367367
con.U0max .= Umax .- mpc.Uop
368368
end
369369
if isnothing(ΔUmin) && !isnothing(Δumin)
370-
size(Δumin) == (nu,) || throw(ArgumentError("Δumin size must be $((nu,))"))
370+
size(Δumin) == (nu,) || throw(DimensionMismatch("Δumin size must be $((nu,))"))
371371
for i = 1:nu*Hc
372372
con.ΔŨmin[i] = Δumin[(i-1) % nu + 1]
373373
end
374374
elseif !isnothing(ΔUmin)
375-
size(ΔUmin) == (nu*Hc,) || throw(ArgumentError("ΔUmin size must be $((nu*Hc,))"))
375+
size(ΔUmin) == (nu*Hc,) || throw(DimensionMismatch("ΔUmin size must be $((nu*Hc,))"))
376376
con.ΔŨmin[1:nu*Hc] .= ΔUmin
377377
end
378378
if isnothing(ΔUmax) && !isnothing(Δumax)
379-
size(Δumax) == (nu,) || throw(ArgumentError("Δumax size must be $((nu,))"))
379+
size(Δumax) == (nu,) || throw(DimensionMismatch("Δumax size must be $((nu,))"))
380380
for i = 1:nu*Hc
381381
con.ΔŨmax[i] = Δumax[(i-1) % nu + 1]
382382
end
383383
elseif !isnothing(ΔUmax)
384-
size(ΔUmax) == (nu*Hc,) || throw(ArgumentError("ΔUmax size must be $((nu*Hc,))"))
384+
size(ΔUmax) == (nu*Hc,) || throw(DimensionMismatch("ΔUmax size must be $((nu*Hc,))"))
385385
con.ΔŨmax[1:nu*Hc] .= ΔUmax
386386
end
387387
if isnothing(Ymin) && !isnothing(ymin)
388-
size(ymin) == (ny,) || throw(ArgumentError("ymin size must be $((ny,))"))
388+
size(ymin) == (ny,) || throw(DimensionMismatch("ymin size must be $((ny,))"))
389389
for i = 1:ny*Hp
390390
con.Y0min[i] = ymin[(i-1) % ny + 1] - mpc.Yop[i]
391391
end
392392
elseif !isnothing(Ymin)
393-
size(Ymin) == (ny*Hp,) || throw(ArgumentError("Ymin size must be $((ny*Hp,))"))
393+
size(Ymin) == (ny*Hp,) || throw(DimensionMismatch("Ymin size must be $((ny*Hp,))"))
394394
con.Y0min .= Ymin .- mpc.Yop
395395
end
396396
if isnothing(Ymax) && !isnothing(ymax)
397-
size(ymax) == (ny,) || throw(ArgumentError("ymax size must be $((ny,))"))
397+
size(ymax) == (ny,) || throw(DimensionMismatch("ymax size must be $((ny,))"))
398398
for i = 1:ny*Hp
399399
con.Y0max[i] = ymax[(i-1) % ny + 1] - mpc.Yop[i]
400400
end
401401
elseif !isnothing(Ymax)
402-
size(Ymax) == (ny*Hp,) || throw(ArgumentError("Ymax size must be $((ny*Hp,))"))
402+
size(Ymax) == (ny*Hp,) || throw(DimensionMismatch("Ymax size must be $((ny*Hp,))"))
403403
con.Y0max .= Ymax .- mpc.Yop
404404
end
405405

406406
if isnothing(Wmin) && !isnothing(wmin)
407-
size(wmin) == (nw,) || throw(ArgumentError("wmin size must be $((nw,))"))
407+
size(wmin) == (nw,) || throw(DimensionMismatch("wmin size must be $((nw,))"))
408408
for i = 1:nw*(Hp+1)
409409
con.Wmin[i] = wmin[(i-1) % nw + 1]
410410
end
411411
elseif !isnothing(Wmin)
412-
size(Wmin) == (nw*(Hp+1),) || throw(ArgumentError("Wmin size must be $((nw*(Hp+1),))"))
412+
size(Wmin) == (nw*(Hp+1),) || throw(DimensionMismatch("Wmin size must be $((nw*(Hp+1),))"))
413413
con.Wmin .= Wmin
414414
end
415415
if isnothing(Wmax) && !isnothing(wmax)
416-
size(wmax) == (nw,) || throw(ArgumentError("wmax size must be $((nw,))"))
416+
size(wmax) == (nw,) || throw(DimensionMismatch("wmax size must be $((nw,))"))
417417
for i = 1:nw*(Hp+1)
418418
con.Wmax[i] = wmax[(i-1) % nw + 1]
419419
end
420420
elseif !isnothing(Wmax)
421-
size(Wmax) == (nw*(Hp+1),) || throw(ArgumentError("Wmax size must be $((nw*(Hp+1),))"))
421+
size(Wmax) == (nw*(Hp+1),) || throw(DimensionMismatch("Wmax size must be $((nw*(Hp+1),))"))
422422
con.Wmax .= Wmax
423423
end
424424
if !isnothing(x̂min)
425-
size(x̂min) == (nx̂,) || throw(ArgumentError("x̂min size must be $((nx̂,))"))
425+
size(x̂min) == (nx̂,) || throw(DimensionMismatch("x̂min size must be $((nx̂,))"))
426426
con.x̂0min .= x̂min .- mpc.estim.x̂op
427427
end
428428
if !isnothing(x̂max)
429-
size(x̂max) == (nx̂,) || throw(ArgumentError("x̂max size must be $((nx̂,))"))
429+
size(x̂max) == (nx̂,) || throw(DimensionMismatch("x̂max size must be $((nx̂,))"))
430430
con.x̂0max .= x̂max .- mpc.estim.x̂op
431431
end
432432
allECRs = (
@@ -448,57 +448,57 @@ function setconstraint!(
448448
isnothing(C_wmin) && !isnothing(c_wmin) && (C_wmin = repeat(c_wmin, Hp+1))
449449
isnothing(C_wmax) && !isnothing(c_wmax) && (C_wmax = repeat(c_wmax, Hp+1))
450450
if !isnothing(C_umin)
451-
size(C_umin) == (nu*Hp,) || throw(ArgumentError("C_umin size must be $((nu*Hp,))"))
451+
size(C_umin) == (nu*Hp,) || throw(DimensionMismatch("C_umin size must be $((nu*Hp,))"))
452452
any(<(0), C_umin) && error("C_umin weights should be non-negative")
453453
con.A_Umin[:, end] .= -C_umin
454454
end
455455
if !isnothing(C_umax)
456-
size(C_umax) == (nu*Hp,) || throw(ArgumentError("C_umax size must be $((nu*Hp,))"))
456+
size(C_umax) == (nu*Hp,) || throw(DimensionMismatch("C_umax size must be $((nu*Hp,))"))
457457
any(<(0), C_umax) && error("C_umax weights should be non-negative")
458458
con.A_Umax[:, end] .= -C_umax
459459
end
460460
if !isnothing(C_Δumin)
461-
size(C_Δumin) == (nu*Hc,) || throw(ArgumentError("C_Δumin size must be $((nu*Hc,))"))
461+
size(C_Δumin) == (nu*Hc,) || throw(DimensionMismatch("C_Δumin size must be $((nu*Hc,))"))
462462
any(<(0), C_Δumin) && error("C_Δumin weights should be non-negative")
463463
con.A_ΔŨmin[1:end-1, end] .= -C_Δumin
464464
end
465465
if !isnothing(C_Δumax)
466-
size(C_Δumax) == (nu*Hc,) || throw(ArgumentError("C_Δumax size must be $((nu*Hc,))"))
466+
size(C_Δumax) == (nu*Hc,) || throw(DimensionMismatch("C_Δumax size must be $((nu*Hc,))"))
467467
any(<(0), C_Δumax) && error("C_Δumax weights should be non-negative")
468468
con.A_ΔŨmax[1:end-1, end] .= -C_Δumax
469469
end
470470
if !isnothing(C_ymin)
471-
size(C_ymin) == (ny*Hp,) || throw(ArgumentError("C_ymin size must be $((ny*Hp,))"))
471+
size(C_ymin) == (ny*Hp,) || throw(DimensionMismatch("C_ymin size must be $((ny*Hp,))"))
472472
any(<(0), C_ymin) && error("C_ymin weights should be non-negative")
473473
con.C_ymin .= C_ymin
474474
size(con.A_Ymin, 1) 0 && (con.A_Ymin[:, end] .= -con.C_ymin) # for LinModel
475475
end
476476
if !isnothing(C_ymax)
477-
size(C_ymax) == (ny*Hp,) || throw(ArgumentError("C_ymax size must be $((ny*Hp,))"))
477+
size(C_ymax) == (ny*Hp,) || throw(DimensionMismatch("C_ymax size must be $((ny*Hp,))"))
478478
any(<(0), C_ymax) && error("C_ymax weights should be non-negative")
479479
con.C_ymax .= C_ymax
480480
size(con.A_Ymax, 1) 0 && (con.A_Ymax[:, end] .= -con.C_ymax) # for LinModel
481481
end
482482
if !isnothing(C_wmin)
483-
size(C_wmin) == (nw*(Hp+1),) || throw(ArgumentError("C_wmin size must be $((nw*(Hp+1),))"))
483+
size(C_wmin) == (nw*(Hp+1),) || throw(DimensionMismatch("C_wmin size must be $((nw*(Hp+1),))"))
484484
any(<(0), C_wmin) && error("C_wmin weights should be non-negative")
485485
con.C_wmin .= C_wmin
486486
con.A_Wmin[:, end] .= -C_wmin
487487
end
488488
if !isnothing(C_wmax)
489-
size(C_wmax) == (nw*(Hp+1),) || throw(ArgumentError("C_wmax size must be $((nw*(Hp+1),))"))
489+
size(C_wmax) == (nw*(Hp+1),) || throw(DimensionMismatch("C_wmax size must be $((nw*(Hp+1),))"))
490490
any(<(0), C_wmax) && error("C_wmax weights should be non-negative")
491491
con.C_wmax .= C_wmax
492492
con.A_Wmax[:, end] .= -C_wmax
493493
end
494494
if !isnothing(c_x̂min)
495-
size(c_x̂min) == (nx̂,) || throw(ArgumentError("c_x̂min size must be $((nx̂,))"))
495+
size(c_x̂min) == (nx̂,) || throw(DimensionMismatch("c_x̂min size must be $((nx̂,))"))
496496
any(<(0), c_x̂min) && error("c_x̂min weights should be non-negative")
497497
con.c_x̂min .= c_x̂min
498498
size(con.A_x̂min, 1) 0 && (con.A_x̂min[:, end] .= -con.c_x̂min) # for LinModel
499499
end
500500
if !isnothing(c_x̂max)
501-
size(c_x̂max) == (nx̂,) || throw(ArgumentError("c_x̂max size must be $((nx̂,))"))
501+
size(c_x̂max) == (nx̂,) || throw(DimensionMismatch("c_x̂max size must be $((nx̂,))"))
502502
any(<(0), c_x̂max) && error("c_x̂max weights should be non-negative")
503503
con.c_x̂max .= c_x̂max
504504
size(con.A_x̂max, 1) 0 && (con.A_x̂max[:, end] .= -con.c_x̂max) # for LinModel

src/estimator/mhe/construct.jl

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -621,61 +621,61 @@ function setconstraint!(
621621
notSolvedYet = (JuMP.termination_status(optim) == JuMP.OPTIMIZE_NOT_CALLED)
622622
C = estim.C
623623
if isnothing(X̂min) && !isnothing(x̂min)
624-
size(x̂min) == (nx̂,) || throw(ArgumentError("x̂min size must be $((nx̂,))"))
624+
size(x̂min) == (nx̂,) || throw(DimensionMismatch("x̂min size must be $((nx̂,))"))
625625
con.x̃0min[end-nx̂+1:end] .= x̂min .- estim.x̂op # if C is finite : x̃ = [ε; x̂]
626626
for i in 1:nx̂*He
627627
con.X̂0min[i] = x̂min[(i-1) % nx̂ + 1] - estim.X̂op[i]
628628
end
629629
elseif !isnothing(X̂min)
630-
size(X̂min) == (nX̂con,) || throw(ArgumentError("X̂min size must be $((nX̂con,))"))
630+
size(X̂min) == (nX̂con,) || throw(DimensionMismatch("X̂min size must be $((nX̂con,))"))
631631
con.x̃0min[end-nx̂+1:end] .= X̂min[1:nx̂] .- estim.x̂op
632632
con.X̂0min .= @views X̂min[nx̂+1:end] .- estim.X̂op
633633
end
634634
if isnothing(X̂max) && !isnothing(x̂max)
635-
size(x̂max) == (nx̂,) || throw(ArgumentError("x̂max size must be $((nx̂,))"))
635+
size(x̂max) == (nx̂,) || throw(DimensionMismatch("x̂max size must be $((nx̂,))"))
636636
con.x̃0max[end-nx̂+1:end] .= x̂max .- estim.x̂op # if C is finite : x̃ = [ε; x̂]
637637
for i in 1:nx̂*He
638638
con.X̂0max[i] = x̂max[(i-1) % nx̂ + 1] - estim.X̂op[i]
639639
end
640640
elseif !isnothing(X̂max)
641-
size(X̂max) == (nX̂con,) || throw(ArgumentError("X̂max size must be $((nX̂con,))"))
641+
size(X̂max) == (nX̂con,) || throw(DimensionMismatch("X̂max size must be $((nX̂con,))"))
642642
con.x̃0max[end-nx̂+1:end] .= X̂max[1:nx̂] .- estim.x̂op
643643
con.X̂0max .= @views X̂max[nx̂+1:end] .- estim.X̂op
644644
end
645645
if isnothing(Ŵmin) && !isnothing(ŵmin)
646-
size(ŵmin) == (nŵ,) || throw(ArgumentError("ŵmin size must be $((nŵ,))"))
646+
size(ŵmin) == (nŵ,) || throw(DimensionMismatch("ŵmin size must be $((nŵ,))"))
647647
for i in 1:nŵ*He
648648
con.Ŵmin[i] = ŵmin[(i-1) % nŵ + 1]
649649
end
650650
elseif !isnothing(Ŵmin)
651-
size(Ŵmin) == (nŵ*He,) || throw(ArgumentError("Ŵmin size must be $((nŵ*He,))"))
651+
size(Ŵmin) == (nŵ*He,) || throw(DimensionMismatch("Ŵmin size must be $((nŵ*He,))"))
652652
con.Ŵmin .= Ŵmin
653653
end
654654
if isnothing(Ŵmax) && !isnothing(ŵmax)
655-
size(ŵmax) == (nŵ,) || throw(ArgumentError("ŵmax size must be $((nŵ,))"))
655+
size(ŵmax) == (nŵ,) || throw(DimensionMismatch("ŵmax size must be $((nŵ,))"))
656656
for i in 1:nŵ*He
657657
con.Ŵmax[i] = ŵmax[(i-1) % nŵ + 1]
658658
end
659659
elseif !isnothing(Ŵmax)
660-
size(Ŵmax) == (nŵ*He,) || throw(ArgumentError("Ŵmax size must be $((nŵ*He,))"))
660+
size(Ŵmax) == (nŵ*He,) || throw(DimensionMismatch("Ŵmax size must be $((nŵ*He,))"))
661661
con.Ŵmax .= Ŵmax
662662
end
663663
if isnothing(V̂min) && !isnothing(v̂min)
664-
size(v̂min) == (nym,) || throw(ArgumentError("v̂min size must be $((nym,))"))
664+
size(v̂min) == (nym,) || throw(DimensionMismatch("v̂min size must be $((nym,))"))
665665
for i in 1:nym*He
666666
con.V̂min[i] = v̂min[(i-1) % nym + 1]
667667
end
668668
elseif !isnothing(V̂min)
669-
size(V̂min) == (nym*He,) || throw(ArgumentError("V̂min size must be $((nym*He,))"))
669+
size(V̂min) == (nym*He,) || throw(DimensionMismatch("V̂min size must be $((nym*He,))"))
670670
con.V̂min .= V̂min
671671
end
672672
if isnothing(V̂max) && !isnothing(v̂max)
673-
size(v̂max) == (nym,) || throw(ArgumentError("v̂max size must be $((nym,))"))
673+
size(v̂max) == (nym,) || throw(DimensionMismatch("v̂max size must be $((nym,))"))
674674
for i in 1:nym*He
675675
con.V̂max[i] = v̂max[(i-1) % nym + 1]
676676
end
677677
elseif !isnothing(V̂max)
678-
size(V̂max) == (nym*He,) || throw(ArgumentError("V̂max size must be $((nym*He,))"))
678+
size(V̂max) == (nym*He,) || throw(DimensionMismatch("V̂max size must be $((nym*He,))"))
679679
con.V̂max .= V̂max
680680
end
681681
allECRs = (
@@ -694,39 +694,39 @@ function setconstraint!(
694694
isnothing(C_v̂min) && !isnothing(c_v̂min) && (C_v̂min = repeat(c_v̂min, He))
695695
isnothing(C_v̂max) && !isnothing(c_v̂max) && (C_v̂max = repeat(c_v̂max, He))
696696
if !isnothing(C_x̂min)
697-
size(C_x̂min) == (nX̂con,) || throw(ArgumentError("C_x̂min size must be $((nX̂con,))"))
697+
size(C_x̂min) == (nX̂con,) || throw(DimensionMismatch("C_x̂min size must be $((nX̂con,))"))
698698
any(C_x̂min .< 0) && error("C_x̂min weights should be non-negative")
699699
# if C is finite : x̃ = [ε; x̂]
700700
con.A_x̃min[end-nx̂+1:end, end] .= @views -C_x̂min[1:nx̂]
701701
con.C_x̂min .= @views C_x̂min[nx̂+1:end]
702702
size(con.A_X̂min, 1) 0 && (con.A_X̂min[:, end] = -con.C_x̂min) # for LinModel
703703
end
704704
if !isnothing(C_x̂max)
705-
size(C_x̂max) == (nX̂con,) || throw(ArgumentError("C_x̂max size must be $((nX̂con,))"))
705+
size(C_x̂max) == (nX̂con,) || throw(DimensionMismatch("C_x̂max size must be $((nX̂con,))"))
706706
any(C_x̂max .< 0) && error("C_x̂max weights should be non-negative")
707707
# if C is finite : x̃ = [ε; x̂] :
708708
con.A_x̃max[end-nx̂+1:end, end] .= @views -C_x̂max[1:nx̂]
709709
con.C_x̂max .= @views C_x̂max[nx̂+1:end]
710710
size(con.A_X̂max, 1) 0 && (con.A_X̂max[:, end] = -con.C_x̂max) # for LinModel
711711
end
712712
if !isnothing(C_ŵmin)
713-
size(C_ŵmin) == (nŵ*He,) || throw(ArgumentError("C_ŵmin size must be $((nŵ*He,))"))
713+
size(C_ŵmin) == (nŵ*He,) || throw(DimensionMismatch("C_ŵmin size must be $((nŵ*He,))"))
714714
any(C_ŵmin .< 0) && error("C_ŵmin weights should be non-negative")
715715
con.A_Ŵmin[:, end] .= -C_ŵmin
716716
end
717717
if !isnothing(C_ŵmax)
718-
size(C_ŵmax) == (nŵ*He,) || throw(ArgumentError("C_ŵmax size must be $((nŵ*He,))"))
718+
size(C_ŵmax) == (nŵ*He,) || throw(DimensionMismatch("C_ŵmax size must be $((nŵ*He,))"))
719719
any(C_ŵmax .< 0) && error("C_ŵmax weights should be non-negative")
720720
con.A_Ŵmax[:, end] .= -C_ŵmax
721721
end
722722
if !isnothing(C_v̂min)
723-
size(C_v̂min) == (nym*He,) || throw(ArgumentError("C_v̂min size must be $((nym*He,))"))
723+
size(C_v̂min) == (nym*He,) || throw(DimensionMismatch("C_v̂min size must be $((nym*He,))"))
724724
any(C_v̂min .< 0) && error("C_v̂min weights should be non-negative")
725725
con.C_v̂min .= C_v̂min
726726
size(con.A_V̂min, 1) 0 && (con.A_V̂min[:, end] = -con.C_v̂min) # for LinModel
727727
end
728728
if !isnothing(C_v̂max)
729-
size(C_v̂max) == (nym*He,) || throw(ArgumentError("C_v̂max size must be $((nym*He,))"))
729+
size(C_v̂max) == (nym*He,) || throw(DimensionMismatch("C_v̂max size must be $((nym*He,))"))
730730
any(C_v̂max .< 0) && error("C_v̂max weights should be non-negative")
731731
con.C_v̂max .= C_v̂max
732732
size(con.A_V̂max, 1) 0 && (con.A_V̂max[:, end] = -con.C_v̂max) # for LinModel

test/2_test_state_estim.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,18 +1231,18 @@ end
12311231
@test mhe3.con.C_v̂min 0.03(11:18)
12321232
@test mhe3.con.C_v̂max 0.04(11:18)
12331233

1234-
@test_throws ArgumentError setconstraint!(mhe2, x̂min=[-1])
1235-
@test_throws ArgumentError setconstraint!(mhe2, x̂max=[+1])
1236-
@test_throws ArgumentError setconstraint!(mhe2, ŵmin=[-1])
1237-
@test_throws ArgumentError setconstraint!(mhe2, ŵmax=[+1])
1238-
@test_throws ArgumentError setconstraint!(mhe2, v̂min=[-1])
1239-
@test_throws ArgumentError setconstraint!(mhe2, v̂max=[+1])
1240-
@test_throws ArgumentError setconstraint!(mhe2, c_x̂min=[-1])
1241-
@test_throws ArgumentError setconstraint!(mhe2, c_x̂max=[+1])
1242-
@test_throws ArgumentError setconstraint!(mhe2, c_ŵmin=[-1])
1243-
@test_throws ArgumentError setconstraint!(mhe2, c_ŵmax=[+1])
1244-
@test_throws ArgumentError setconstraint!(mhe2, c_v̂min=[-1])
1245-
@test_throws ArgumentError setconstraint!(mhe2, c_v̂max=[+1])
1234+
@test_throws DimensionMismatch setconstraint!(mhe2, x̂min=[-1])
1235+
@test_throws DimensionMismatch setconstraint!(mhe2, x̂max=[+1])
1236+
@test_throws DimensionMismatch setconstraint!(mhe2, ŵmin=[-1])
1237+
@test_throws DimensionMismatch setconstraint!(mhe2, ŵmax=[+1])
1238+
@test_throws DimensionMismatch setconstraint!(mhe2, v̂min=[-1])
1239+
@test_throws DimensionMismatch setconstraint!(mhe2, v̂max=[+1])
1240+
@test_throws DimensionMismatch setconstraint!(mhe2, c_x̂min=[+2])
1241+
@test_throws DimensionMismatch setconstraint!(mhe2, c_x̂max=[+1])
1242+
@test_throws DimensionMismatch setconstraint!(mhe2, c_ŵmin=[+2])
1243+
@test_throws DimensionMismatch setconstraint!(mhe2, c_ŵmax=[+1])
1244+
@test_throws DimensionMismatch setconstraint!(mhe2, c_v̂min=[+2])
1245+
@test_throws DimensionMismatch setconstraint!(mhe2, c_v̂max=[+1])
12461246

12471247
preparestate!(mhe1, [50, 30])
12481248
updatestate!(mhe1, [10, 50], [50, 30])

0 commit comments

Comments
 (0)