Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- begin{tikzpicture}
- begin{axis}[
- width=0.75textwidth,
- height=0.5textwidth,
- xmin=0, xmax=29000,
- ymin=-10,ymax=10,
- xlabel={$k$},
- xlabel near ticks,
- ylabel near ticks,
- restrict y to domain=-11:11,
- restrict x to domain=0:24000,
- samples=1000,
- axis x line=center,
- axis y line=left,
- scaled ticks=false, tick label style={/pgf/number format/fixed,
- /pgf/number format/1000 sep = thinspace }
- ]
- defnf{1.50}
- defns{1.45}
- defnc{1.40}
- defd{0.0005}
- deflamda{0.0001}
- defk{2*pi/lamda}
- addplot[name path global=Aymm] gnuplot [domain=1:25000]{
- ((sqrt((sqrt(((2*pi/lamda)^(2)*nf^(2))-x^(2)))^(2)-((2*pi/lamda)^(2)*ns^(2))))+(sqrt((sqrt(((2*pi/lamda)^(2)*nf^(2))-x^(2)))^(2)-((2*pi/lamda)^(2)*nc^(2)))))/((x-(sqrt((sqrt(((2*pi/lamda)^(2)*nf^(2))-x^(2)))^(2)-((2*pi/lamda)^(2)*ns^(2)))*(sqrt((sqrt(((2*pi/lamda)^(2)*nf^(2))-x^(2)))^(2)-((2*pi/lamda)^(2)*nc^(2))))/x)))
- };
- addplot[magenta, name path global=Symm] gnuplot [domain=1:25000]{ tan(d*x)};
- draw[name intersections={of=Aymm and Symm,total=t,name=j}]
- foreach s in {1,...,t}{(j-s) node[circ](as){s}};
- end{axis}
- end{tikzpicture}
- pgfextra{
- pgfextractx{len}{pgfpointdiff{pgfplotspointaxisxy{0}{0}}{pgfpointanchor{j-s}{center}}}
- pgfextractx{plotwidth}{pgfpointdiff{pgfplotspointaxisxy{getvalue{xmin}}{0}}%
- {pgfplotspointaxisxy{getvalue{xmax}}{0}}}%
- pgfmathparse{len*(getvalue{xmax}-getvalue{xmin})/plotwidth}
- globalletmacroxpgfmathresult%
- xdefintsectX{pgfmathresult}%
- }
Add Comment
Please, Sign In to add comment