@@ -108,8 +108,7 @@ function getinfo(estim::MovingHorizonEstimator{NT}) where NT<:Real
108108 nu, ny, nd = model. nu, model. ny, model. nd
109109 nx̂, nym, nŵ, nϵ = estim. nx̂, estim. nym, estim. nx̂, estim. nϵ
110110 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} ()
113112 V̂, X̂0 = similar (estim. Y0m[1 : nym* Nk]), similar (estim. X̂0[1 : nx̂* Nk])
114113 û0, ŷ0 = similar (model. uop), similar (model. yop)
115114 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:
370369where ``\m athbf{ŵ}_{k-1}(k-j)`` is the input increment for time ``k-j`` computed at the
371370last time step ``k-1``. It then calls `JuMP.optimize!(estim.optim)` and extract the
372371solution. 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).
374374"""
375375function optim_objective! (estim:: MovingHorizonEstimator{NT} ) where NT<: Real
376376 model, optim = estim. model, estim. optim
@@ -406,13 +406,22 @@ function optim_objective!(estim::MovingHorizonEstimator{NT}) where NT<:Real
406406 if ! issolved (optim)
407407 status = JuMP. termination_status (optim)
408408 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+ )
411414 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+ )
414420 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+ )
416425 end
417426 if iserror (optim)
418427 estim. Z̃ .= Z̃_0
0 commit comments