function default = mpc_defaults
%MPC_DEFAULTS Default values for MPC Object fields

%   Author: A. Bemporad
%   Copyright 1986-2023 The MathWorks, Inc.

%% Active defaults
default.weight.manipulatedvariables=0;
default.weight.manipulatedvariablesrate=0.1;
default.weight.outputvariables=1;
default.weight.ecr=1e5;     % The default weight for ECR is 1e5*max(u/du/y-weight)

default.u.target='nominal'; % Inherited from Model.Nominal

default.u.min=-Inf;
default.u.ratemin=-Inf; 
default.y.min=-Inf;

default.u.max=Inf;
default.u.ratemax=Inf;
default.y.max=Inf;

default.u.minecr=0;
default.u.maxecr=0;
default.u.rateminecr=0;
default.u.ratemaxecr=0;
default.y.minecr=1;
default.y.maxecr=1;

default.u.units='';
default.y.units='';
default.d.units='';

default.p=10;               
default.m=2;

default.MVcovmat=1;
default.UMDcovmat=1;
default.MNcovmat=1;

default.optimizer.minoutputecr=0;
default.optimizer.usesuboptimalsolution=false;
default.optimizer.customsolver=false;
default.optimizer.customsolvercodegen=false;
default.optimizer.customcostfcn=false;
default.optimizer.customconstraintfcn=false;

default.optimizer.type = 'QP';
default.optimizer.qpalgorithm = 'active-set';
default.optimizer.miqpalgorithm = 'branch-and-bound';
default.optimizer.qpoptions = mpc.solver.options.qp.ActiveSet;
default.optimizer.miqpoptions = mpc.solver.options.miqp.BranchBound;

default.verbosity='on';

default.u.scalefactor = 1;
default.y.scalefactor = 1;
default.d.scalefactor = 1;

default.u.type = 'continuous';

%% Obsolete defaults (only for backward compatibility)
default.deltaumin=-10;      % Default lower bound for unbounded input rates when using QP
default.bigdeltaumin=-1e5;  % Maximum allowed lower bound for unbounded input rates when using QP
default.y.integrator=[]; 