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!
