MATLAB Answers

How to solve transcendental equations in matlab

91 views (last 30 days)
I am practicing solving transcendental equations in matlab I have the given equation and I want to solve for x
tan(((0.9)*pi/w)*sqrt(1.468^2-x.^2))- sqrt((x.^2-1.458^2))/(sqrt(1.468^2-x.^2))==0
plotting w varies from 1.55 to 5 I tried all day but I cannot find solution, I tried with fzero(fun,xo) without success any suggestion?


Show 2 older comments
Walter Roberson
Walter Roberson on 12 Jun 2018
Please do not close questions that have an Answer.
alburary daniel
alburary daniel on 12 Jun 2018
A feel confuse because a will trying to solve problemas using newton rapson method
Walter Roberson
Walter Roberson on 13 Jun 2018
Do not close questions that have an Answer. The volunteers spent time responding to you, and their responses may help other people with similar questions.
I know that I spent about 2 hours investigating this myself, and I am disappointed that my contribution would just disappear as if I had never done the work.

Sign in to comment.

Accepted Answer

Anton Semechko
Anton Semechko on 12 Jun 2018
This is a complex-valued function. Just from visual inspection, it is apparent that the real part of this function has infinitely many solutions. The imaginary part, however, appears to have a finite number of zeros. Are those the solutions you are looking for?
f=tan(((0.9)*pi/w)*sqrt(1.468^2-x.^2)) - sqrt((x.^2-1.458^2))./(sqrt(1.468^2-x.^2));
hold on
set(gca,'YLim',[-10 10])


Show 5 older comments
alburary daniel
alburary daniel on 12 Jun 2018
but in this case I want that x-axis will be W not b, so change the result rigth in the code? by the way what do Z? can you explain that sentences
Anton Semechko
Anton Semechko on 12 Jun 2018
If you want to plot w along horizontal axis, change
plot(Z(i),W(i),'.k','MarkerSize',20) to plot(W(i),Z(i),'.k','MarkerSize',20),
plot(Z,W,'-b') to plot(W,Z,'-b')
x- and y-labels would have to be modified accordingly.
Variable Z is a vector that contains solutions to f(x,w)=0, so that abs(f(Z(i),W(i)))<tol, where tol=1E-16. W is vector of w values that go from 1.5 to 5.
Anton Semechko
Anton Semechko on 12 Jun 2018
Here is modified version of the code and visualization of computed results:
% Equation
f=@(x,w) tan((a*pi/w)*sqrt(n2^2-x.^2)) - sqrt((x.^2-n1^2))./(sqrt(n2^2-x.^2));
% Look for zeros for w=[1.5 5]
for i=1:numel(W)
% Initialize search
% Refine solution
f_i=@(x) f(x,W(i));
if abs(Fi)<abs(F_min), Z(i)=Zi; end
hold on
grid on

Sign in to comment.

More Answers (1)

Walter Roberson
Walter Roberson on 30 Jul 2018
Stop closing your questions that people have already answered!!
We are not free private consultants: public questions and public answers are the price we "charges". We answer publicly as volunteers so that everyone can benefit. When you close questions after people have answered, then you are taking advantage of what you learned but you are grabbing it away to prevent anyone else from benefiting from the time and knowledge that other people have contributed.


Sign in to comment.

Sign in to answer this question.