Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. documentclass[border=2pt]{standalone}
  2. usepackage[utf8]{inputenc}
  3.  
  4. usepackage{graphics}
  5. usepackage{tikz,pgfplots}
  6. usetikzlibrary{math} % Pour evaluate
  7. usetikzlibrary{calc} % Pour postionnement relatif
  8.  
  9. newcommand*{addZsupaUn}[2]{
  10. addplot[#2,samples=60,domain=0:Ttrace,thick=3pt,ultra thick,
  11. evaluate={ Tun = (1 / ( 6 *(#1-sqrt(#1^2 -1)) ));
  12. Tdeux = (1 / ( 6 *(#1+sqrt(#1^2 -1)) )); }
  13. ] { K * (1 - ( 1/( Tun - Tdeux ) )*( Tun *exp(-x/ Tun ) - Tdeux *exp(-x/ Tdeux ) )) };
  14. }
  15.  
  16. %newcommand*{LegendFlecheSup}[5]{
  17. % coordinate[evaluate={ Tun = (1 / ( 6 *(#1-sqrt(#1^2 -1)) ));
  18. % Tdeux = (1 / ( 6 *(#1+sqrt(#1^2 -1)) )); }
  19. % ] (C2) at (axis cs:#2, { K * (1 - ( 1/( Tun - Tdeux ) )*( Tun *exp(-#2/ Tun ) - Tdeux *exp(-#2/ Tdeux ) )) }) ;
  20. % draw node[anchor=#3] (#4) at #5 {$z =#2$};
  21. % draw[fleche] (C2) -- (#4.west) ;
  22. %}
  23.  
  24. newcommand*{LegendFlecheSup}[5]{
  25. coordinate (C2) at (axis cs:#2, { K * (1 - ( 1/( 0.622 - 0.04466 ) )*( 0.622 *exp(-#2/ 0.622 ) - 0.04466 *exp(-#2/ 0.04466 ) )) }) ;
  26. draw node[anchor=#3] (#4) at #5 {$z =#2$};
  27. draw[fleche] (C2) -- (#4.west) ;
  28. }
  29.  
  30. tikzset{ fleche/.style={<-,>=latex,line width=0.2mm,shorten <=-0.02cm} }
  31.  
  32. begin{document}
  33.  
  34. begin{tikzpicture}
  35.  
  36. defK{2}
  37. defw{(3.14159*2)}
  38. %defw{(3.14159*2/Ttrace)/sqrt(1-z^2)}
  39. defTtrace{3}
  40.  
  41. begin{axis}[axis x line=bottom, axis y line = left ,
  42. width=13cm, height=axisdefaultheight,
  43. ymax=1.55*K,%axis lines=none,
  44. ytick=empty,extra y ticks={K}, extra y tick labels={},extra y tick style={grid=major},
  45. %xtick=empty,
  46. ]
  47.  
  48. addplot[samples=2,domain=0:(Ttrace+0.1),thick=1pt] { K };
  49.  
  50. % z > 1 -----
  51. addZsupaUn{2}{blue,densely dotted}
  52. addZsupaUn{4}{blue,densely dotted}
  53.  
  54. LegendFlecheSup{4}{0.6}{west}{C3}{($(C2)+(axis cs:1,-0.5)$)}
  55. % LegendFlecheSup{2}{0.6}{south}{C4}{(C3.north)}
  56.  
  57. end{axis}
  58. end{tikzpicture}
  59.  
  60.  
  61. end{document}
  62.  
  63. ! Undefined control sequence.
  64. <argument> axis cs:0.6, { K * (1 - ( 1/( Tun
  65. - Tdeux ) )*( Tun *exp(-0.6...
  66. l.55 end{axis}
  67.  
  68. newcommand*{LegendFlecheSup}[5]{
  69. pgfmathparse{(1 / ( 6 *(#1-sqrt(#1^2 -1)) ))} pgfmathresult letTunpgfmathresult
  70. pgfmathparse{(1 / ( 6 *(#1+sqrt(#1^2 -1)) ))} pgfmathresult letTdeuxpgfmathresult
  71. coordinate (C2) at (axis cs:#2, { K * (1 - ( 1/( Tun - Tdeux ) )*( Tun *exp(-#2/ Tun )
  72. - Tdeux *exp(-#2/ Tdeux ) )) }) ;
  73. draw node[anchor=#3] (#4) at #5 {$z =#2$};
  74. draw[fleche] (C2) -- (#4.west) ;
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement