Skip to content

Commit 3f48b15

Browse files
committed
comments moved
1 parent 89b468e commit 3f48b15

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

example/juMPC.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ initstate!(ssKalmanFilter1,[0,0],[2,1])
6464
nx = linModel4.nx
6565
kf = KalmanFilter(linModel4, σP0=10*ones(nx), σQ=0.01*ones(nx), σR=[0.1, 0.1], σQ_int=0.05*ones(2), σP0_int=10*ones(2))
6666

67-
mpc = LinMPC(kf, Hp=15, Hc=1, Mwt=[1, 1] , Nwt=[0.1, 0.1], Cwt=1e6)
67+
mpc = LinMPC(kf, Hp=15, Hc=1, Mwt=[1, 1] , Nwt=[0.1, 0.1], Cwt=1e5)
6868

6969
setconstraint!(mpc, c_umin=[0,0], c_umax=[0,0])
7070
setconstraint!(mpc, c_ŷmin=[1,1], c_ŷmax=[1,1])

src/predictive_control.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,9 @@ function optim_objective!(mpc::LinMPC, b, q̃, p)
577577
J = objective_value(mpc.optim.model) + p # optimal objective value by adding constant p
578578
status = termination_status(mpc.optim.model)
579579
status OPTIMAL && @warn "MPC termination status not optimal ($status)"
580-
# if error, we take last value :
581580
if any(status .== [INFEASIBLE, DUAL_INFEASIBLE, SLOW_PROGRESS, INVALID_MODEL,
582581
INVALID_OPTION, INTERRUPTED, OTHER_ERROR])
582+
# if error, we take last value :
583583
ΔŨ = ΔŨ0
584584
end
585585
return ΔŨ, ϵ, J

0 commit comments

Comments
 (0)