필터 지우기
필터 지우기

How to solve a system of nonlinear equations with three unknowns & three equations?

조회 수: 2 (최근 30일)
Farid
Farid 2013년 11월 3일
댓글: Walter Roberson 2013년 11월 8일
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
Farid
Farid 2013년 11월 4일
Yeah, all of them are equal to zero, x(1) is a positive and x(2) and x(3) are angles then it is reasonable to be between 0 and 2pi

댓글을 달려면 로그인하십시오.

답변 (2개)

Matt J
Matt J 2013년 11월 4일
편집: Matt J 2013년 11월 4일
Seems a matter of making a lucky initial guess. Here's one solution
x =
146.6872 3.9507 0.9997
Here's another
x =
592.2262 2.9287 9.3271
And another
x =
592.2262 2.9287 3.0439
  댓글 수: 7

댓글을 달려면 로그인하십시오.


Walter Roberson
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
Farid
Farid 2013년 11월 7일
these equations are not completely true and maybe the some coefficients should be changed,I'm looking for a general solution for these equation in MATLAB codes
Walter Roberson
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?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Numeric Solvers에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by