✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab仿真内容点击👇
⛄ 内容介绍
1.1问题重述
森林火灾时常见诸报端。森林失火,消防站接到报警后派多少消防队员去救火?这是森林防火部门的一个问题。人数多则火灾损失小但救援费用可能大,例如器材消耗,消防员工资等都会增加,反之则火灾损失大而救援费用可能小.
当然在接到报警后消防部门派出队员越多,灭火速度越快,森林损失越小,但同时救援开支会越大,所以需要综合考虑森林损失费和救援费与消防队员人数之间的关系,以总费用最小来确定派出队员的数目。
1.2问题分析
如上所述,森林救火问题与派出的消防队员的人数密切相关,应综合考虑森林损失费和救援费,以总费用最小为目标来确定派出的消防队员的人数使总费用最小。由此看来是一个优化问题。
图1:森林救火问题分析
损失费通常正比于森林烧毁的面积,而烧毁面积与失火、灭火(指火被扑灭)的时间有关,灭火时间又取决于消防队员数目,队员越多灭火越快.救援费除与消防队员人数有关外,也与灭火时间长短有关。
救援费可分为两部分;一部分是灭火器材的消耗及消防队员的薪金等,与队员人数及灭火所用的时间均有关,另一部分是运送队员和器材等一次性支出,只与队员人数有关.
⛄ 部分代码
<span style="color:#333333"><span style="background-color:#fafafa"><code>function drawPath(path,G,flag)</code><code><span style="color:#dd1144">%%%</span>%</code><code>xGrid=size(G,<span style="color:#0e9ce5">2</span>);</code><code>drawShanGe(G,flag)</code><code>hold on</code><code>set(gca,<span style="color:#dd1144">'XtickLabel'</span>,<span style="color:#dd1144">''</span>)</code><code>set(gca,<span style="color:#dd1144">'YtickLabel'</span>,<span style="color:#dd1144">''</span>)</code><code>L=size(path,<span style="color:#0e9ce5">1</span>);</code><code>Sx=path(<span style="color:#0e9ce5">1</span>,<span style="color:#0e9ce5">1</span>)-<span style="color:#0e9ce5">0</span>.<span style="color:#0e9ce5">5</span>;</code><code>Sy=path(<span style="color:#0e9ce5">1</span>,<span style="color:#0e9ce5">2</span>)-<span style="color:#0e9ce5">0</span>.<span style="color:#0e9ce5">5</span>;</code><code>plot(Sx,Sy,<span style="color:#dd1144">'ro'</span>,<span style="color:#dd1144">'MarkerSize'</span>,<span style="color:#0e9ce5">5</span>,<span style="color:#dd1144">'LineWidth'</span>,<span style="color:#0e9ce5">5</span>); % 起点</code><code><span style="color:#ca7d37">for</span> i=<span style="color:#0e9ce5">1</span><span style="color:#dd1144">:L-</span><span style="color:#0e9ce5">1</span></code><code> plot([path(i,<span style="color:#0e9ce5">2</span>) path(i+<span style="color:#0e9ce5">1</span>,<span style="color:#0e9ce5">2</span>)]-<span style="color:#0e9ce5">0</span>.<span style="color:#0e9ce5">5</span>,[path(i,<span style="color:#0e9ce5">1</span>) path(i+<span style="color:#0e9ce5">1</span>,<span style="color:#0e9ce5">1</span>)]-<span style="color:#0e9ce5">0</span>.<span style="color:#0e9ce5">5</span>,<span style="color:#dd1144">'k-'</span>,<span style="color:#dd1144">'LineWidth'</span>,<span style="color:#0e9ce5">1.5</span>,<span style="color:#dd1144">'markersize'</span>,<span style="color:#0e9ce5">10</span>)</code><code> hold on</code><code><span style="color:#ca7d37">end</span></code><code></code><code>Ex=path(<span style="color:#ca7d37">end</span>,<span style="color:#0e9ce5">1</span>)-<span style="color:#0e9ce5">0</span>.<span style="color:#0e9ce5">5</span>;</code><code>Ey=path(<span style="color:#ca7d37">end</span>,<span style="color:#0e9ce5">2</span>)-<span style="color:#0e9ce5">0</span>.<span style="color:#0e9ce5">5</span>;</code><code></code><code>plot(Ex,Ey,<span style="color:#dd1144">'gs'</span>,<span style="color:#dd1144">'MarkerSize'</span>,<span style="color:#0e9ce5">5</span>,<span style="color:#dd1144">'LineWidth'</span>,<span style="color:#0e9ce5">5</span>); % 终点</code><code></code></span></span>
⛄ 运行结果
首先初始化模型的参数值,平均灭火速度设为,火灾蔓延速度设为,开始救火的时刻为3h。相关费用分别为烧毁单位面积损失费 ,每个消防员单位时间费用,每个队员一次性支出为2000
对比分析发现,派出38名消防队员相比20名,灭火的时刻提前了,森林烧毁的面积减少了,有效地遏制住火势的蔓延,使得输出结果中的损失费大大减少,由与派出队员的增加,救援费对应增加,但是得到的总费用无疑是最小的。