数模论坛

 找回密码
 注-册-帐-号
搜索
热搜: 活动 交友 discuz
查看: 3540|回复: 5

请matlab高手看看我这个程序,我好困惑!!!

[复制链接]
发表于 2003-8-23 19:44:35 | 显示全部楼层 |阅读模式
这是自动化车床管理中一段小程序,刚开始我是对U从300到400以十为步进循环,发现T1值在300时是四点几,到后来都是五点几。
而如果我单取U为350时,T1值是4.6....,根本没达到5。
这下我就觉得奇怪了,然而更怪的是如果我把m=(n+1)/2变个位置,结果就是T1=5.2030。
真不知到底怎么搞得,还请大侠帮忙。
syms x n u
gzjl=[459,362,624,542,509,584,433 748,815,505,612,452,434,982,640,742,565,706,593,680,926,653,164,487,734,608,428,1153,593,844,527,552,513,781,474,388,824,538,862,659,775,859,755,649,697,515,628,954,771,609,402,960,885,610,292,837,473,677,358,638,699,634,555,570,84,416,606,1062,484,120,447,654,564,339,280,246,687,539,790,581,621,724,531,512,577,496,468,499,544,645,764,558,378,765,666,763,217,715,310,851];
q=sum(gzjl)/100
det=sqrt(sum((gzjl-q).^2)/99)
t=10;f=200;d=3000;k=1000;
ff=exp(-(x-q)^2/(2*det^2))/(det*sqrt(2*pi));
u=350;

F=int(ff,0,u);a=(int(x*ff,0,u)+u*(1-F))/F;
c=1/(1/14400+1/a);
n=sqrt(2*c*t/f);
m=(n+1)/2;      

T=t/n+k/u+(d+m*f)/c;
T1=double(T)
n=double(n)



把m=(n+1)/2; 调到   F=int(ff,0,u);a=(int(x*ff,0,u)+u*(1-F))/F;前

  syms x n u
gzjl=[459,362,624,542,509,584,433 748,815,505,612,452,434,982,640,742,565,706,593,680,926,653,164,487,734,608,428,1153,593,844,527,552,513,781,474,388,824,538,862,659,775,859,755,649,697,515,628,954,771,609,402,960,885,610,292,837,473,677,358,638,699,634,555,570,84,416,606,1062,484,120,447,654,564,339,280,246,687,539,790,581,621,724,531,512,577,496,468,499,544,645,764,558,378,765,666,763,217,715,310,851];
q=sum(gzjl)/100
det=sqrt(sum((gzjl-q).^2)/99)
t=10;f=200;d=3000;k=1000;
ff=exp(-(x-q)^2/(2*det^2))/(det*sqrt(2*pi));
u=350;
m=(n+1)/2;
F=int(ff,0,u);a=(int(x*ff,0,u)+u*(1-F))/F;
c=1/(1/14400+1/a);
n=sqrt(2*c*t/f);

T=t/n+k/u+(d+m*f)/c;
T1=double(T)
n=double(n)


运行一下,T1的结果不同。



发表于 2003-8-23 21:59:55 | 显示全部楼层
n=sqrt(2*c*t/f);
m=(n+1)/2;  
   与
m=(n+1)/2;
n=sqrt(2*c*t/f);能一样么
发表于 2003-8-23 22:03:40 | 显示全部楼层
不会连这都出吧,是你自己编的么?
发表于 2003-8-23 22:51:24 | 显示全部楼层
这段程序是会出现这个结果的。
我想知道你认为对的结果是什么?
发表于 2003-8-23 22:58:40 | 显示全部楼层
我不会啊
发表于 2003-8-23 23:11:17 | 显示全部楼层
你好厉害啊,这个都会了
您需要登录后才可以回帖 登录 | 注-册-帐-号

本版积分规则

小黑屋|手机版|Archiver|数学建模网 ( 湘ICP备11011602号 )

GMT+8, 2024-11-26 23:31 , Processed in 0.051567 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表