非线性模型预测控制MPC问题求解研究(Matlab代码实现)

 💥💥💞💞欢迎来到本博客❤️❤️💥💥

🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。

⛳️座右铭:行百里者,半于九十。

📋📋📋本文目录如下:🎁🎁🎁

目录

💥1 概述

📚2 运行结果

🎉3 参考文献

🌈4 Matlab代码实现


💥1 概述

非线性模型预测控制(Model Predictive Control, MPC)是一种常用的控制方法,可以应用于多种系统,包括非线性系统。MPC基于离散化的模型和未来时间段的优化问题,通过迭代地求解优化问题来生成控制策略。

针对非线性MPC问题的求解研究,可以涉及以下几个方面:

1. 模型表达:选择合适的非线性模型来描述系统动态,并通过合适的数学表达式来表示其非线性特性。

2. 离散化:将连续时间的非线性模型离散化为离散时间的模型,一般使用数值方法(如欧拉法或龙格-库塔法)来进行离散化。

3. 优化问题设计:将控制问题转化为一个优化问题,通过最小化指定的性能指标(例如系统状态的跟踪误差、控制输入的幅值等),得到最优的控制策略。

4. 求解技术:针对离散化的优化问题,可以采用各种数值优化方法进行求解,例如序列二次规划(Sequential Quadratic Programming, SQP)、内点法(Interior Point Method, IPM)等。

5. 稳定性分析:对于非线性MPC控制器,稳定性是一个重要的考虑因素。需要研究控制系统的稳定性条件,确保控制器能够产生稳定的闭环系统。

通过对以上几个方面的研究,可以实现对非线性模型预测控制问题的求解,并得到有效的控制策略。当然,具体的研究方法和算法选择还需要根据具体问题的特点和要求来确定。

📚2 运行结果

可视化:

% Plot the results

% Plant: Controlled by PI controller 
% Strip off last computed value of h
hhp=hp(timeref);

figure(2)
clf
subplot(211)
plot(time,hhp,'k-',time,ref,'b--')
grid
ylabel('Liquid height, h')
title('Liquid level h and reference input r (plant)')

subplot(212)
plot(time,up,'k-')
grid
title('Tank input, u')
xlabel('Time, k')
axis([min(time) max(time) -50 50])

% Model: Controlled by PI controller
% Strip off last computed value of hmm
hhm=hmm(timeref);

figure(3)
clf
subplot(211)
plot(time,hhm,'k-',time,ref,'k--')
grid
ylabel('Liquid height, h_m')
title('Liquid level h_m and reference input r (model)')

subplot(212)
plot(time,umm,'k-')
grid
title('Tank input, u_m')
xlabel('Time, k')
axis([min(time) max(time) -50 50])

% Difference between plant and model: Controlled by PI controller
% Strip off last computed value of hmm

figure(4)
clf
subplot(211)
plot(time,hhp-hhm,'k-')
grid
title('Liquid height error')

subplot(212)
plot(time,up-umm,'k-')
grid
title('Tank input error')
xlabel('Time, k')


%-----------------------------------------------------------
% Planning system results
% Strip off last computed value of h
hh=h(timeref);

figure(5)
clf
subplot(211)
plot(time,hh,'k-',time,ref,'k--')
grid
ylabel('Liquid height, h')
title('Liquid level h and reference input r')

subplot(212)
plot(time,u,'k-')
grid
title('Tank input, u')
xlabel('Time, k')
axis([min(time) max(time) -50 50])

figure(6)
clf
plot(time,rowindex,'k-',time,colindex,'k--')
axis([min(time) max(time) 0 max(length(Kpvec),length(Kivec))])
grid
title('Indices of plan (row=solid, column=dashed)')
ylabel('Row and column indices')
xlabel('Time, k')

% Next, study the effect of the projection length N
figure(7)
clf
plot(NN,trackerrorenergy,'b-',NN,trackerrorenergy,'ro')
title('Tracking energy vs. projection length N')
xlabel('Projection length N')

figure(8)
clf
plot(NN,inputenergy,'b-',NN,inputenergy,'ro')
title('Control energy vs. projection length N')
xlabel('Projection length N')

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% End of program
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Plot the results

% Plant: Controlled by PI controller 
% Strip off last computed value of h
hhp=hp(timeref);

