Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.69 KB | None | 0 0
  1. \documentclass[english]{standalone}
  2.  
  3. \usepackage[pdftex]{graphicx}
  4. \usepackage{amsmath}
  5. \usepackage{tikz}
  6. \usetikzlibrary{quotes,angles}
  7.  
  8. \begin{document}
  9. \begin{tikzpicture}[scale=2]
  10. % The parameters
  11. \def\R{1.0}
  12. \def\L{2.5}
  13. \def\d{0.2}
  14. \def\thetaKnee{60}
  15.  
  16. \pgfmathsetmacro{\z}{\R * cos(\thetaKnee) - sqrt((\L)^2 - (-\d + \R * sin(\thetaKnee))^2)}
  17.  
  18. \def\Fsea{0.5}
  19. \pgfmathsetmacro{\phi}{asin((\R * sin(\thetaKnee) - \d) / \L)}
  20. \pgfmathsetmacro{\K}{sin(\thetaKnee - \phi) / cos(\phi)}
  21. \def\Ft{\K * \Fsea}
  22. \def\xFsea{{(\z - \Fsea)}}
  23.  
  24. \pgfmathsetmacro{\Rc}{\R * cos(\thetaKnee)}
  25. \pgfmathsetmacro{\Rs}{\R * sin(\thetaKnee)}
  26.  
  27. \pgfmathsetmacro{\Fc}{\Ft * cos(\thetaKnee)}
  28. \pgfmathsetmacro{\Fs}{\Ft * sin(\thetaKnee)}
  29.  
  30. \def\RcFs{\Rc - \Fs}
  31. \def\RsFc{\Rs + \Fc}
  32.  
  33. \pgfmathsetmacro{\Flx}{\Fsea}
  34. \pgfmathsetmacro{\Fly}{\Fsea * tan(\phi)}
  35. % size of the plot
  36. \def\xmin{-2.5}
  37. \def\xmax{2.0}
  38.  
  39. % Coordinates of the 3 horizontal lines
  40. \coordinate (A) at (\xmin, 0);
  41. \coordinate (B) at (\xmax, 0);
  42. \coordinate (C) at (\xmin, \d);
  43. \coordinate (D) at (\xmax, \d);
  44. \coordinate (E) at (\xmin, {\R * sin(\thetaKnee)});
  45. \coordinate (F) at (\xmax, {\R * sin(\thetaKnee)});
  46.  
  47. \node at (\xmin, 0) {};%A$};
  48. \node at (\xmax, 0) {};%B$};
  49. \node at (\xmin, \d) {};%C$};
  50. \node at (\xmax, \d) {};%D$};
  51. \node at (\xmin, {\R * sin(\thetaKnee)}) {};%E$};
  52. \node at (\xmax, {\R * sin(\thetaKnee)}) {};%F$};
  53.  
  54. % Key points O, P and Q
  55. \coordinate (O) at (0,0);
  56. \node[below] at (0, 0) {$O$};
  57.  
  58. \coordinate (P) at ({\R * cos(\thetaKnee)},{\R * sin(\thetaKnee)});
  59. \node[above] at ({\R * cos(\thetaKnee)},{\R * sin(\thetaKnee)}) {$P$};
  60.  
  61. \coordinate (Q) at (\z, \d);
  62.  
  63. \node[above] at (\z, \d) {$Q$};
  64.  
  65. % The 3 horizontal lines
  66. \draw [dotted] (A) -- (B);
  67. \draw [dotted] (C) -- (D);
  68. \draw [dotted] (E) -- (F);
  69.  
  70. % Force vectors
  71. \coordinate (FFS) at (\xFsea, \d);
  72.  
  73. \draw [->, green] (Q) -- (FFS) node[midway, above left] {$F_{\text{SEA}}$};
  74.  
  75. \coordinate (FFT) at (\RcFs, \RsFc);
  76. \draw [->, green] (P) -- (FFT) node[above] {$F_{\text{T}}$};
  77.  
  78. \coordinate (FLL) at ({\z - \Flx}, {\d - \Fly});
  79. \draw [->, orange] (Q) -- (FLL) node[below left] {$F_{\text{L}}$};
  80.  
  81. \coordinate (FLLL) at ({\Rc - \Flx}, {\Rs - \Fly});
  82. \draw [->, orange] (P) -- (FLLL) node[below left] {$F_{\text{L}}$};
  83.  
  84. % The dotted lines to make it easier to see the projections
  85. \draw [dotted] ({\z - \Fsea}, 0) -- ({\z - \Fsea}, \Rs);
  86. \draw [dotted, red] ({-\Ft / sin(\thetaKnee)}, 0) -- (FFT);
  87.  
  88. % Show the parameters on the graph: distances
  89. \draw [->] (1.4,0) -- (1.4, \d) node[midway, left] {$d$};
  90. \draw [->] (1.6,\d) -- (1.6, {\R * sin(\thetaKnee)}) node[midway, left] {$L \sin \varphi$};
  91. \draw [->] (1.8,0) -- (1.8, {\R * sin(\thetaKnee)}) node[midway, right] {$R \sin \theta$};
  92.  
  93. % Show the parameters on the graph: angles
  94. \draw [red] (O) -- (P) node[midway, left] {$R$};
  95. \draw [blue] (P) -- (Q) node[midway, above] {$L$};
  96.  
  97. \pic [draw, ->, "$\theta$", angle eccentricity=1.5] {angle = B--O--P};
  98. \pic [draw, ->, "$\theta$", angle eccentricity=1.5] {angle = A--P--O};
  99.  
  100. \pic [draw, ->, "$\varphi$", angle eccentricity=1.5] {angle = D--Q--P};
  101. \pic [draw, ->, "$\varphi$", angle eccentricity=1.5] {angle = E--P--Q};
  102.  
  103. \pic [draw, ->, "$\theta - \varphi$", angle eccentricity=1.5] {angle = Q--P--O};
  104.  
  105. \pic [draw, ->, "$\varphi$", angle eccentricity=1.5] {angle = FFS--Q--FLL};
  106. \end{tikzpicture}
  107.  
  108. \end{document}
  109.  
  110. %%% Local Variables:
  111. %%% mode: latex
  112. %%% TeX-master: t
  113. %%% End:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement