自适应巡航控制示例,matlab代码,可运行 - matlab算法设计 - 谷速源码
下载频道> 资源分类> matlab源码> 算法设计> 自适应巡航控制示例,matlab代码,可运行

标题:自适应巡航控制示例,matlab代码,可运行
分享到:

所属分类: 算法设计 资源类型:程序源码 文件大小: 71.03 KB 上传时间: 2019-07-16 23:16:03 下载次数: 4 资源积分:1分 提 供 者: jiqiren 20190716111620968
内容:
function mpcACCplot(logsout)
%% Get the data from simulation
acc_host = logsout.getElement('acc_host'); % acceleration of host car
vel_host = logsout.getElement('vel_host'); % velocity of host car
acc_lead = logsout.getElement('acc_lead'); % acceleration of lead car
vel_lead = logsout.getElement('vel_lead'); % velocity of lead car
vel_set = logsout.getElement('vel_set'); % driver-set velocity
space_error = logsout.getElement('space_error'); % spacing error
act_dist = logsout.getElement('act_dist'); % actual distance
des_dist = logsout.getElement('des_dist'); % desired distance
%% Plot the results
figure('position',[100 100 960 800]);
% acceleration
subplot(4,1,1);
plot(acc_host.Values.time,acc_host.Values.Data,'r');grid on;
hold on; 
plot(acc_lead.Values.time,acc_lead.Values.Data,'b');
ylim([-3.2,2.2]);
legend('host','lead','location','SouthEast');
title('Acceleration')
xlabel('time (sec)')
ylabel('$m/s^2$','Interpreter','latex')
% velocity
subplot(4,1,2);
plot(vel_host.Values.time,vel_host.Values.Data,'r');grid on;
hold on; 
plot(vel_lead.Values.time,vel_lead.Values.Data,'b');
hold on; 
plot(vel_set.Values.time,vel_set.Values.Data,'k--');
ylim([15,35]);
legend('host','lead','set','location','SouthEast');
title('Velocity')
xlabel('time (sec)')
ylabel('m/s')
% distance
subplot(4,1,3);
plot(act_dist.Values.time,act_dist.Values.Data,'r');grid on;
hold on;
plot(des_dist.Values.time,des_dist.Values.Data,'b');grid on;
legend('actual','safe','location','SouthEast');
title('Distance between two cars')
xlabel('time (sec)')
ylabel('m')
% spacing error
subplot(4,1,4);
plot(space_error.Values.time,space_error.Values.Data,'m');grid on;
ylim([-1,10]);
legend('space error')
title('Spacing error (actual - safe, greater than zero is desired)')
xlabel('time (sec)')
ylabel('m')

文件列表(点击上边下载按钮,如果是垃圾文件请在下面评价差评或者投诉):

AdaptiveCruiseControlExample.m
mpcACCplot.m
mpcACCsystem.png
mpcACCsystem.slx

关键词: 自适应巡航 控制示例 matlab代码

Top_arrow
回到顶部
联系方式| 版权声明| 招聘信息| 广告服务| 银行汇款| 法律顾问| 兼职技术| 付款方式| 关于我们|
网站客服网站客服 程序员兼职招聘 程序员兼职招聘
沪ICP备19040327号-3
公安备案号:沪公网安备 31011802003874号
库纳格流体控制系统(上海)有限公司 版权所有
Copyright © 1999-2014, GUSUCODE.COM, All Rights Reserved