Guest User

Untitled

a guest
Jun 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. documentclass[11pt]{article}
  2.  
  3. usepackage{pgfplots}
  4. usepackage{tikz}
  5.  
  6. usetikzlibrary{
  7. decorations.markings,
  8. decorations.pathmorphing,
  9. calc,
  10. patterns,
  11. positioning
  12. }
  13.  
  14. tikzset{
  15. spring/.style={thick,decorate,decoration={zigzag,pre length=0.3cm,post length=0.3cm,segment length=6}},
  16. blank/.style={draw=none,fill=none,pos=0.5},
  17. ground/.style={fill,pattern=north east lines,draw=none,minimum width=0.5cm,minimum height=0.3cm},
  18. damper/.style={thick,
  19. decoration={markings, mark connection node=dmp,
  20. mark=at position 0.5 with
  21. {
  22. node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum width=10pt,minimum height=3pt,draw=none] {};
  23. draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);
  24. draw [thick] ($(dmp.north)+(0,-3pt)$) -- ($(dmp.north)+(0,3pt)$);
  25. }
  26. }, decorate
  27. },
  28. box/.style={draw,thick,minimum width=1cm, minimum height=1cm}
  29. }
  30.  
  31. begin{document}
  32.  
  33. begin{figure}[tbp]
  34. centering
  35. begin{tikzpicture}[node distance=3cm]
  36. node (wall) [ground, rotate=-90, minimum width=2cm] {};
  37. node (M1) [box, right=of wall.north] {$m_1$};
  38. node (M2) [box,right=of M1,label=below:$f$] {$m_2$};
  39.  
  40. draw (wall.north east) -- (wall.north west);
  41. draw [spring] (wall.north) -- (M1) node[blank,above,yshift=1mm] {};
  42. draw (wall.20) -- (wall.20 -| M1.west) coordinate (d1);
  43.  
  44. draw [spring] (M1) -- (M2) node[blank,above,yshift=1mm] {} ;
  45. draw [damper] (d1-|M1.east) -- (d1 -| M2.west);
  46.  
  47. node (wall2) [ground, right=of M2, anchor=north,rotate=90,minimum width=2cm] {};
  48. draw [spring] (M2) -- (wall2) node[blank,above,yshift=1mm] {};
  49. draw [damper] (d1-|M2.east) -- (d1 -| wall2.north);
  50. end{tikzpicture}
  51. end{figure}
  52. end{document}
Add Comment
Please, Sign In to add comment