3/((x-15)^2+(y-z)^2)^(1/2)*(-2*y+2*z)+15/(25+(8-z)^2)^(1/2)*(-16+2*z) >>
[x,y,z]=solve('28/5/(x^2+(y-5)^2)^(1/2)*x+3/((x-15)^2+(y-z)^2)^(1/2)*(2*x-30)=0','14/5/(x^2+(y-5)^2)^(1/2)*(2*y-10)+36/5+3/((x-15)^2+(y-z)^2)^(1/2)*(2*y-2*z)=0','3/((x-15)^2+(y-z)^2)^(1/2)*(-2*y+2*z)+15/(25+(8-z)^2)^(1/2)*(-16+2*z)=0') x =
1/775368163895688*(-3589667425443+294739115*7165391^(1/2)+37940745345*166991^(1/2))*166991^(1/2) y =
1375/216-520675/4643173368*7165391^(1/2)-520675/36070056*166991^(1/2) z =
8-1765/7165391*7165391^(1/2) >> x =1/775368163895688*(-3589667425443+294739115*7165391^(1/2)+37940745345*166991^(1/2))*166991^(1/2) x =
6.6952 >> y =1375/216-520675/4643173368*7165391^(1/2)-520675/36070056*166991^(1/2) y =
0.1667
>> z =8-1765/7165391*7165391^(1/2)
- 33 -
z =
7.3406 >>
5.6*(x^2+(y-5)^2)^0.5+7.2*y+6*((x-15)^2+(y-z)^2)^0.5+30*(25+(8-z)^2)^0.5
ans =
264.5867
公司三(20)
>> syms x y z f >>
f=5.6*(x^2+(y-5)^2)^0.5+7.2*y+6*((x-15)^2+(y-z)^2)^0.5+26*(25+(8-z)^2)^0.5 f =
28/5*(x^2+(y-5)^2)^(1/2)+36/5*y+6*((x-15)^2+(y-z)^2)^(1/2)+26*(25+(8-z)^2)^(1/2)
>> diff(f,'x') ans =
28/5/(x^2+(y-5)^2)^(1/2)*x+3/((x-15)^2+(y-z)^2)^(1/2)*(2*x-30)
>> diff(f,'y') ans =
14/5/(x^2+(y-5)^2)^(1/2)*(2*y-10)+36/5+3/((x-15)^2+(y-z)^2)^(1/2)*(2*y-2*z)
>> diff(f,'z') ans =
- 34 -
3/((x-15)^2+(y-z)^2)^(1/2)*(-2*y+2*z)+13/(25+(8-z)^2)^(1/2)*(-16+2*z) >>
[x,y,z]=solve('28/5/(x^2+(y-5)^2)^(1/2)*x+3/((x-15)^2+(y-z)^2)^(1/2)*(2*x-30)=0','14/5/(x^2+(y-5)^2)^(1/2)*(2*y-10)+36/5+3/((x-15)^2+(y-z)^2)^(1/2)*(2*y-2*z)=0','3/((x-15)^2+(y-z)^2)^(1/2)*(-2*y+2*z)+13/(25+(8-z)^2)^(1/2)*(-16+2*z)=0') x =
1/579031635076488*(-2680702014243+294739115*5350991^(1/2)+28333497345*166991^(1/2))*166991^(1/2) y =
1375/216-520675/3467442168*5350991^(1/2)-520675/36070056*166991^(1/2) z =
8-1765/5350991*5350991^(1/2) >> x =1/579031635076488*(-2680702014243+294739115*5350991^(1/2)+28333497345*166991^(1/2))*166991^(1/2) x =
6.7606 >> y =1375/216-520675/3467442168*5350991^(1/2)-520675/36070056*166991^(1/2) y =
0.1195
>> z =8-1765/5350991*5350991^(1/2)
- 35 -
z =
7.2370 >>
5.6*(x^2+(y-5)^2)^0.5+7.2*y+6*((x-15)^2+(y-z)^2)^0.5+26*(25+(8-z)^2)^0.5
ans =
244.3865
方案四
>> syms x4 y4 >>
f=5.6*(x4^2+(y4-5)^2)^0.5+7.2*y4+6*((x4-15)^2+(y4-8)^2)^0.5+5*(21+7.2) f =
28/5*(x4^2+(y4-5)^2)^(1/2)+36/5*y4+6*((x4-15)^2+(y4-8)^2)^(1/2)+141
>> diff(f,'x4') ans =
28/5/(x4^2+(y4-5)^2)^(1/2)*x4+3/((x4-15)^2+(y4-8)^2)^(1/2)*(2*x4-30)
>> diff(f,'y4') ans =
14/5/(x4^2+(y4-5)^2)^(1/2)*(2*y4-10)+36/5+3/((x4-15)^2+(y4-8)^2)^(1/2)*(2*y4-16) >>
[x4,y4]=solve('28/5/(x4^2+(y4-5)^2)^(1/2)*x4+3/((x4-15)^2+(y4-8)^2)^(1/2)*(2*x4-30)=0','14/5/(x4^2+(y4-5)^2)^(1/2)*(2*y4-10)+36/5+3/((x4-15)^2+(y4-8)^2)^(1/2)*(2*y4-16)=0')
- 36 -
x4 =
1765/216-1/216*166991^(1/2) y4 =
1375/216-520675/36070056*166991^(1/2)
>> x4 =1765/216-1/216*166991^(1/2) x4 =
6.2794
>> y4 =1375/216-520675/36070056*166991^(1/2) y4 =
0.4669
>> 5.6*(x4^2+(y4-5)^2)^0.5+7.2*y4+6*((x4-15)^2+(y4-8)^2)^0.5+5*(21+7.2)
ans =
256.8742 %公司一的管线建设费用
>> 5.6*(x4^2+(y4-5)^2)^0.5+7.2*y4+6*((x4-15)^2+(y4-8)^2)^0.5+5*(24+7.2)
ans =
271.8742 %公司二的管线建设费用
>> 5.6*(x4^2+(y4-5)^2)^0.5+7.2*y4+6*((x4-15)^2+(y4-8)^2)^0.5+5*(20+7.2)
ans =
251.8742 %公司一的管线建设费用
- 37 -