西安交大数学建模实验报告

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

数学建模实验报告

1,存货问题

(一)问题描述

某企业对于某种材料的月需求量为随机变量,具有如下表概率分布:

每次订货费为500元,每月每吨保管费为50元,每月每吨货物缺货费为1500元,每吨材料的购价为1000元。该企业欲采用周期性盘点的),(S s 策略来控制库存量,求最佳的s ,

S 值。(注:),(S s 策略指的是若发现存货量少于s 时立即订货,将存货补充到S ,使得经

济效益最佳。)

(二)问题分析

随机产生每个月需求量的概率,取遍每一个S 和s 的值,将每种S ,s 的组合对应的每月平均花费保存在数组money 里,筛选数组,选出其中费用最小值,并求出对应的S 和s 。模拟400个月的生产情况。

(三)程序代码

clear;clc;

need=0; remain=0; cost=0; mincostavg=inf; forsl=30:10:70 forsh=80:10:140 fornum=1:100000

m=rand; if m<=0.1 need=50;

elseif m<=0.3 need=60;

elseif m<=0.45 need=70;

elseif m<=0.7 need=80;

elseif m<=0.75 need=90;

elseif m<=0.85 need=100;

elseif m<=0.95

need=110;

else

need=120;

end

if remain

cost=cost+(sh-remain)*1000+500;

ifsh

cost=cost+(need-sh)*1500;

remain=0;

else

cost=cost+(sh-need)*50;

remain=sh-need;

end

else

if remain

cost=cost+(need-remain)*1500;

remain=0;

else

cost=cost+(remain-need)*50;

remain=remain-need;

end

end

end

costavg=cost/100000;

ifcostavg

mincostavg=costavg;

propersl=sl;

propersh=sh;

end

fprintf('s=%d, S=%d\nMonthly average cost=%.1f\n',sl,sh,costavg);

cost=0;

end

end

fprintf('\nWhen s=%d, S=%d\nThe least monthly average cost=%.1f\n',propersl,propersh,mincostavg);

(四)运行结果

s=30, S=80

Monthly average cost=85466.9

s=30, S=90

Monthly average cost=87007.6

Monthly average cost=87114.2 s=30, S=110

Monthly average cost=87951.0 s=30, S=120

Monthly average cost=86778.9 s=30, S=130

Monthly average cost=86411.8 s=30, S=140

Monthly average cost=86374.8 s=40, S=80

Monthly average cost=83707.2 s=40, S=90

Monthly average cost=84026.6 s=40, S=100

Monthly average cost=85089.1 s=40, S=110

Monthly average cost=85386.0 s=40, S=120

Monthly average cost=86294.0 s=40, S=130

Monthly average cost=85148.0 s=40, S=140

Monthly average cost=84992.9 s=50, S=80

Monthly average cost=83693.0 s=50, S=90

Monthly average cost=82548.0 s=50, S=100

Monthly average cost=82730.9 s=50, S=110

Monthly average cost=83873.1 s=50, S=120

Monthly average cost=84029.5 s=50, S=130

Monthly average cost=84908.4 s=50, S=140

Monthly average cost=84134.1 s=60, S=80

Monthly average cost=83615.9 s=60, S=90

Monthly average cost=82503.9 s=60, S=100

Monthly average cost=81677.0

Monthly average cost=81905.5

s=60, S=120

Monthly average cost=82946.0

s=60, S=130

Monthly average cost=83449.2

s=60, S=140

Monthly average cost=83871.3

s=70, S=80

Monthly average cost=83522.6

s=70, S=90

Monthly average cost=82525.8

s=70, S=100

Monthly average cost=81627.9

s=70, S=110

Monthly average cost=81323.3

s=70, S=120

Monthly average cost=82005.5

s=70, S=130

Monthly average cost=82601.6

s=70, S=140

Monthly average cost=82858.3

When s=70, S=110

The least monthly average cost=81323.3

(五)结果分析

用计算机模拟的结果和用数学分析的结果有一定的差异,由于计算机模拟时一般情况都是要简化模型的,所以在一定程度上会有所差异,我们可以考虑能不能通过改进算法来消除该差异,但对于一般的生产要求亦可以满足。

2,数据处理

(一)问题描述

在某海域测得一些点(x,y)处的水深z由下表给出,船的吃水深度为5英尺,在矩形区域(75,200)*(-50,150)里的哪些地方船要避免进入。

相关文档
最新文档