资源简介
非线性模型预测控制(NMPC)算法的matlab程序,求由目标函数及过程模型定义的NMPC问题的闭环最优控制。
代码片段和文件信息
function [t x u] = nmpc(runningcosts terminalcosts ...
constraints terminalconstraints ...
linearconstraints system ...
mpciterations N T tmeasure xmeasure u0 ...
varargin)
% nmpc(runningcosts terminalcosts constraints ...
% terminalconstraints linearconstraints system ...
% mpciterations N T tmeasure xmeasure u0 ...
% tol_opt opt_option ...
% type atol_ode_real rtol_ode_real atol_ode_sim rtol_ode_sim ...
% iprint printHeader printClosedloopData plotTrajectories)
% Computes the closed loop solution for the NMPC problem defined by
% the functions
% runningcosts: evaluates the running costs for state and control
% at one sampling instant.
% The function returns the running costs for one
% sampling instant.
% Usage: [cost] = runningcosts(t x u)
% with time t state x and control u
% terminalcosts: evaluates the terminal costs for state at the end
% of the open loop horizon.
% The function returns value of the terminal costs.
% Usage: cost = terminalcosts(t x)
% with time t and state x
% constraints: computes the value of the restrictions for a
% sampling instance provided the data t x and u
% given by the optimization method.
% The function returns the value of the
% restrictions for a sampling instance separated
% for inequality restrictions c and equality
% restrictions ceq.
% Usage: [cceq] = constraints(t x u)
% with time t state x and control u
% terminalconstraints: computes the value of the terminal restrictions
% provided the data t x and u given by the
% optimization method.
% The function returns the value of the
% terminal restriction for inequality restrictions
% c and equality restrictions ceq.
% Usage: [cceq] = terminalconstraints(t x)
% with time t and state x
% linearconstraints: sets the linear constraints of the discretized
% optimal control problem. This is particularly
% useful to set control and state bounds.
% The function returns the required matrices for
% the linear inequality and equality constraints A
% and Aeq the corresponding right hand sides b and
% beq as well as the lower and upper bound of the
% control.
% Usage: [A b Aeq beq lb ub] = linearconstraints
- 上一篇:信息熵·互信息代码
- 下一篇:matlab单纯形法程序
评论
共有 条评论