Solving simultaneous equations numerically
古いコメントを表示
I have two equations that need to be solved numerically, I can't write out the equations explicitly but they are both of the form:
x = \sum_{i=1}^N (a-(b_i)x)/((a-(b_i)x)^2+q^2y^2)
All the parameters other than x and y are fixed in this equation. Both my equations are of similar forms but I'm not sure what is the best way to solve this numerically in MATLAB as these equations involve the summation and I have never dealt with this kind of equation in MATLAB before.
p.s. sorry for the mess but I hope the form of the equation is clear enough. Thanks.
採用された回答
その他の回答 (1 件)
Roger Stafford
2014 年 10 月 16 日
編集済み: Roger Stafford
2014 年 10 月 16 日
It doesn't matter that your two equations involve an extended summation. You can still create a function that generates these sums which you can use with the Optimization Toolbox function, 'fsolve'. You will, however, need to also furnish a guess or estimate to start the search for a solution. See:
http://www.mathworks.com/help/optim/ug/fsolve.html
5 件のコメント
John Smith
2014 年 10 月 16 日
編集済み: John Smith
2014 年 10 月 16 日
John D'Errico
2014 年 10 月 17 日
編集済み: John D'Errico
2014 年 10 月 17 日
Then it is not a numerical solution if those other variables are unknown! You are looking for a symbolic solution. Numerical solvers are not capable of solving symbolic problems.
John Smith
2014 年 10 月 17 日
John D'Errico
2014 年 10 月 20 日
編集済み: John D'Errico
2014 年 10 月 20 日
No. I understood exactly what you were asking. It did not come out wrong.
This means they are unknowns, symbolic variables. You are asking for a symbolic solution. Just because something is an unknown does not mean that you need to solve for it, or that you can solve for it!
A numerical solver (fsolve, lsqnonlin, fmincon, or fzero for a few examples) CANNOT have unknown symbolic variables in the problem. It is no longer a numerical problem, but a symbolic one, not in their domain.
If you really want to see how the solution varies as a function of these variables, the best you can do with a numerical solver is to substitute in some values for those parameters, THEN you can solve the problem using a numerical solver, and I suppose plot the result as a function of those parameters you have substituted.
If however, you insist on seeing an analytical solution in terms of those unknowns, then you need to use a tool that can handle symbolic computations.
There is no mistake here. I do understand what you are asking.
John Smith
2014 年 10 月 20 日
カテゴリ
ヘルプ センター および File Exchange で Common Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
