复合肥料生产模型.docx
《复合肥料生产模型.docx》由会员分享,可在线阅读,更多相关《复合肥料生产模型.docx(23页珍藏版)》请在冰豆网上搜索。
复合肥料生产模型
复合肥料生产问题的模型
摘要
在生产和经营管理中,经常遇到要合理的安排生产与库存的问题,达到既要满足社会要求,又要尽量降低成本费用。
因此,正确制定采购和生产策略,确定不同时期的采购量、生产量和库存量,以使总的生产成本费用和库存费用之和最小,使获得利润最大。
本文是以给出的部分数据为基准,通过合理的假设和数学模型得到复合肥料生产模型。
问题一根据复合肥料配比要求,现假设氮肥和磷肥配比为1:
1,把生产过程看作一个6阶段决策问题,建立线性规划模型,根据决策变量,在给定的约束条件下求解使利润最大的最优化目标函数。
问题二若价格呈线性函数变化,则用线性动态规划求解,若价格变化不符合线性函数,则用非线性的动态规划求解。
问题的结果可由lingo软件结合excel和matlab软件通过画图来求得最优解,进而表示出其变化过程。
关键字:
最优解,决策变量,约束条件,目标函数,线性规划模型,lingo,matlab
问题二根据题目要求,建立线性规划模型。
首先建立目标函数,总利润等于出售总额减去生产成本,生产成本包括材料采购费用与基础费的存储费用。
其次,确定约束条件,每个阶段加工量不超过最大生产限,各个阶段基础费的最大允许存储量,复合肥料所含杂质的限定。
最后,在给定的约束条件下建立线性规划模型,并用lingo软件求解使利润最大的最优化解。
1.问题的提出
某复合肥料由几种基本肥料组合而成,基础肥料有5种,其中氮肥3种:
N1,N2,N3,磷肥2种P1,P2,各种基础肥料由其它化工厂购进,未来半年中各种基础肥料的价格如下:
月份\肥料
P1
P2
N1
N2
N3
一
1650
1800
1950
1650
1725
二
1950
1950
1650
1350
1725
三
1650
2100
1950
1500
1425
四
1800
1650
1800
1800
1875
五
1500
1800
2250
1650
1575
六
1350
1500
2100
1200
2025
对几种基础肥料加工,然后混合为复合肥。
复合肥售价为2250元/吨。
氮肥和磷肥在不同生产线加工,每个月最多可以加工磷肥200吨,氮肥250吨。
加工过程没有重量损失,费用不考虑。
每种基础肥料最多可以存储1000吨备用,存储费用为每吨每月75元。
成品复合肥和加工过的基础肥料不能存储。
对复合肥的杂质指标限制在3-6%个单位之间,假设杂质是线性混合的。
各种基础肥料的杂质含量见下表
基础肥料
P1
P2
N1
N2
N3
杂质(%)
8.8
6.1
2.0
4.2
5.0
为使公司获得最大利润,应采取什么样的采购和加工方案。
现存有5种基础肥料每种500吨,要求在6月底仍然有这样多存货。
问题:
价格在市场中变动,考虑到相关的市场的采购费用和存储费用,进行相关的分析,建立模型。
2.问题的分析
根据各原料在一定时期内单价的变动,存储费用是固定的,以各种原料的使用量为决策变量,每个月氮肥和磷肥的最多加工量,基础肥料的最多存储量和复合肥的杂质指标限制为约束条件,建立随机性动态规划模型。
建模的目的是寻求最优的生产计划,使获得利润最大,即生产的成本费用和存储费用之和最小
3.模型的假设
根据复合肥生产中的一些具体要求,并为达到简化问题的目的,我们给出以下假设:
(1)假设成品复合肥和加工过的基础肥料不能存储。
(2)假设杂质在基础肥料中是线性混合的。
(3)假设加工过程中,材料没有重量损失,费用不考虑。
(4)假设氮肥和磷肥的混合比为1:
1的复合肥料,以简化模型(实际舍产有一定的配比)
(5)不考虑其他随机因素的影响。
4.符号的说明
k:
第k月份。
k=1,2,3,4,5,6
j:
分别代表基础肥料P1,P2,N1,N2,N3,j=1,2,3,4,5
:
在第k月份基础肥料j的采购量
:
在第k月份基础肥料j的加工量
:
在第k月份基础肥料j的储存量
:
第k月份的利润
max:
6个月总的最大利润
a%:
基础肥料采购价格的增长率
5.模型的建立与求解
5.1模型的建立
我们的目标是获得利润最大,即使得在满足约束条件的前提下,使不同价格的原料得到充分利用并合理搭配达到成本最低,以使最后的总的售额与各单价与原料选取数量乘积之差最大。
复合肥料生产问题的数学模型为:
(1)确定问题的决策变量:
,
第k月份j原料的使用加工量和贮存量;
(2)问题的目标函数为:
(3)确定问题的约束条件
5.2模型的求解
用动态规划方法来求解,k阶段决策问题,分别求出各阶段的利润,使用Lingo软件的得出最优结果:
max=1650937
6.模型的评价与分析
6.1模型的检验
研究总利润和采购与加工方案适应不同的未来市场价格应如何变化。
考虑如下的价格变化方式:
2月份基础磷肥价格上升a%,基础氮肥价格上升2a%;3月份基础磷肥上升2a%,基础氮肥上升4a%;其余月份保持这种线性的上升势头。
对不同的值a(直到20),用上述模型进行分析有:
(1)取0≤a≤20且a为整数,用lingo软件得出结果为:
a的值
利润
0
2457181
1
2203785
2
2130402
3
22025289
4
2061300
5
2025289
6
1987789
7
1987789
8
1910309
9
1877371
10
1845450
11
1814564
12
1784662
13
1757572
14
1730413
15
1703000
16
1675344
17
1643761
18
1605575
19
1568963
20
1533615
(2)用Excel进行处理得到:
散点图:
柱形图
条形图:
用MATLAB拟和数据得到:
a=0:
20;
f=[2457181,2203785,2130402,2095742,2061300,2025289,1987789,1948855,1910309,1877371,1845450,1814564,1784662,1757572,1730413,1703000,1675344,1643761,1605575,1568963,1533615];
plot(a,f)
6.2模型的分析:
我们的模型完全建立在现有的数据基础上,由于时间紧迫,来不及去更多的试验数据来减少数据误差,并且对于现实情况中原料的价格变动考虑不全,因此降低了模型的实用性。
但我们的数据都是来源于现实,必然对事件有一定的指导意义。
6.3模型的缺点及改进:
针对实际生活中不同农作物对N,P的需求量可能会有偏差,使N,P的选取量在一定的变化范围内,从而使成本最低,得到最有效的复合肥,可以用线性规划的问题进行求解。
6.4模型的推广:
对于复合肥料生产问题研究是很有意义的。
在市场经济物质生产和研发产品的生产活动中,解决用不同材料进行配比制成新物质的生产问题,使其达到优化配置,获得最好的商业效益和最佳利润。
参考文献:
[1]韩中庚,数学建模方法及其应用,北京,高等教育出版社,2005
[2]《数学模型》编辑组,数学模型,广州,华南理工大学出版社,2003
[3《运筹学》教材编写组,运筹学(第三版),北京,清华大学出版社,2005
[4]数学建模原理与案例/冯杰等编著,北京,科学出版社,2007
[5]姜启源等,数学建模(第三版),北京,高等教育出版社,2003
附件:
(1)用Lingo软件求解最优解程序为
sets:
kinds/1..5/:
x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6;
endsets
f1=@sum(kinds:
y1)*2250-@sum(kinds:
x1+500-y1)*75-x1
(1)*1650-x1
(2)*1800-x1(3)*1950-x1(4)*1650-x1(5)*1725;
@sum(kinds:
y1)*0.03<=y1
(1)*0.088+y1
(2)*0.061+y1(3)*0.02+y1(4)*0.042+y1(5)*0.05;
@sum(kinds:
y1)*0.06>=y1
(1)*0.088+y1
(2)*0.061+y1(3)*0.02+y1(4)*0.042+y1(5)*0.05;
x1
(1)+500-y1
(1)>=0;
x1
(2)+500-y1
(2)>=0;
x1(3)+500-y1(3)>=0;
x1(4)+500-y1(4)>=0;
x1(5)+500-y1(5)>=0;
x1
(1)+500-y1
(1)<=1000;
x1
(2)+500-y1
(2)<=1000;
x1(3)+500-y1(3)<=1000;
x1(4)+500-y1(4)<=1000;
x1(5)+500-y1(5)<=1000;
y1
(1)+y1
(2)<=200;
y1(3)+y1(4)+y1(5)<=250;
y1
(1)+y1
(2)=y1(3)+y1(4)+y1(5);
f2=@sum(kinds:
y2)*2250-@sum(kinds:
500+x1-y1+x2-y2)*75-x2
(1)*1950-x2
(2)*1950-x2(3)*1650-x2(4)*1350-x2(5)*1725;
@sum(kinds:
y2)*0.03<=y2
(1)*0.088+y2
(2)*0.061+y2(3)*0.02+y2(4)*0.042+y2(5)*0.05;
@sum(kinds:
y2)*0.06>=y2
(1)*0.088+y2
(2)*0.061+y2(3)*0.02+y2(4)*0.042+y2(5)*0.05;
x1
(1)+500-y1
(1)+x2
(1)-y2
(1)>=0;
x1
(2)+500-y1
(2)+x2
(2)-y2
(2)>=0;
x1(3)+500-y1(3)+x2(3)-y2(3)>=0;
x1(4)+500-y1(4)+x2(4)-y2(4)>=0;
x1(5)+500-y1(5)+x2(5)-y2(5)>=0;
x1
(1)+500-y1
(1)+x2
(1)-y2
(1)<=1000;
x1
(2)+500-y1
(2)+x2(3)-y2(3)<=1000;
x1(3)+500-y1(3)+x2(4)-y2(4)<=1000;
x1(4)+500-y1(4)+x2(4)-y2(4)<=1000;
x1(5)+500-y1(5)+x2(5)-y2(5)<=1000;
y2
(1)+y2
(2)<=200;
y2(3)+y2(4)+y2(5)<=250;
y2
(1)+y2
(2)=y2(3)+y2(4)+y2(5);
f3=@sum(kinds:
y3)*2250-@sum(kinds:
500+x1-y1+x2-y2+x3-y3)*75-x3
(1)*1650-x3
(2)*2100-x3(3)*1950-x3(4)*1500-x3(5)*1425;
@sum(kinds:
y3)*0.03<=y3
(1)*0.088+y3
(2)*0.061+y3(3)*0.02+y3(4)*0.042+y3(5)*0.05;
@sum(kinds:
y3)*0.06>=y3
(1)*0.088+y3
(2)*0.061+y3(3)*0.02+y3(4)*0.042+y3(5)*0.05;
x1
(1)+500-y1
(1)+x2
(1)-y2
(1)+x3
(1)-y3
(1)>=0;
x1
(2)+500-y1
(2)+x2
(2)-y2
(2)+x3
(2)-y3
(2)>=0;
x1(3)+500-y1(3)+x2(3)-y2(3)+x3(3)-y3(3)>=0;
x1(4)+500-y1(4)+x2(4)-y2(4)+x3(4)-y3(4)>=0;
x1(5)+500-y1(5)+x2(5)-y2(5)+x3(5)-y3(5)>=0;
x1
(1)+500-y1
(1)+x2
(1)-y2
(1)+x3
(1)-y3
(1)<=1000;
x1
(2)+500-y1
(2)+x2
(2)-y2
(2)+x3
(2)-y3
(2)<=1000;
x1(3)+500-y1(3)+x2(3)-y2(3)+x3(3)-y3(3)<=1000;
x1(4)+500-y1(4)+x2(4)-y2(4)+x3(4)-y3(4)<=1000;
x1(5)+500-y1(5)+x2(5)-y2(5)+x3(5)-y3(5)<=1000;
y3
(1)+y3
(2)<=200;
y3(3)+y3(4)+y3(5)<=250;
y3
(1)+y3
(2)=y3(3)+y3(4)+y3(5);
f4=@sum(kinds:
y4)*2250-@sum(kinds:
500+x1-y1+x2-y2+x3-y3+x4-y4)*75-x4
(1)*1800-x4
(2)*1650-x4(3)*1800-x4(4)*1800-x4(5)*1875;
@sum(kinds:
y4)*0.03<=y4
(1)*0.088+y4
(2)*0.061+y4(3)*0.02+y4(4)*0.042+y4(5)*0.05;
@s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1)+x4
(1)-y4
(1)+x5
(1)-y5
(1)+x6
(1)-y6
(1)=500;
x1
(2)+500-y1
(2)+x2
(2)-y2
(2)+x3
(2)-y3
(2)+x4
(2)-y4
(2)+x5
(2)-y5
(2)+x6
(2)-y6
(2)=500;
x1(3)+500-y1(3)+x2(3)-y2(3)+x3(3)-y3(3)+x4(3)-y4(3)+x5(3)-y5(3)+x6(3)-y6(3)=500;
x1(4)+500-y1(4)+x2(4)-y2(4)+x3(4)-y3(4)+x4(4)-y4(4)+x5(4)-y5(4)+x6(4)-y6(4)=500;
x1(5)+500-y1(5)+x2(5)-y2(5)+x3(5)-y3(5)+x4(5)-y4(5)+x5(5)-y5(5)+x6(5)-y6(5)=500;
y6
(1)+y6
(2)<=200;
y6(3)+y6(4)+y6(5)<=250;
y6
(1)+y6
(2)=y6(3)+y6(4)+y6(5);
max=f1+f2+f3+f4+f5+f6;
END
(2)检验程序为:
a=0的程序如下:
sets:
kinds/1..5/:
x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6;
a;
endsets
f1=@sum(kinds:
y1)*2250-@sum(kinds:
x1+500-y1)*75-x1
(1)*1650-x1
(2)*1800-x1(3)*1950-x1(4)*1650-x1(5)*1725;
@sum(kinds:
y1)*0.03<=y1
(1)*0.088+y1
(2)*0.061+y1(3)*0.02+y1(4)*0.042+y1(5)*0.05;
@sum(kinds:
y1)*0.06>=y1
(1)*0.088+y1
(2)*0.061+y1(3)*0.02+y1(4)*0.042+y1(5)*0.05;
x1
(1)+500-y1
(1)>=0;
x1
(2)+500-y1
(2)>=0;
x1(3)+500-y1(3)>=0;
x1(4)+500-y1(4)>=0;
x1(5)+500-y1(5)>=0;
x1
(1)+500-y1
(1)<=1000;
x1
(2)+500-y1
(2)<=1000;
x1(3)+500-y1(3)<=1000;
x1(4)+500-y1(4)<=1000;
x1(5)+500-y1(5)<=1000;
y1
(1)+y1
(2)<=200;
y1(3)+y1(4)+y1(5)<=250;
y1
(1)+y1
(2)=y1(3)+y1(4)+y1(5);
f2=@sum(kinds:
y2)*2250-@sum(kinds:
500+x1-y1+x2-y2)*75-x1
(1)*1650-x2
(2)*1800-x2(3)*1950-x2(4)*1650-x2(5)*1725;
@sum(kinds:
y2)*0.03<=y2
(1)*0.088+y2
(2)*0.061+y2(3)*0.02+y2(4)*0.042+y2(5)*0.05;
@sum(kinds:
y2)*0.06>=y2
(1)*0.088+y2
(2)*0.061+y2(3)*0.02+y2(4)*0.042+y2(5)*0.05;
x1
(1)+500-y1
(1)+x2
(1)-y2
(1)>=0;
x1
(2)+500-y1
(2)+x2
(2)-y2
(2)>=0;
x1(3)+500-y1(3)+x2(3)-y2(3)>=0;
x1(4)+500-y1(4)+x2(4)-y2(4)>=0;
x1(5)+500-y1(5)+x2(5)-y2(5)>=0;
x1
(1)+500-y1
(1)+x2
(1)-y2
(1)<=1000;
x1
(2)+500-y1
(2)+x2(3)-y2(3)<=1000;
x1(3)+500-y1(3)+x2(4)-y2(4)<=1000;
x1(4)+500-y1(4)+x2(4)-y2(4)<=1000;
x1(5)+500-y1(5)+x2(5)-y2(5)<=1000;
y2
(1)+y2
(2)<=200;
y2(3)+y2(4)+y2(5)<=250;
y2
(1)+y2
(2)=y2(3)+y2(4)+y2(5);
f3=@sum(kinds:
y3)*2250-@sum(kinds:
500+x1-y1+x2-y2+x3-y3)*75-x3
(1)*1650-x3
(2)*1800-x3(3)*1950-x3(4)*1650-x3(5)*1725;
@sum(kinds:
y3)*0.03<=y3
(1)*0.088+y3
(2)*0.061+y3(3)*0.02+y3(4)*0.042+y3(5)*0.05;
@sum(kinds:
y3)*0.06>=y3
(1)*0.088+y3
(2)*0.061+y3(3)*0.02+y3(4)*0.042+y3(5)*0.05;
x1
(1)+500-y1
(1)+x2
(1)-y2
(1)+x3
(1)-y3
(1)>=0;
x1
(2)+500-y1