MATLAB Answers

0

Finding Complex root for the nonlinear equation with single variable

Ammar Ahmed 님이 질문을 제출함. 12 Oct 2019
최근 활동 Walter Roberson 님이 답변함. 17 Oct 2019
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

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"

로그인 to comment.

태그

답변 수: 5

Answer by Sulaymon Eshkabilov on 12 Oct 2019

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.

  댓글 수: 0

로그인 to comment.


Answer by John D'Errico
on 17 Oct 2019

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.

  댓글 수: 0

로그인 to comment.


Answer by Walter Roberson
on 17 Oct 2019

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.

  댓글 수: 0

로그인 to comment.


Answer by Ammar Ahmed on 17 Oct 2019

Walter Roberson can you share the fzero command you suggest to use

  댓글 수: 0

로그인 to comment.


Answer by Walter Roberson
on 17 Oct 2019

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, ....)

  댓글 수: 0

로그인 to comment.



Translated by