Skip to content

Commit ee15899

Browse files
committed
Merge branch 'main' into Ipopt_VectorNonlinearOracle
2 parents 69aa822 + 2ff9476 commit ee15899

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/controller/construct.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ at [`relaxŶ`](@ref), [`relaxΔU`](@ref) and [`relaxU`](@ref) documentation, re
591591
vector ``\mathbf{q̃}`` and scalar ``r`` need recalculation each control period ``k``, see
592592
[`initpred!`](@ref). ``r`` does not impact the minima position. It is thus useless at
593593
optimization but required to evaluate the minimal ``J`` value. A `@warn` will be displayed
594-
if the condition number `cond(H̃) warn_cond` and `transcription` is a `SingleShooting`
594+
if the condition number `cond(H̃) > warn_cond` and `transcription` is a `SingleShooting`
595595
(`warn_cond=Inf` for no warning).
596596
"""
597597
function init_quadprog(

src/controller/nonlinmpc.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ struct NonLinMPC{
103103
Eŝ, Fŝ, Gŝ, Jŝ, Kŝ, Vŝ, Bŝ,
104104
gc!, nc
105105
)
106-
= init_quadprog(model, transcription, weights, Ẽ, P̃Δu, P̃u)
106+
warn_cond = iszero(weights.E) ? 1e6 : Inf # condition number warning only if Ewt==0
107+
= init_quadprog(model, transcription, weights, Ẽ, P̃Δu, P̃u; warn_cond)
107108
# dummy vals (updated just before optimization):
108109
q̃, r = zeros(NT, size(H̃, 1)), zeros(NT, 1)
109110
Ks, Ps = init_stochpred(estim, Hp)

0 commit comments

Comments
 (0)