資源簡介
本資源是關于用MPC算法來搭建Carsim/Simulink模型進行仿真,其中包含重要的MPC算法的m文件,內有對相關重要代碼有具體的說明,適合初學者。
代碼片段和文件信息
function?[sysx0strts]?=?MyMPC_v1(txuflag)
%???該函數是寫的第3個S函數控制器(MATLAB版本:R2011a)
%???限定于車輛運動學模型,控制量為速度和前輪偏角,使用的QP為新版本的QP解法
%???[sysx0strts]?=?MY_MPCController3(txuflag)
%
%?is?an?S-function?implementing?the?MPC?controller?intended?for?use
%?with?Simulink.?The?argument?md?which?is?the?only?user?supplied
%?argument?contains?the?data?structures?needed?by?the?controller.?The
%?input?to?the?S-function?block?is?a?vector?signal?consisting?of?the
%?measured?outputs?and?the?reference?values?for?the?controlled
%?outputs.?The?output?of?the?S-function?block?is?a?vector?signal
%?consisting?of?the?control?variables?and?the?estimated?state?vector
%?potentially?including?estimated?disturbance?states.
switch?flag
?case?0
??[sysx0strts]?=?mdlInitializeSizes;?%?Initialization
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????47490??2020-05-02?15:17??LKA_MPC_v1.mdl
?????文件????????7762??2020-05-08?20:06??MyMPC_v1.m
評論
共有 條評論