数学建模集训答案.docx
文本预览下载声明
生成一个10个数据的随机向量,绘制对应的直方图,并把画出的图形保存为jpg文件。程序r =rand(10);hist(r);结果2. 用Lingo编程求解下列最小值问题,程序model:sets:in1/1..5/:a;in2/1..4/:b;endsetsdata:a=0 1 2 3 4;b=2 4 6 7;enddatamin=w-n-p;w=4*x1^3;p=2*x2;@for(in1:n=a*x1);x1+x2=4;2*x1+x2=5;@for(in2:-x1+b*x2=2);end结果Global optimal solution found. Objective value: -8.000000 Extended solver steps: 0 Total solver iterations: 0 Variable Value Reduced Cost W 0.000000 0.000000 N 0.000000 0.000000 P 8.000000 0.000000 X1 0.000000 1.000000 X2 4.000000 0.000000 A( 1) 0.000000 0.000000 A( 2) 1.000000 0.000000 A( 3) 2.000000 0.000000 A( 4) 3.000000 0.000000 A( 5) 4.000000 0.000000 B( 1) 2.000000 0.000000 B( 2) 4.000000 0.000000 B( 3) 6.000000 0.000000 B( 4) 7.000000 0.000000 Row Slack or Surplus Dual Price 1 -8.000000 -1.000000 2 0.000000 -1.000000 3 0.000000 1.000000 4 0.000000 0.000000 5 0.000000 1.000000 6 0.000000 0.000000 7 0.000000 0.000000
显示全部