作业帮 > 综合 > 作业

lingo求均方差最小值的点

来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/19 05:05:59
lingo求均方差最小值的点
model:
sets:
xx/1..100/:a;
yy/1..100/:b;
zz/1..100/:c;
dd/1..100/:d;
endsets
data:
a=@file('c:\x.txt');
b=@file('c:\y.txt');
c=@file('c:\z.txt');
enddata
d(I)=@sqrt((x-xx(I))^2+(y-yy(I))^2+(z-zz(I))^2);
min=@sum((d(I)-@SUM(d(I))/101)^2);
END
提示d(i)这里出错.
lingo求均方差最小值的点
model:
sets:
s/1..100/:x,y,z,d;
endsets
data:
enddata
@for(s(i):d(i)=@sqrt((x0-x(i))^2+(y0-y(i))^2+(z0-z(i))^2));
min=@sum(s(i):(d(i)-@sum(s(j):d(j))/100)^2);
end