(181*(x^2/5 + 1)^3)/500 == (216*(1 - (9*x^2)/5)^(5/2))/125的解
时间: 2024-02-13 09:02:19 浏览: 57
这是一个方程,可以使用 MATLAB 的求解函数 `solve` 求解。以下是 MATLAB 命令的示例:
```matlab
syms x
eqn = (181*(x^2/5 + 1)^3)/500 == (216*(1 - (9*x^2)/5)^(5/2))/125;
sol = solve(eqn, x);
```
这个方程的解是一个复数,共有 6 个解。可以用 `double` 函数将解转换为实数。以下是 MATLAB 命令的示例:
```matlab
sol_double = double(sol);
```
现在 `sol_double` 就是这个方程的 6 个实数解。
相关问题
model: sets: gch/1..7/:p,s; gd/1..15/:A,y,z; links(gch,gd):x,c; endsets data: p = 160 155 155 160 155 150 160; s = 800 800 1000 2000 2000 2000 3000; c = 170.7 160.3 140.2 98.6 38 20.5 3.1 21.2 64.2 92 96 106 121.2 128 142 215.7 205.3 190.2 171.6 111 95.5 86 71.2 114.2 142 146 156 171.2 178 192 230.7 220.3 200.2 181.6 121 105.5 96 86.2 48.2 82 86 96 111.2 118 132 260.7 250.3 235.2 216.6 156 140.5 131 116.2 84.2 62 51 61 76.2 83 97 255.7 245.3 225.2 206.6 146 130.5 121 111.2 79.2 57 33 51 71.2 73 87 265.7 255.3 235.2 216.6 156 140.5 131 121.2 84.2 62 51 45 26.2 11 28 275.7 265.3 245.2 226.6 166 150.5 141 131.2 99.2 76 66 56 38.2 26 2; enddata min = W + Q + T; W = @sum(links(i,j):p(i)*x(i,j)); Q = @sum(links(i,j):c(i,j)*x(i,j)); T = @sum(gd(j):(1+y(j))*y(j)+(1+z(j))*z(j))*0.05; z(1)+y(2)=104 ; z(2)+y(3)=301 ; z(3)+y(4)=750 ; z(4)+y(5)=606 ; z(5)+y(6)=194 ; z(6)+y(7)=205; z(7)+y(8)=201; z(8)+y(9)=680; z(9)+y(10)=480; z(10)+y(11)=300; z(11)+y(12)=220; z(12)+y(13)=210; z(13)+y(14)=420; z(14)+y(15)=500; y(1)+z(1) = @sum(gch(i):x(i,1)); y(2)+z(2) = @sum(gch(i):x(i,2)); y(3)+z(3) = @sum(gch(i):x(i,3)); y(4)+z(4) = @sum(gch(i):x(i,4)); y(5)+z(5) = @sum(gch(i):x(i,5)); y(6)+z(6) = @sum(gch(i):x(i,6)); y(7)+z(7) = @sum(gch(i):x(i,7)); y(8)+z(8) = @sum(gch(i):x(i,8)); y(9)+z(9) = @sum(gch(i):x(i,9)); y(10)+z(10) = @sum(gch(i):x(i,10)); y(11)+z(11) = @sum(gch(i):x(i,11)); y(12)+z(12) = @sum(gch(i):x(i,12)); y(13)+z(13) = @sum(gch(i):x(i,13)); y(14)+z(14) = @sum(gch(i):x(i,14)); y(15)+z(15) = @sum(gch(i):x(i,15)); @for(gch(i):@sum(gd(j):x(i,j))<=s(i)); end 请将上述Lingo编程转换为GAMS语言
以下是将Lingo代码转换为GAMS语言的代码:
```
SETS
gch /1*7/
gd /1*15/;
PARAMETERS
p(gch)
s(gch)
c(gch, gd);
VARIABLES
x(gch, gd)
y(gd)
z(gd)
W
Q
T;
MINIMIZE
W + Q + T;
W.EQUATION
W = SUM((gch, gd), p(gch) * x(gch, gd));
Q.EQUATION
Q = SUM((gch, gd), c(gch, gd) * x(gch, gd));
T.EQUATION
T = SUM(gd, ((1 + y(gd)) * y(gd) + (1 + z(gd)) * z(gd)) * 0.05);
z('1') + y('2') = 104;
z('2') + y('3') = 301;
z('3') + y('4') = 750;
z('4') + y('5') = 606;
z('5') + y('6') = 194;
z('6') + y('7') = 205;
z('7') + y('8') = 201;
z('8') + y('9') = 680;
z('9') + y('10') = 480;
z('10') + y('11') = 300;
z('11') + y('12') = 220;
z('12') + y('13') = 210;
z('13') + y('14') = 420;
z('14') + y('15') = 500;
y('1') + z('1') = SUM(gch, x(gch, '1'));
y('2') + z('2') = SUM(gch, x(gch, '2'));
y('3') + z('3') = SUM(gch, x(gch, '3'));
y('4') + z('4') = SUM(gch, x(gch, '4'));
y('5') + z('5') = SUM(gch, x(gch, '5'));
y('6') + z('6') = SUM(gch, x(gch, '6'));
y('7') + z('7') = SUM(gch, x(gch, '7'));
y('8') + z('8') = SUM(gch, x(gch, '8'));
y('9') + z('9') = SUM(gch, x(gch, '9'));
y('10') + z('10') = SUM(gch, x(gch, '10'));
y('11') + z('11') = SUM(gch, x(gch, '11'));
y('12') + z('12') = SUM(gch, x(gch, '12'));
y('13') + z('13') = SUM(gch, x(gch, '13'));
y('14') + z('14') = SUM(gch, x(gch, '14'));
y('15') + z('15') = SUM(gch, x(gch, '15'));
SUBJECT TO
capacity(gch)..
SUM(gd, x(gch, gd)) <= s(gch);
MODEL transportation /ALL/;
SOLVE transportation USING LP MINIMIZING W;
```
阅读全文