Re: [問題] 解13條聯立方程式
※ 引述《hillsand (hillsand)》之銘言:
: 大家好:
: 請教大家一題13條方程式解13個變數的語法,語法如下:
: Solve[{
: RD == (1.1*NR)^0.6,
: 0.6*1.1^0.6*NR^-0.4 == wr/em,
: wr == em^0.2,
: Q == (0.6 NQ^(-1/3) + 0.02 R^(-1/3) + 0.38 K^(-1/3))^-3,
: 0.6 (Q/NR)^(4/3) == w,
: 0.02 (Q/R)^(4/3) == em,
: 0.38 (Q/K)^(4/3) == 0.04,
: NR + NQ + NU == 1 - L,
: w (NR + NU) == wr*NR,
: C1/C2 == 4*em,
: L == (1/1.04*0.2^0.2*0.8^0.8*em^-0.2*w)^-0.2,
: Q == C1 + 0.25 Q*em^0.5,
: 0.25*Q*em^0.5 - em*C2 - em (R - RD) == 0},
: {RD, NR, wr, em, Q, NQ, R, K, w, NU, L, C1, C2}]
: Ctrl + Enter後:卻一直在running的狀態,跑了半小時也沒有得出解,因此
: 請教各位高手:我的語法錯誤的地方在那,如何修正才可得到惟一解?
: 感謝大家的指教。
eqns = {RD - (1.1*NR)^0.6, 0.6*1.1^0.6*NR^-0.4 - wr/em, wr - em^0.2,
Q - (0.6 NQ^(-1/3) + 0.02 R^(-1/3) + 0.38 K^(-1/3))^-3,
0.6 (Q/NR)^(4/3) - w, 0.02 (Q/R)^(4/3) - em,
0.38 (Q/K)^(4/3) - 0.04, NR + NQ + NU - 1 + L, w (NR + NU) - wr*NR,
C1/C2 - 4*em, L - (1/1.04*0.2^0.2*0.8^0.8*em^-0.2*w)^-0.2,
Q - C1 + 0.25 Q*em^0.5, 0.25*Q*em^0.5 - em*C2 - em (R - RD) - 0}
FindRoot[eqn, Transpose@{vars, RandomReal[{0, 50}, Length@vars]}]
NMinimize[Flatten@{eqns.eqns, Thread[vars > 0]}, vars,
Method -> {"NelderMead",
"InitialPoints" -> RandomReal[{0, 50}, {Length@vars+1, Length@vars}]}]
{0.608139, {RD -> 0.862636, NR -> 0.349893, wr -> 0.0242465,
em -> 0.0245557, Q -> 0.39012, NQ -> 0.117754, R -> 3.42295,
K -> 5.00012, w -> 0.710175, NU -> 0.000391739, L -> 0.746915,
C1 -> 0.258279, C2 -> 0.625896}}
--
養花種魚數月亮賞星星
http://chungyuandye.twbbs.org
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.233.129.177
推
10/12 22:09, , 1F
10/12 22:09, 1F
推
10/12 22:54, , 2F
10/12 22:54, 2F
推
10/13 11:57, , 3F
10/13 11:57, 3F
→
10/13 11:58, , 4F
10/13 11:58, 4F
推
12/04 17:13, , 5F
12/04 17:13, 5F
Mathematica 近期熱門文章
PTT數位生活區 即時熱門文章