基于智能优化算法的交通流模拟器(Matlab代码实现)

  🍒🍒🍒欢迎关注🌈🌈🌈

📝个人主页:我爱Matlab


👍点赞➕评论➕收藏 == 养成习惯(一键三连)🌻🌻🌻

🍌希望大家多多支持🍓~一起加油 🤗

💬语录:将来的我一定会感谢现在奋斗的自己!

🍁🥬🕒摘要🕒🥬🍁

该存储库包含一些Matlab代码,在交通流文献中称为LWR模型。它使用Godunov数值格式,这是一种一阶有限体积格式。它可以容纳任何类型的通量函数,而不一定是经典的Daganzo细胞传输模型中的“三角基本图”。

✨🔎⚡运行结果⚡🔎✨

 

 

💂♨️👨‍🎓Matlab代码👨‍🎓♨️💂

clear allvariables
clc

% (1) Specify the geometry characteristics
geometry.length(1)=5; %in km
geometry.Demand(1)=@(rho) (90.*rho).*(rho<=30) + (2700).*(rho>30);
geometry.Supply(1)=@(rho) (2700).*(rho<=30) + (15.*(30-rho)+2700).*(rho>30);
geometry.Vmax(1)=90; %in km/hr

% --------------------- OPTIONNAL -----------------------
% Graphical representation of the demand/supply functions
figure
hold on
ezplot(geometry.Demand,[0 200])
ezplot(geometry.Supply,[0 200])
hold off
% -------------------------------------------------------

% (2) Enter the initial densities
rho_0=@(x) 20.*(x<=0.5) + 100.*(x>0.5) ; %in veh/km

% (3) Enter the upstream demand
Demand_upstream=@(t) 1200; %in veh/hr

% (4) Enter the downstream supply
Supply_downstream=@(t) 2000; %in veh/hr

% (5) Specify the discrete step in space and the time horizon
Delta_x = 0.2; %in km
T = 0.5;        %in hour

% Run the Godunov solver
[rho,Delta_t]=Godunov(geometry,rho_0,...
    Demand_upstream,Supply_downstream,...
    Delta_x,T) ;
 

📜📢🌈参考文献🌈📢📜

[1]陈立家,卢学,李世刚.基于实际交通流的航海模拟器智能目标船系统[J].大连海事大学学报,2020,46(04):8-16.DOI:10.16411/j.cnki.issn1006-7736.2020.04.002.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值