Finding Complex root for the nonlinear equation with single variable
이전 댓글 표시
function Sp = f(y)
c=[0.00974404439034699,0.00984082551153513,0.00991280676795526];
t=[1.40,1.70,1.90];
x1=(6+2.3*10^5*1i);
x2=(7+3*10^-9*1i);
A1=(y-x1)./(x1-2.*y); % the single variable is y in the equation
B1=(y-x2)./(x2-2.*y);
Sp=((t.*A1)./(1+c.*A1)+((1-t).*B1)./(1+c.*B1));
end
hi guys , I'm searching for solution for the mention equation , so that it would have two solution in such way one solution is correct and the other is not !!!!!
((t.*A1)./(1+c.*A1)+((1-t).*B1)./(1+c.*B1))=0 the nonlinear equation
any suggestion method to solve the roots for this equation !!!
댓글 수: 1
John D'Errico
2019년 10월 17일
Please don't use an answer to make a comment. Moved to a comment:
"this was not helping at all!!! can i solve it with fzero"
답변 (5개)
Walter Roberson
2019년 10월 17일
There is no fzero() command that can work. You have a vector of 3 equations that are inconsistent with each other. And if you were to break it up into three different equations, then you would encounter the problem that fzero() can only deal with real-valued functions of a single real-valued variable.
fsolve() can deal with complex valued functions.
A standard trick to convert complex inputs into real inputs is to separate into real and imaginary components, such as
f2 = @(x) x.^2 + 1;
f = @(x) f2(x(1) + 1i*x(2));
fsolve(f, ....)
Sulaymon Eshkabilov
2019년 10월 12일
0 개 추천
Hi Ammar,
Since your exercise is a nonlinear equation and thus, it is more appropriate to employ Newton-Raphson method for that you would need to evalaute the derivative of your equation and then solve the system numerically based on Newton-Raphson technique.
Good luck.
John D'Errico
2019년 10월 17일
0 개 추천
Please don't answer your question with a comment.
But the answer is, not you cannot use fzero to find a complex root. fzero ONLY solves for real roots.
Walter Roberson
2019년 10월 17일
0 개 추천
Your function returns three outputs for each input y, and the three outputs each have two complex solutions. There is no single value of y that solves all three values at the same time.
카테고리
도움말 센터 및 File Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!