@@ -108,8 +108,7 @@ function getinfo(estim::MovingHorizonEstimator{NT}) where NT<:Real
108
108
nu, ny, nd = model. nu, model. ny, model. nd
109
109
nx̂, nym, nŵ, nϵ = estim. nx̂, estim. nym, estim. nx̂, estim. nϵ
110
110
nx̃ = nϵ + nx̂
111
- MyTypes = Union{JuMP. _SolutionSummary, Hermitian{NT, Matrix{NT}}, Vector{NT}, NT}
112
- info = Dict {Symbol, MyTypes} ()
111
+ info = Dict {Symbol, Any} ()
113
112
V̂, X̂0 = similar (estim. Y0m[1 : nym* Nk]), similar (estim. X̂0[1 : nx̂* Nk])
114
113
û0, ŷ0 = similar (model. uop), similar (model. yop)
115
114
V̂, X̂0 = predict! (V̂, X̂0, û0, ŷ0, estim, model, estim. Z̃)
@@ -370,7 +369,8 @@ If supported by `estim.optim`, it warm-starts the solver at:
370
369
where ``\m athbf{ŵ}_{k-1}(k-j)`` is the input increment for time ``k-j`` computed at the
371
370
last time step ``k-1``. It then calls `JuMP.optimize!(estim.optim)` and extract the
372
371
solution. A failed optimization prints an `@error` log in the REPL and returns the
373
- warm-start value.
372
+ warm-start value. A failed optimization also prints [`getinfo`](@ref) results in
373
+ the debug log [if activated](https://docs.julialang.org/en/v1/stdlib/Logging/#Example:-Enable-debug-level-messages).
374
374
"""
375
375
function optim_objective! (estim:: MovingHorizonEstimator{NT} ) where NT<: Real
376
376
model, optim = estim. model, estim. optim
@@ -406,13 +406,22 @@ function optim_objective!(estim::MovingHorizonEstimator{NT}) where NT<:Real
406
406
if ! issolved (optim)
407
407
status = JuMP. termination_status (optim)
408
408
if iserror (optim)
409
- @error (" MHE terminated without solution: estimation in open-loop" ,
410
- status)
409
+ @error (
410
+ " MHE terminated without solution: estimation in open-loop " *
411
+ " (more info in debug log)" ,
412
+ status
413
+ )
411
414
else
412
- @warn (" MHE termination status not OPTIMAL or LOCALLY_SOLVED: keeping " *
413
- " solution anyway" , status)
415
+ @warn (
416
+ " MHE termination status not OPTIMAL or LOCALLY_SOLVED: keeping solution " *
417
+ " anyway (more info in debug log)" ,
418
+ status
419
+ )
414
420
end
415
- @debug JuMP. solution_summary (optim, verbose= true )
421
+ @debug (
422
+ " calling getinfo (use logger with show_limited=false if values are truncated)" ,
423
+ getinfo (estim)
424
+ )
416
425
end
417
426
if iserror (optim)
418
427
estim. Z̃ .= Z̃_0
0 commit comments