Skip to content

Commit bbc38fe

Browse files
committed
debug: use dummy b vector in MHE setmodel!
The vector may containt ±Inf value for the MHE and it is not supported by JuMP. The values are updated before optimization anyway.
1 parent b608582 commit bbc38fe

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/estimator/mhe/construct.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ struct MovingHorizonEstimator{
159159
buffer = StateEstimatorBuffer{NT}(nu, nx̂, nym, ny, nd, nk)
160160
P̂_0 = Hermitian(P̂_0, :L)
161161
Q̂, R̂ = Hermitian(Q̂, :L), Hermitian(R̂, :L)
162-
163162
invP̄ = Hermitian(buffer.P̂, :L)
164163
invP̄ .= P̂_0
165164
inv!(invP̄)
@@ -690,7 +689,7 @@ function setconstraint!(
690689
con.A_Ŵmin, con.A_Ŵmax, con.A_V̂min, con.A_V̂max
691690
)
692691
A = con.A[con.i_b, :]
693-
b = con.b[con.i_b]
692+
b = zeros(count(con.i_b)) # dummy value, updated before optimization (avoid ±Inf)
694693
Z̃var = optim[:Z̃var]
695694
JuMP.delete(optim, optim[:linconstraint])
696695
JuMP.unregister(optim, :linconstraint)

src/estimator/mhe/execute.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ function setmodel_estimator!(
761761
con.A_V̂max
762762
]
763763
A = con.A[con.i_b, :]
764-
b = con.b[con.i_b]
764+
b = zeros(count(con.i_b)) # dummy value, updated before optimization (avoid ±Inf)
765765
Z̃var::Vector{JuMP.VariableRef} = estim.optim[:Z̃var]
766766
JuMP.delete(estim.optim, estim.optim[:linconstraint])
767767
JuMP.unregister(estim.optim, :linconstraint)

0 commit comments

Comments
 (0)