How to solve a system of nonlinear equations with three unknowns & three equations?
조회 수: 2 (최근 30일)
이전 댓글 표시
I tried to solve the system of nonlinear equations with fsolve function but the answers for unknowns are not true,I think there is a problem with number of iterations or the reasonable error.
How can I set these parameters?
Here are the equations:
311*cos(0.5236-x(3))+x(1)*cos(x(2)+x(3))-311=0
311*sin(.5236-x(3))-(x(1)*sin(x(2)+x(3)))=0
(x(1)^2)*(tan(.5236)*cos(x(2))*cos(x(2)-.7526)-(1/tan(.5236))*(sin(x(2))*sin(x(2)-.7526)))-7036.18=0
x(1) is a positive and x(2) and x(3) are angles then it is reasonable to be between 0 and 2pi
댓글 수: 5
답변 (2개)
Walter Roberson
2013년 11월 6일
편집: Walter Roberson
2013년 11월 6일
x = [146.6871682461996007408428, 3.950714907905676528151964, 0.9997481449580266590840019]
To the accuracy used, this is the only solution with x(1) positive and the other two in [0, 2*Pi]
The x(1) in the 592 range (given by Matt J) appear to be false solutions.
Method of solution:
The third equation can be solved for x1 to give x1 in terms of x2.
The second equation can be solved for x3 to give x3 in terms of x2.
Substituting the x1 and x3 terms into the first equation gives an equation in terms of x2 only. This equation goes imaginary for some values of x2 in [0, 2*Pi] . By examining the plot, you can see that there is a single 0 crossing, somewhere near x2 = 5*Pi/4. You can use fzero() or equivalent to find the x2 for which the equation becomes 0.
Then, with the numeric x2 in hand, you can substitute into the two previous forms to get x1 and x3. Although there is an arctan() involved, there is only one solution that works.
댓글 수: 4
Walter Roberson
2013년 11월 8일
Your equations involve the values 0.5236 and 0.7526 . Is there a formula that relates those two values? If I replace 0.5236 with the symbol alpha, then can 0.7526 be expressed in terms of alpha, or is it an independent variable?
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!