figure(2)
clf
subplot(211)
plot(time,hhp,'k-',time,ref,'b--')
grid
ylabel('Liquid height, h')
title('Liquid level h and reference input r (plant)')

subplot(212)
plot(time,up,'k-')
grid
title('Tank input, u')
xlabel('Time, k')
axis([min(time) max(time) -50 50])

% Model: Controlled by PI controller
% Strip off last computed value of hmm
hhm=hmm(timeref);

figure(3)
clf
subplot(211)
plot(time,hhm,'k-',time,ref,'k--')
grid
ylabel('Liquid height, h_m')
title('Liquid level h_m and reference input r (model)')

subplot(212)
plot(time,umm,'k-')
grid
title('Tank input, u_m')
xlabel('Time, k')
axis([min(time) max(time) -50 50])

% Difference between plant and model: Controlled by PI controller
% Strip off last computed value of hmm

figure(4)
clf
subplot(211)
plot(time,hhp-hhm,'k-')
grid
title('Liquid height error')

subplot(212)
plot(time,up-umm,'k-')
grid
title('Tank input error')
xlabel('Time, k')


%-----------------------------------------------------------
% Planning system results
% Strip off last computed value of h
hh=h(timeref);

figure(5)
clf
subplot(211)
plot(time,hh,'k-',time,ref,'k--')
grid
ylabel('Liquid height, h')
title('Liquid level h and reference input r')

subplot(212)
plot(time,u,'k-')
grid
title('Tank input, u')
xlabel('Time, k')
axis([min(time) max(time) -50 50])

figure(6)
clf
plot(time,rowindex,'k-',time,colindex,'k--')
axis([min(time) max(time) 0 max(length(Kpvec),length(Kivec))])
grid
title('Indices of plan (row=solid, column=dashed)')
ylabel('Row and column indices')
xlabel('Time, k')

% Next, study the effect of the projection length N
figure(7)
clf
plot(NN,trackerrorenergy,'b-',NN,trackerrorenergy,'ro')
title('Tracking energy vs. projection length N')
xlabel('Projection length N')

figure(8)
clf
plot(NN,inputenergy,'b-',NN,inputenergy,'ro')
title('Control energy vs. projection length N')
xlabel('Projection length N')

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% End of program
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

🎉3 参考文献

文章中一些内容引自网络,会注明出处或引用为参考文献,难免有未尽之处,如有不妥,请随时联系删除。

[1]修观.非线性模型预测控制方法在滑翔弹道控制中的应用研究[D].南京理工大学,2011.DOI:10.7666/d.y1919740.

[2]陈垣君.基于LPV模型非线性预测控制的精细化建模及精确求解[D].浙江大学,2015.

[3]谢树光.非线性模型预测控制(NMPC)在微型飞行器自适应控制中的应用[J].  2002.

🌈4 Matlab代码实现

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
非线性模型预测控制(NMPC)是一种目前广泛应用于工业控制领域的方法,它可以用于处理涉及非线性动态模型的控制问题。而MATLAB是一种功能强大的数值计算软件,具有丰富的工具箱和函数,使得实现非线性模型预测控制成为可能。 在MATLAB中,我们可以使用预测模型来构建非线性模型的预测控制器。首先,我们需要使用系统的动态方程构建非线性模型,并且可以使用MATLAB的符号计算工具箱来简化生成过程。然后,我们可以使用非线性预测模型来预测系统的未来行为。 接下来,我们可以使用非线性模型预测控制器来确定控制量的最优值,以实现对系统的高性能控制。传统的非线性模型预测控制方法使用非线性优化算法来解决控制器的最优化问题,但这种方法在计算复杂度和实时性方面存在一定的困难。 幸运的是,MATLAB提供了一种使用模型预测控制的函数:"mpc"函数。该函数可以自动解决最优化问题,并生成设计好的非线性模型预测控制器。除此之外,MATLAB还提供了其他强大的工具箱,如优化工具箱和控制系统工具箱,用于帮助我们在非线性模型预测控制中处理不同的问题。 总结起来,MATLAB是一个非常适合实现非线性模型预测控制的工具。它提供了丰富的函数和工具箱,帮助我们构建和求解非线性模型,生成设计好的预测控制器,并且能够处理不同类型的问题。通过使用MATLAB,我们可以更轻松地进行非线性模型预测控制的设计和实现

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

荔枝科研社

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值