Guest User

Untitled

a guest
Jan 21st, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. begin{tikzpicture}
  2. begin{axis}[
  3. width=0.75textwidth,
  4. height=0.5textwidth,
  5. xmin=0, xmax=29000,
  6. ymin=-10,ymax=10,
  7. xlabel={$k$},
  8. xlabel near ticks,
  9. ylabel near ticks,
  10. restrict y to domain=-11:11,
  11. restrict x to domain=0:24000,
  12. samples=1000,
  13. axis x line=center,
  14. axis y line=left,
  15. scaled ticks=false, tick label style={/pgf/number format/fixed,
  16. /pgf/number format/1000 sep = thinspace }
  17. ]
  18.  
  19. defnf{1.50}
  20. defns{1.45}
  21. defnc{1.40}
  22. defd{0.0005}
  23. deflamda{0.0001}
  24. defk{2*pi/lamda}
  25.  
  26. addplot[name path global=Aymm] gnuplot [domain=1:25000]{
  27. ((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)))
  28. };
  29.  
  30. addplot[magenta, name path global=Symm] gnuplot [domain=1:25000]{ tan(d*x)};
  31.  
  32. draw[name intersections={of=Aymm and Symm,total=t,name=j}]
  33. foreach s in {1,...,t}{(j-s) node[circ](as){s}};
  34. end{axis}
  35. end{tikzpicture}
  36.  
  37. pgfextra{
  38. pgfextractx{len}{pgfpointdiff{pgfplotspointaxisxy{0}{0}}{pgfpointanchor{j-s}{center}}}
  39. pgfextractx{plotwidth}{pgfpointdiff{pgfplotspointaxisxy{getvalue{xmin}}{0}}%
  40. {pgfplotspointaxisxy{getvalue{xmax}}{0}}}%
  41. pgfmathparse{len*(getvalue{xmax}-getvalue{xmin})/plotwidth}
  42. globalletmacroxpgfmathresult%
  43. xdefintsectX{pgfmathresult}%
  44. }
Add Comment
Please, Sign In to add comment