Hi I want to plot the transcendental equation for dielectric waveguide the equation for that is

tan(x)=sqrt(v^2-x^2)/x where v is 8.219. the hand made plot is in the figure I know the basics but still couldn't figure out. any help would be appreciated.

4 Kommentare

Hey can you also help to plot another function? its like below:
  • # Item one (22.2*10^3)*sin((161*10^4)*x) x < d/2
  • # Item two (42.32*10^9)*exp(-2.896*10^6) x > d/2
here d/2 = 5*10^-6 m.
I need both graphs on a same plot. your help is very much appreciated man.
hi i want to plot a transcendental euqation for calculating the dielectric constant of the material .
[tan(B(DrD+le))/(Be*le)] = tanBe*le/Be*le
solve for Be*le

the values of B=1.41513 Dr=9.32 , D=9.22 ,le=1.6 solve for Be*le

The () are missing on the right side

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

This should get you started:
v = 8.219;
wvgd = @(x) sqrt(v^2-x.^2)./x;
intx = @(x) tan(x) - wvgd(x);
x = linspace(0,2.5*pi,500);
xi = 1:max(x);
for k1 = 1:length(xi)
itx(k1) = fzero(intx, xi(k1)); % Find Intersections Of tan(x) & wvgd(x)
end
itx = unique(itx);
figure(1)
plot(x, wvgd(x))
hold on
plot(x, tan(x))
plot(itx, tan(itx), 'pr', 'MarkerSize',7)
hold off
grid
axis([0 max(x) -50 50])
lblx = strsplit(sprintf('(%.2f,%.2f) ', [itx; tan(itx)]));
text(itx, tan(itx), lblx(1:length(itx)), 'VerticalAlignment','bottom', 'HorizontalAlignment','center')
This gives you the upper curve and the values of its intersection with your waveguide equation. I know nothing about waveguide engineering, so I don’t know how to calculate the lower curve you drew. I have to leave that for you.

2 Kommentare

Hey thank you so much. the other curve is for the equation tan(x) = x/sqrt(v^2-x^2). and I also need to include v= 8.219 line which should be vertical. can you help me adding that too? as I am struggling.
My pleasure!
Easy enough to add those lines to the code:
v = 8.219; % Asymptote
wvgd1 = @(x) real(sqrt(v^2-x.^2)./x); % Upper Curve
wvgd2 = @(x) -real(x./sqrt(v^2-x.^2)); % Lower Curve
intx1 = @(x) max(tan(x),0) - wvgd1(x); % Upper Intersection Function
intx2 = @(x) min(tan(x),0) - wvgd2(x); % Lower Intersection Function
dtanx = @(x) 1 + tan(x).^2; % Derivative of Tangent
x = linspace(0,v,500);
xi = 1:0.1:v; % Initial Estimate Vector
for k1 = 1:length(xi)
itx1(k1) = fzero(intx1, xi(k1)); % Find Intersections Of tan(x) & wvgd1(x)
itx2(k1) = fzero(intx2, xi(k1)); % Find Intersections Of tan(x) & wvgd1(x)
end
itx1((itx1 >= v) | (abs(tan(itx1)) > 10)) = []; % Delete Out-Of-Bounds Data
itx2((itx2 >= v) | (abs(tan(itx2)) > 10)) = []; % Delete Out-Of-Bounds Data
itx1 = itx1(diff([0 itx1])>1E-3); % Delete Near-Duplicate Entries
itx2 = itx2(diff([0 itx2])>1E-3); % Delete Near-Duplicate Entries
ytan = tan(x);
ytan(dtanx(x) > 1000) = NaN; % Eliminate Singularities From Plot
figure(1)
plot(x, wvgd1(x))
hold on
plot(x, wvgd2(x))
plot(x, ytan)
plot(itx1, tan(itx1), 'pb', 'MarkerSize',7,'MarkerFaceColor','b')
plot(itx2, tan(itx2), 'pb', 'MarkerSize',7,'MarkerFaceColor','b')
plot([v;v],ylim,'LineWidth',2)
hold off
grid
axis([0 max(x)+0.1 -10 10])
lblx1 = strsplit(sprintf('(%.2f,%.2f) ', [itx1; tan(itx1)]));
text(itx1, tan(itx1)+0.2, lblx1(1:length(itx1)), 'VerticalAlignment','bottom', 'HorizontalAlignment','right','FontSize',7)
lblx2 = strsplit(sprintf('(%.2f,%.2f) ', [itx2; tan(itx2)]));
text(itx2, tan(itx2)-0.2, lblx2(1:length(itx2)), 'VerticalAlignment','top', 'HorizontalAlignment','right','FontSize',7)
with the plot:
The ‘itx1’ and ‘itx2’ variables are the x-coordinates of the intersections. The values of the intersections at those points are the tangents of those values. The red vertical line at ‘v’ is the asymptote you requested.
(The most meaningful expression of appreciation here on MATLAB Answers is to Accept the answer that most closely solves your problem.)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Thanks a tonn.... "Star Strider" ....

3 Kommentare

My pleasure!
The other plot is relatively straightforward, but I wanted to ask if ‘Item #2’ is supposed to be a function of x because as written it isn’t (it’s a constant), and simply produces a straight line:
d2 = 5E-6;
fv = @(x) [(22.2E+3)*sin((161E+4).*x).*(x<d2) + (42.32E+9)*exp(-2.896E+6)*(x>=d2)];
x = linspace(0,2*d2);
figure(2)
plot(x, fv(x))
grid
Item 2 is a function of x its e^(x*the constant)
In that instance, the function changes to:
fv = @(x) [(22.2E+3)*sin((161E+4).*x).*(x<d2) + (42.32E+9)*exp(-2.896E+6.*x).*(x>=d2)];
and the plot is:

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by