solve many independent equation in a run

2 ビュー (過去 30 日間)
Xin
Xin 2016 年 11 月 15 日
回答済み: Walter Roberson 2016 年 11 月 15 日
I have many independent non-linear equations, for example
a1+x1*log(x1-b1) - (x1-c1)*log(x1-d1) = 0
a2+x2*log(x2-b2) - (x2-c2)*log(x2-d2) = 0
a3+x3*log(x3-b3) - (x3-c3)*log(x3-d3) = 0
a4+x4*log(x4-b4) - (x4-c4)*log(x4-d4) = 0
where I want to solve for x1 x2 x3 x4, which are independent of each other.
Instead of writing a boring loop to solve for each equation, is there any fast and elegant way to get the solution in a vector within a sentence.
Many thanks
Xin

採用された回答

Walter Roberson
Walter Roberson 2016 年 11 月 15 日
syms x1 x2 x3 x4
sol = vpasolve( [ a1 + log(x1 - d1)*(c1 - x1) + x1*log(x1 - b1), a2 + log(x2 - d2)*(c2 - x2) + x2*log(x2 - b2), a3 + log(x3 - d3)*(c3 - x3) + x3*log(x3 - b3), a4 + log(x4 - d4)*(c4 - x4) + x4*log(x4 - b4)], [x1, x2, x3, x4])

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePhysics についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by