Tikz Mechanical picture Fix issues

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
6
down vote

favorite
1












This is my code:



documentclassstandalone
usepackagetikz
usetikzlibrarycalc,patterns,decorations.pathmorphing,decorations.markings,positioning

begindocument
tikzsetspring/.style=thick,decorate,decoration=zigzag,pre length=0.3cm,post
length=0.3cm,segment length=6,
short spring/.style=thick,decorate,decoration=zigzag,pre length=0.05cm,post
length=0.05cm,segment length=6,
damper/.style=thick,decoration=markings,
mark connection node=dmp,
mark=at position 0.5 with

node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum
width=15pt,minimum height=3pt,draw=none] ;
draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);
draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);

, decorate,
ground/.style=fill,pattern=north east lines,draw=none,minimum
width=0.75cm,minimum height=0.3cm,
ground_magenta/.style=fill,pattern=north east lines,pattern color=magenta,draw=none,minimum
width=0.75cm,minimum height=0.3cm

begintikzpicture[every node/.style=draw,outer sep=0pt,thick,font=sffamily]

%ORIGINAL SYSTEM
node (m_1) [minimum width=1cm,minimum height=0.8cm]$m_1$;
node (m_2)[right of= m_1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_2$;
draw [spring] (m_1.east) -- (m_2.west) node[midway,below=1mm,draw=none]$k_12$;
node (ground1) at (m_1.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground1.south west) -- (ground1.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground1.south) -| (m_1.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g1$ ;


node (m_3)[right of= m_2,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_3$;
draw [spring] (m_2.east) -- (m_3.west) node[midway,below=1mm,draw=none]$k_23$;
node (ground2) at (m_2.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground2.south west) -- (ground2.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground2.south) -| (m_2.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g2$ ;

node (m_4)[right of= m_3,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_4$;
draw [spring] (m_3.east) -- (m_4.west) node[midway,below=1mm,draw=none]$k_34$;
node (ground3) at (m_3.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground3.south west) -- (ground3.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground3.south) -| (m_3.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g3$ ;

node (m_5)[right of= m_4,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_5$;
draw [spring] (m_4.east) -- (m_5.west) node[midway,below=1mm,draw=none]$k_45$;
node (ground4) at (m_4.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground4.south west) -- (ground4.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground4.south) -| (m_4.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g4$ ;

node (ground5) at (m_5.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground5.south west) -- (ground5.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground5.south) -| (m_5.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g5$ ;

node (m_a1)[right of= m_5,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,yshift=1cm,ultra thick]$m_a1$;
node (m_a2)[right of= m_a1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,ultra thick]$m_a2$;
draw [spring,ultra thick] (m_a1.east) -- (m_a2.west) node[midway,below=1mm,draw=none]$k_a3$;
draw [ultra thick,decorate,decoration=zigzag,pre
length=3cm,post length=0.85cm,segment length=6] (m_4.north) |- (m_a1.north west) node[midway,below=1mm,xshift=-3mm,draw=none]$k_a1$ ;
draw [ultra thick,decorate,decoration=zigzag,pre
length=0.5cm,post length=0.85cm,segment length=6] (m_5.north) |- (m_a1.south west) node[midway,below=1mm,xshift=-3mm,draw=none]$k_a2$ ;

endtikzpicture

enddocument


Two things to fix:



  1. Put ka1 and ka2 as ka3 below the respective spring.

  2. Fix the anchor of the springs on ma1, i don't want these on the corners but in a "nice looking way" on the left of ma1.

  3. Font of everything needs to be Times New Roman

enter image description here










share|improve this question



















  • 1




    midway in conjunction of -| is a bit tricky as this will be the coordinate of the kink. pos=0.75 is in the middle of the vertical stretch and pos=0.25 in the middle of the horizontal one.
    – marmot
    1 hour ago














up vote
6
down vote

favorite
1












This is my code:



documentclassstandalone
usepackagetikz
usetikzlibrarycalc,patterns,decorations.pathmorphing,decorations.markings,positioning

begindocument
tikzsetspring/.style=thick,decorate,decoration=zigzag,pre length=0.3cm,post
length=0.3cm,segment length=6,
short spring/.style=thick,decorate,decoration=zigzag,pre length=0.05cm,post
length=0.05cm,segment length=6,
damper/.style=thick,decoration=markings,
mark connection node=dmp,
mark=at position 0.5 with

node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum
width=15pt,minimum height=3pt,draw=none] ;
draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);
draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);

, decorate,
ground/.style=fill,pattern=north east lines,draw=none,minimum
width=0.75cm,minimum height=0.3cm,
ground_magenta/.style=fill,pattern=north east lines,pattern color=magenta,draw=none,minimum
width=0.75cm,minimum height=0.3cm

begintikzpicture[every node/.style=draw,outer sep=0pt,thick,font=sffamily]

%ORIGINAL SYSTEM
node (m_1) [minimum width=1cm,minimum height=0.8cm]$m_1$;
node (m_2)[right of= m_1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_2$;
draw [spring] (m_1.east) -- (m_2.west) node[midway,below=1mm,draw=none]$k_12$;
node (ground1) at (m_1.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground1.south west) -- (ground1.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground1.south) -| (m_1.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g1$ ;


node (m_3)[right of= m_2,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_3$;
draw [spring] (m_2.east) -- (m_3.west) node[midway,below=1mm,draw=none]$k_23$;
node (ground2) at (m_2.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground2.south west) -- (ground2.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground2.south) -| (m_2.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g2$ ;

node (m_4)[right of= m_3,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_4$;
draw [spring] (m_3.east) -- (m_4.west) node[midway,below=1mm,draw=none]$k_34$;
node (ground3) at (m_3.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground3.south west) -- (ground3.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground3.south) -| (m_3.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g3$ ;

node (m_5)[right of= m_4,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_5$;
draw [spring] (m_4.east) -- (m_5.west) node[midway,below=1mm,draw=none]$k_45$;
node (ground4) at (m_4.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground4.south west) -- (ground4.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground4.south) -| (m_4.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g4$ ;

node (ground5) at (m_5.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground5.south west) -- (ground5.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground5.south) -| (m_5.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g5$ ;

node (m_a1)[right of= m_5,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,yshift=1cm,ultra thick]$m_a1$;
node (m_a2)[right of= m_a1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,ultra thick]$m_a2$;
draw [spring,ultra thick] (m_a1.east) -- (m_a2.west) node[midway,below=1mm,draw=none]$k_a3$;
draw [ultra thick,decorate,decoration=zigzag,pre
length=3cm,post length=0.85cm,segment length=6] (m_4.north) |- (m_a1.north west) node[midway,below=1mm,xshift=-3mm,draw=none]$k_a1$ ;
draw [ultra thick,decorate,decoration=zigzag,pre
length=0.5cm,post length=0.85cm,segment length=6] (m_5.north) |- (m_a1.south west) node[midway,below=1mm,xshift=-3mm,draw=none]$k_a2$ ;

endtikzpicture

enddocument


Two things to fix:



  1. Put ka1 and ka2 as ka3 below the respective spring.

  2. Fix the anchor of the springs on ma1, i don't want these on the corners but in a "nice looking way" on the left of ma1.

  3. Font of everything needs to be Times New Roman

enter image description here










share|improve this question



















  • 1




    midway in conjunction of -| is a bit tricky as this will be the coordinate of the kink. pos=0.75 is in the middle of the vertical stretch and pos=0.25 in the middle of the horizontal one.
    – marmot
    1 hour ago












up vote
6
down vote

favorite
1









up vote
6
down vote

favorite
1






1





This is my code:



documentclassstandalone
usepackagetikz
usetikzlibrarycalc,patterns,decorations.pathmorphing,decorations.markings,positioning

begindocument
tikzsetspring/.style=thick,decorate,decoration=zigzag,pre length=0.3cm,post
length=0.3cm,segment length=6,
short spring/.style=thick,decorate,decoration=zigzag,pre length=0.05cm,post
length=0.05cm,segment length=6,
damper/.style=thick,decoration=markings,
mark connection node=dmp,
mark=at position 0.5 with

node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum
width=15pt,minimum height=3pt,draw=none] ;
draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);
draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);

, decorate,
ground/.style=fill,pattern=north east lines,draw=none,minimum
width=0.75cm,minimum height=0.3cm,
ground_magenta/.style=fill,pattern=north east lines,pattern color=magenta,draw=none,minimum
width=0.75cm,minimum height=0.3cm

begintikzpicture[every node/.style=draw,outer sep=0pt,thick,font=sffamily]

%ORIGINAL SYSTEM
node (m_1) [minimum width=1cm,minimum height=0.8cm]$m_1$;
node (m_2)[right of= m_1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_2$;
draw [spring] (m_1.east) -- (m_2.west) node[midway,below=1mm,draw=none]$k_12$;
node (ground1) at (m_1.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground1.south west) -- (ground1.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground1.south) -| (m_1.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g1$ ;


node (m_3)[right of= m_2,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_3$;
draw [spring] (m_2.east) -- (m_3.west) node[midway,below=1mm,draw=none]$k_23$;
node (ground2) at (m_2.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground2.south west) -- (ground2.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground2.south) -| (m_2.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g2$ ;

node (m_4)[right of= m_3,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_4$;
draw [spring] (m_3.east) -- (m_4.west) node[midway,below=1mm,draw=none]$k_34$;
node (ground3) at (m_3.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground3.south west) -- (ground3.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground3.south) -| (m_3.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g3$ ;

node (m_5)[right of= m_4,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_5$;
draw [spring] (m_4.east) -- (m_5.west) node[midway,below=1mm,draw=none]$k_45$;
node (ground4) at (m_4.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground4.south west) -- (ground4.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground4.south) -| (m_4.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g4$ ;

node (ground5) at (m_5.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground5.south west) -- (ground5.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground5.south) -| (m_5.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g5$ ;

node (m_a1)[right of= m_5,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,yshift=1cm,ultra thick]$m_a1$;
node (m_a2)[right of= m_a1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,ultra thick]$m_a2$;
draw [spring,ultra thick] (m_a1.east) -- (m_a2.west) node[midway,below=1mm,draw=none]$k_a3$;
draw [ultra thick,decorate,decoration=zigzag,pre
length=3cm,post length=0.85cm,segment length=6] (m_4.north) |- (m_a1.north west) node[midway,below=1mm,xshift=-3mm,draw=none]$k_a1$ ;
draw [ultra thick,decorate,decoration=zigzag,pre
length=0.5cm,post length=0.85cm,segment length=6] (m_5.north) |- (m_a1.south west) node[midway,below=1mm,xshift=-3mm,draw=none]$k_a2$ ;

endtikzpicture

enddocument


Two things to fix:



  1. Put ka1 and ka2 as ka3 below the respective spring.

  2. Fix the anchor of the springs on ma1, i don't want these on the corners but in a "nice looking way" on the left of ma1.

  3. Font of everything needs to be Times New Roman

enter image description here










share|improve this question















This is my code:



documentclassstandalone
usepackagetikz
usetikzlibrarycalc,patterns,decorations.pathmorphing,decorations.markings,positioning

begindocument
tikzsetspring/.style=thick,decorate,decoration=zigzag,pre length=0.3cm,post
length=0.3cm,segment length=6,
short spring/.style=thick,decorate,decoration=zigzag,pre length=0.05cm,post
length=0.05cm,segment length=6,
damper/.style=thick,decoration=markings,
mark connection node=dmp,
mark=at position 0.5 with

node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum
width=15pt,minimum height=3pt,draw=none] ;
draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);
draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);

, decorate,
ground/.style=fill,pattern=north east lines,draw=none,minimum
width=0.75cm,minimum height=0.3cm,
ground_magenta/.style=fill,pattern=north east lines,pattern color=magenta,draw=none,minimum
width=0.75cm,minimum height=0.3cm

begintikzpicture[every node/.style=draw,outer sep=0pt,thick,font=sffamily]

%ORIGINAL SYSTEM
node (m_1) [minimum width=1cm,minimum height=0.8cm]$m_1$;
node (m_2)[right of= m_1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_2$;
draw [spring] (m_1.east) -- (m_2.west) node[midway,below=1mm,draw=none]$k_12$;
node (ground1) at (m_1.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground1.south west) -- (ground1.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground1.south) -| (m_1.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g1$ ;


node (m_3)[right of= m_2,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_3$;
draw [spring] (m_2.east) -- (m_3.west) node[midway,below=1mm,draw=none]$k_23$;
node (ground2) at (m_2.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground2.south west) -- (ground2.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground2.south) -| (m_2.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g2$ ;

node (m_4)[right of= m_3,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_4$;
draw [spring] (m_3.east) -- (m_4.west) node[midway,below=1mm,draw=none]$k_34$;
node (ground3) at (m_3.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground3.south west) -- (ground3.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground3.south) -| (m_3.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g3$ ;

node (m_5)[right of= m_4,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_5$;
draw [spring] (m_4.east) -- (m_5.west) node[midway,below=1mm,draw=none]$k_45$;
node (ground4) at (m_4.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground4.south west) -- (ground4.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground4.south) -| (m_4.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g4$ ;

node (ground5) at (m_5.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground5.south west) -- (ground5.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground5.south) -| (m_5.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g5$ ;

node (m_a1)[right of= m_5,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,yshift=1cm,ultra thick]$m_a1$;
node (m_a2)[right of= m_a1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,ultra thick]$m_a2$;
draw [spring,ultra thick] (m_a1.east) -- (m_a2.west) node[midway,below=1mm,draw=none]$k_a3$;
draw [ultra thick,decorate,decoration=zigzag,pre
length=3cm,post length=0.85cm,segment length=6] (m_4.north) |- (m_a1.north west) node[midway,below=1mm,xshift=-3mm,draw=none]$k_a1$ ;
draw [ultra thick,decorate,decoration=zigzag,pre
length=0.5cm,post length=0.85cm,segment length=6] (m_5.north) |- (m_a1.south west) node[midway,below=1mm,xshift=-3mm,draw=none]$k_a2$ ;

endtikzpicture

enddocument


Two things to fix:



  1. Put ka1 and ka2 as ka3 below the respective spring.

  2. Fix the anchor of the springs on ma1, i don't want these on the corners but in a "nice looking way" on the left of ma1.

  3. Font of everything needs to be Times New Roman

enter image description here







tikz-pgf






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 1 hour ago









AndréC

4,6221834




4,6221834










asked 1 hour ago









iacopo

62519




62519







  • 1




    midway in conjunction of -| is a bit tricky as this will be the coordinate of the kink. pos=0.75 is in the middle of the vertical stretch and pos=0.25 in the middle of the horizontal one.
    – marmot
    1 hour ago












  • 1




    midway in conjunction of -| is a bit tricky as this will be the coordinate of the kink. pos=0.75 is in the middle of the vertical stretch and pos=0.25 in the middle of the horizontal one.
    – marmot
    1 hour ago







1




1




midway in conjunction of -| is a bit tricky as this will be the coordinate of the kink. pos=0.75 is in the middle of the vertical stretch and pos=0.25 in the middle of the horizontal one.
– marmot
1 hour ago




midway in conjunction of -| is a bit tricky as this will be the coordinate of the kink. pos=0.75 is in the middle of the vertical stretch and pos=0.25 in the middle of the horizontal one.
– marmot
1 hour ago










2 Answers
2






active

oldest

votes

















up vote
4
down vote













  1. To make adjustments to the positions of the labels you can use xshift and yshift


  2. You can also adjust the coordinates of (m_a1.north west) and (m_a1.south west) using xshift and yshift. These go inside using square brackets, e.g. ([yshift=-1mm]m_a1.north west).


  3. For a Times New Roman style font, I recommend using newtx.


enter image description here



documentclass[margin=1cm]standalone
usepackagetikz
usepackagenewtxtext,newtxmath
usetikzlibrarycalc,patterns,decorations.pathmorphing,decorations.markings,positioning

begindocument
tikzsetspring/.style=thick,decorate,decoration=zigzag,pre length=0.3cm,post
length=0.3cm,segment length=6,
short spring/.style=thick,decorate,decoration=zigzag,pre length=0.05cm,post
length=0.05cm,segment length=6,
damper/.style=thick,decoration=markings,
mark connection node=dmp,
mark=at position 0.5 with

node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum
width=15pt,minimum height=3pt,draw=none] ;
draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);
draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);

, decorate,
ground/.style=fill,pattern=north east lines,draw=none,minimum
width=0.75cm,minimum height=0.3cm,
ground_magenta/.style=fill,pattern=north east lines,pattern color=magenta,draw=none,minimum
width=0.75cm,minimum height=0.3cm

begintikzpicture[every node/.style=draw,outer sep=0pt,thick,font=sffamily]

%ORIGINAL SYSTEM
node (m_1) [minimum width=1cm,minimum height=0.8cm]$m_1$;
node (m_2)[right of= m_1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_2$;
draw [spring] (m_1.east) -- (m_2.west) node[midway,below=1mm,draw=none]$k_12$;
node (ground1) at (m_1.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground1.south west) -- (ground1.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground1.south) -| (m_1.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g1$ ;


node (m_3)[right of= m_2,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_3$;
draw [spring] (m_2.east) -- (m_3.west) node[midway,below=1mm,draw=none]$k_23$;
node (ground2) at (m_2.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground2.south west) -- (ground2.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground2.south) -| (m_2.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g2$ ;

node (m_4)[right of= m_3,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_4$;
draw [spring] (m_3.east) -- (m_4.west) node[midway,below=1mm,draw=none]$k_34$;
node (ground3) at (m_3.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground3.south west) -- (ground3.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground3.south) -| (m_3.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g3$ ;

node (m_5)[right of= m_4,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_5$;
draw [spring] (m_4.east) -- (m_5.west) node[midway,below=1mm,draw=none]$k_45$;
node (ground4) at (m_4.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground4.south west) -- (ground4.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground4.south) -| (m_4.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g4$ ;

node (ground5) at (m_5.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
draw (ground5.south west) -- (ground5.south east);
draw [thick,decorate,decoration=zigzag,pre
length=0.1cm,post length=0.85cm,segment length=6] (ground5.south) -| (m_5.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g5$ ;

node (m_a1)[right of= m_5,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,yshift=1cm,ultra thick]$m_a1$;
node (m_a2)[right of= m_a1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,ultra thick]$m_a2$;
draw [spring,ultra thick] (m_a1.east) -- (m_a2.west) node[midway,below=1mm,draw=none]$k_a3$;
draw [ultra thick,decorate,decoration=zigzag,pre
length=3cm,post length=0.85cm,segment length=6] (m_4.north) |- ([yshift=-1.5mm]m_a1.north west) node[midway,above=2mm,xshift=28mm,draw=none]$k_a1$ ;
draw [ultra thick,decorate,decoration=zigzag,pre
length=0.8cm,post length=0.65cm,segment length=6] (m_5.north) |- ([yshift=1.5mm]m_a1.south west) node[midway,below=1mm,xshift=9mm,draw=none]$k_a2$ ;

endtikzpicture

enddocument





share|improve this answer



























    up vote
    4
    down vote













    Slightly different from Milo's nice answer.




    1. midway in conjunction of -| is a bit tricky as this will be the coordinate of the kink. pos=0.75 is in the middle of the vertical stretch and pos=0.25 in the middle of the horizontal one. I thus propose just to play with pos=... instead of adding too many xshifts.


    2. north west corresponds to 135. If you use 145 instead you are slightly below north west.

    3. I am not an expert on fonts, sorry.

    Here's the code.



    documentclassstandalone
    usepackagetikz
    usetikzlibrarycalc,patterns,decorations.pathmorphing,decorations.markings,positioning

    begindocument
    tikzsetspring/.style=thick,decorate,decoration=zigzag,pre length=0.3cm,post
    length=0.3cm,segment length=6,
    short spring/.style=thick,decorate,decoration=zigzag,pre length=0.05cm,post
    length=0.05cm,segment length=6,
    damper/.style=thick,decoration=markings,
    mark connection node=dmp,
    mark=at position 0.5 with

    node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum
    width=15pt,minimum height=3pt,draw=none] ;
    draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);
    draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);

    , decorate,
    ground/.style=fill,pattern=north east lines,draw=none,minimum
    width=0.75cm,minimum height=0.3cm,
    ground_magenta/.style=fill,pattern=north east lines,pattern color=magenta,draw=none,minimum
    width=0.75cm,minimum height=0.3cm

    begintikzpicture[every node/.style=draw,outer sep=0pt,thick,font=sffamily]

    %ORIGINAL SYSTEM
    node (m_1) [minimum width=1cm,minimum height=0.8cm]$m_1$;
    node (m_2)[right of= m_1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_2$;
    draw [spring] (m_1.east) -- (m_2.west) node[midway,below=1mm,draw=none]$k_12$;
    node (ground1) at (m_1.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
    draw (ground1.south west) -- (ground1.south east);
    draw [thick,decorate,decoration=zigzag,pre
    length=0.1cm,post length=0.85cm,segment length=6] (ground1.south) -| (m_1.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g1$ ;


    node (m_3)[right of= m_2,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_3$;
    draw [spring] (m_2.east) -- (m_3.west) node[midway,below=1mm,draw=none]$k_23$;
    node (ground2) at (m_2.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
    draw (ground2.south west) -- (ground2.south east);
    draw [thick,decorate,decoration=zigzag,pre
    length=0.1cm,post length=0.85cm,segment length=6] (ground2.south) -| (m_2.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g2$ ;

    node (m_4)[right of= m_3,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_4$;
    draw [spring] (m_3.east) -- (m_4.west) node[midway,below=1mm,draw=none]$k_34$;
    node (ground3) at (m_3.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
    draw (ground3.south west) -- (ground3.south east);
    draw [thick,decorate,decoration=zigzag,pre
    length=0.1cm,post length=0.85cm,segment length=6] (ground3.south) -|
    (m_3.south) node[midway,below=2pt,xshift=-3mm,draw=none]$k_g3$ ;

    node (m_5)[right of= m_4,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_5$;
    draw [spring] (m_4.east) -- (m_5.west) node[midway,below=2pt,draw=none]$k_45$;
    node (ground4) at (m_4.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
    draw (ground4.south west) -- (ground4.south east);
    draw [thick,decorate,decoration=zigzag,pre
    length=0.1cm,post length=0.85cm,segment length=6] (ground4.south) -|
    (m_4.south) node[midway,below=2pt,xshift=-3mm,draw=none]$k_g4$ ;

    node (ground5) at (m_5.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
    draw (ground5.south west) -- (ground5.south east);
    draw [thick,decorate,decoration=zigzag,pre
    length=0.1cm,post length=0.85cm,segment length=6] (ground5.south) -|
    (m_5.south) node[midway,below=2pt,xshift=-3mm,draw=none]$k_g5$ ;

    node (m_a1)[right of= m_5,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,yshift=1cm,ultra thick]$m_a1$;
    node (m_a2)[right of= m_a1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,ultra thick]$m_a2$;
    draw [spring,ultra thick] (m_a1.east) -- (m_a2.west) node[midway,below=2pt,draw=none]$k_a3$;
    draw [ultra thick,decorate,decoration=zigzag,pre
    length=3cm,post length=0.85cm,segment length=6] (m_4.north) |- (m_a1.145)
    node[pos=0.8,below=2pt,draw=none]$k_a1$ ;
    draw [ultra thick,decorate,decoration=zigzag,pre
    length=0.5cm,post length=0.85cm,segment length=6] (m_5.north) |- (m_a1.215)
    node[pos=0.7,below=2pt,draw=none]$k_a2$ ;

    endtikzpicture

    enddocument


    enter image description here






    share|improve this answer




















    • +1 from me. :-)
      – Milo
      55 mins ago










    • @Milo Thanks. I upvoted your recent answers, too, and of course the one above.
      – marmot
      53 mins ago










    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "85"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f457344%2ftikz-mechanical-picture-fix-issues%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    4
    down vote













    1. To make adjustments to the positions of the labels you can use xshift and yshift


    2. You can also adjust the coordinates of (m_a1.north west) and (m_a1.south west) using xshift and yshift. These go inside using square brackets, e.g. ([yshift=-1mm]m_a1.north west).


    3. For a Times New Roman style font, I recommend using newtx.


    enter image description here



    documentclass[margin=1cm]standalone
    usepackagetikz
    usepackagenewtxtext,newtxmath
    usetikzlibrarycalc,patterns,decorations.pathmorphing,decorations.markings,positioning

    begindocument
    tikzsetspring/.style=thick,decorate,decoration=zigzag,pre length=0.3cm,post
    length=0.3cm,segment length=6,
    short spring/.style=thick,decorate,decoration=zigzag,pre length=0.05cm,post
    length=0.05cm,segment length=6,
    damper/.style=thick,decoration=markings,
    mark connection node=dmp,
    mark=at position 0.5 with

    node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum
    width=15pt,minimum height=3pt,draw=none] ;
    draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);
    draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);

    , decorate,
    ground/.style=fill,pattern=north east lines,draw=none,minimum
    width=0.75cm,minimum height=0.3cm,
    ground_magenta/.style=fill,pattern=north east lines,pattern color=magenta,draw=none,minimum
    width=0.75cm,minimum height=0.3cm

    begintikzpicture[every node/.style=draw,outer sep=0pt,thick,font=sffamily]

    %ORIGINAL SYSTEM
    node (m_1) [minimum width=1cm,minimum height=0.8cm]$m_1$;
    node (m_2)[right of= m_1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_2$;
    draw [spring] (m_1.east) -- (m_2.west) node[midway,below=1mm,draw=none]$k_12$;
    node (ground1) at (m_1.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
    draw (ground1.south west) -- (ground1.south east);
    draw [thick,decorate,decoration=zigzag,pre
    length=0.1cm,post length=0.85cm,segment length=6] (ground1.south) -| (m_1.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g1$ ;


    node (m_3)[right of= m_2,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_3$;
    draw [spring] (m_2.east) -- (m_3.west) node[midway,below=1mm,draw=none]$k_23$;
    node (ground2) at (m_2.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
    draw (ground2.south west) -- (ground2.south east);
    draw [thick,decorate,decoration=zigzag,pre
    length=0.1cm,post length=0.85cm,segment length=6] (ground2.south) -| (m_2.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g2$ ;

    node (m_4)[right of= m_3,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_4$;
    draw [spring] (m_3.east) -- (m_4.west) node[midway,below=1mm,draw=none]$k_34$;
    node (ground3) at (m_3.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
    draw (ground3.south west) -- (ground3.south east);
    draw [thick,decorate,decoration=zigzag,pre
    length=0.1cm,post length=0.85cm,segment length=6] (ground3.south) -| (m_3.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g3$ ;

    node (m_5)[right of= m_4,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_5$;
    draw [spring] (m_4.east) -- (m_5.west) node[midway,below=1mm,draw=none]$k_45$;
    node (ground4) at (m_4.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
    draw (ground4.south west) -- (ground4.south east);
    draw [thick,decorate,decoration=zigzag,pre
    length=0.1cm,post length=0.85cm,segment length=6] (ground4.south) -| (m_4.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g4$ ;

    node (ground5) at (m_5.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
    draw (ground5.south west) -- (ground5.south east);
    draw [thick,decorate,decoration=zigzag,pre
    length=0.1cm,post length=0.85cm,segment length=6] (ground5.south) -| (m_5.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g5$ ;

    node (m_a1)[right of= m_5,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,yshift=1cm,ultra thick]$m_a1$;
    node (m_a2)[right of= m_a1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,ultra thick]$m_a2$;
    draw [spring,ultra thick] (m_a1.east) -- (m_a2.west) node[midway,below=1mm,draw=none]$k_a3$;
    draw [ultra thick,decorate,decoration=zigzag,pre
    length=3cm,post length=0.85cm,segment length=6] (m_4.north) |- ([yshift=-1.5mm]m_a1.north west) node[midway,above=2mm,xshift=28mm,draw=none]$k_a1$ ;
    draw [ultra thick,decorate,decoration=zigzag,pre
    length=0.8cm,post length=0.65cm,segment length=6] (m_5.north) |- ([yshift=1.5mm]m_a1.south west) node[midway,below=1mm,xshift=9mm,draw=none]$k_a2$ ;

    endtikzpicture

    enddocument





    share|improve this answer
























      up vote
      4
      down vote













      1. To make adjustments to the positions of the labels you can use xshift and yshift


      2. You can also adjust the coordinates of (m_a1.north west) and (m_a1.south west) using xshift and yshift. These go inside using square brackets, e.g. ([yshift=-1mm]m_a1.north west).


      3. For a Times New Roman style font, I recommend using newtx.


      enter image description here



      documentclass[margin=1cm]standalone
      usepackagetikz
      usepackagenewtxtext,newtxmath
      usetikzlibrarycalc,patterns,decorations.pathmorphing,decorations.markings,positioning

      begindocument
      tikzsetspring/.style=thick,decorate,decoration=zigzag,pre length=0.3cm,post
      length=0.3cm,segment length=6,
      short spring/.style=thick,decorate,decoration=zigzag,pre length=0.05cm,post
      length=0.05cm,segment length=6,
      damper/.style=thick,decoration=markings,
      mark connection node=dmp,
      mark=at position 0.5 with

      node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum
      width=15pt,minimum height=3pt,draw=none] ;
      draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);
      draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);

      , decorate,
      ground/.style=fill,pattern=north east lines,draw=none,minimum
      width=0.75cm,minimum height=0.3cm,
      ground_magenta/.style=fill,pattern=north east lines,pattern color=magenta,draw=none,minimum
      width=0.75cm,minimum height=0.3cm

      begintikzpicture[every node/.style=draw,outer sep=0pt,thick,font=sffamily]

      %ORIGINAL SYSTEM
      node (m_1) [minimum width=1cm,minimum height=0.8cm]$m_1$;
      node (m_2)[right of= m_1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_2$;
      draw [spring] (m_1.east) -- (m_2.west) node[midway,below=1mm,draw=none]$k_12$;
      node (ground1) at (m_1.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
      draw (ground1.south west) -- (ground1.south east);
      draw [thick,decorate,decoration=zigzag,pre
      length=0.1cm,post length=0.85cm,segment length=6] (ground1.south) -| (m_1.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g1$ ;


      node (m_3)[right of= m_2,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_3$;
      draw [spring] (m_2.east) -- (m_3.west) node[midway,below=1mm,draw=none]$k_23$;
      node (ground2) at (m_2.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
      draw (ground2.south west) -- (ground2.south east);
      draw [thick,decorate,decoration=zigzag,pre
      length=0.1cm,post length=0.85cm,segment length=6] (ground2.south) -| (m_2.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g2$ ;

      node (m_4)[right of= m_3,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_4$;
      draw [spring] (m_3.east) -- (m_4.west) node[midway,below=1mm,draw=none]$k_34$;
      node (ground3) at (m_3.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
      draw (ground3.south west) -- (ground3.south east);
      draw [thick,decorate,decoration=zigzag,pre
      length=0.1cm,post length=0.85cm,segment length=6] (ground3.south) -| (m_3.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g3$ ;

      node (m_5)[right of= m_4,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_5$;
      draw [spring] (m_4.east) -- (m_5.west) node[midway,below=1mm,draw=none]$k_45$;
      node (ground4) at (m_4.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
      draw (ground4.south west) -- (ground4.south east);
      draw [thick,decorate,decoration=zigzag,pre
      length=0.1cm,post length=0.85cm,segment length=6] (ground4.south) -| (m_4.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g4$ ;

      node (ground5) at (m_5.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
      draw (ground5.south west) -- (ground5.south east);
      draw [thick,decorate,decoration=zigzag,pre
      length=0.1cm,post length=0.85cm,segment length=6] (ground5.south) -| (m_5.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g5$ ;

      node (m_a1)[right of= m_5,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,yshift=1cm,ultra thick]$m_a1$;
      node (m_a2)[right of= m_a1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,ultra thick]$m_a2$;
      draw [spring,ultra thick] (m_a1.east) -- (m_a2.west) node[midway,below=1mm,draw=none]$k_a3$;
      draw [ultra thick,decorate,decoration=zigzag,pre
      length=3cm,post length=0.85cm,segment length=6] (m_4.north) |- ([yshift=-1.5mm]m_a1.north west) node[midway,above=2mm,xshift=28mm,draw=none]$k_a1$ ;
      draw [ultra thick,decorate,decoration=zigzag,pre
      length=0.8cm,post length=0.65cm,segment length=6] (m_5.north) |- ([yshift=1.5mm]m_a1.south west) node[midway,below=1mm,xshift=9mm,draw=none]$k_a2$ ;

      endtikzpicture

      enddocument





      share|improve this answer






















        up vote
        4
        down vote










        up vote
        4
        down vote









        1. To make adjustments to the positions of the labels you can use xshift and yshift


        2. You can also adjust the coordinates of (m_a1.north west) and (m_a1.south west) using xshift and yshift. These go inside using square brackets, e.g. ([yshift=-1mm]m_a1.north west).


        3. For a Times New Roman style font, I recommend using newtx.


        enter image description here



        documentclass[margin=1cm]standalone
        usepackagetikz
        usepackagenewtxtext,newtxmath
        usetikzlibrarycalc,patterns,decorations.pathmorphing,decorations.markings,positioning

        begindocument
        tikzsetspring/.style=thick,decorate,decoration=zigzag,pre length=0.3cm,post
        length=0.3cm,segment length=6,
        short spring/.style=thick,decorate,decoration=zigzag,pre length=0.05cm,post
        length=0.05cm,segment length=6,
        damper/.style=thick,decoration=markings,
        mark connection node=dmp,
        mark=at position 0.5 with

        node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum
        width=15pt,minimum height=3pt,draw=none] ;
        draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);
        draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);

        , decorate,
        ground/.style=fill,pattern=north east lines,draw=none,minimum
        width=0.75cm,minimum height=0.3cm,
        ground_magenta/.style=fill,pattern=north east lines,pattern color=magenta,draw=none,minimum
        width=0.75cm,minimum height=0.3cm

        begintikzpicture[every node/.style=draw,outer sep=0pt,thick,font=sffamily]

        %ORIGINAL SYSTEM
        node (m_1) [minimum width=1cm,minimum height=0.8cm]$m_1$;
        node (m_2)[right of= m_1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_2$;
        draw [spring] (m_1.east) -- (m_2.west) node[midway,below=1mm,draw=none]$k_12$;
        node (ground1) at (m_1.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
        draw (ground1.south west) -- (ground1.south east);
        draw [thick,decorate,decoration=zigzag,pre
        length=0.1cm,post length=0.85cm,segment length=6] (ground1.south) -| (m_1.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g1$ ;


        node (m_3)[right of= m_2,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_3$;
        draw [spring] (m_2.east) -- (m_3.west) node[midway,below=1mm,draw=none]$k_23$;
        node (ground2) at (m_2.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
        draw (ground2.south west) -- (ground2.south east);
        draw [thick,decorate,decoration=zigzag,pre
        length=0.1cm,post length=0.85cm,segment length=6] (ground2.south) -| (m_2.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g2$ ;

        node (m_4)[right of= m_3,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_4$;
        draw [spring] (m_3.east) -- (m_4.west) node[midway,below=1mm,draw=none]$k_34$;
        node (ground3) at (m_3.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
        draw (ground3.south west) -- (ground3.south east);
        draw [thick,decorate,decoration=zigzag,pre
        length=0.1cm,post length=0.85cm,segment length=6] (ground3.south) -| (m_3.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g3$ ;

        node (m_5)[right of= m_4,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_5$;
        draw [spring] (m_4.east) -- (m_5.west) node[midway,below=1mm,draw=none]$k_45$;
        node (ground4) at (m_4.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
        draw (ground4.south west) -- (ground4.south east);
        draw [thick,decorate,decoration=zigzag,pre
        length=0.1cm,post length=0.85cm,segment length=6] (ground4.south) -| (m_4.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g4$ ;

        node (ground5) at (m_5.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
        draw (ground5.south west) -- (ground5.south east);
        draw [thick,decorate,decoration=zigzag,pre
        length=0.1cm,post length=0.85cm,segment length=6] (ground5.south) -| (m_5.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g5$ ;

        node (m_a1)[right of= m_5,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,yshift=1cm,ultra thick]$m_a1$;
        node (m_a2)[right of= m_a1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,ultra thick]$m_a2$;
        draw [spring,ultra thick] (m_a1.east) -- (m_a2.west) node[midway,below=1mm,draw=none]$k_a3$;
        draw [ultra thick,decorate,decoration=zigzag,pre
        length=3cm,post length=0.85cm,segment length=6] (m_4.north) |- ([yshift=-1.5mm]m_a1.north west) node[midway,above=2mm,xshift=28mm,draw=none]$k_a1$ ;
        draw [ultra thick,decorate,decoration=zigzag,pre
        length=0.8cm,post length=0.65cm,segment length=6] (m_5.north) |- ([yshift=1.5mm]m_a1.south west) node[midway,below=1mm,xshift=9mm,draw=none]$k_a2$ ;

        endtikzpicture

        enddocument





        share|improve this answer












        1. To make adjustments to the positions of the labels you can use xshift and yshift


        2. You can also adjust the coordinates of (m_a1.north west) and (m_a1.south west) using xshift and yshift. These go inside using square brackets, e.g. ([yshift=-1mm]m_a1.north west).


        3. For a Times New Roman style font, I recommend using newtx.


        enter image description here



        documentclass[margin=1cm]standalone
        usepackagetikz
        usepackagenewtxtext,newtxmath
        usetikzlibrarycalc,patterns,decorations.pathmorphing,decorations.markings,positioning

        begindocument
        tikzsetspring/.style=thick,decorate,decoration=zigzag,pre length=0.3cm,post
        length=0.3cm,segment length=6,
        short spring/.style=thick,decorate,decoration=zigzag,pre length=0.05cm,post
        length=0.05cm,segment length=6,
        damper/.style=thick,decoration=markings,
        mark connection node=dmp,
        mark=at position 0.5 with

        node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum
        width=15pt,minimum height=3pt,draw=none] ;
        draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);
        draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);

        , decorate,
        ground/.style=fill,pattern=north east lines,draw=none,minimum
        width=0.75cm,minimum height=0.3cm,
        ground_magenta/.style=fill,pattern=north east lines,pattern color=magenta,draw=none,minimum
        width=0.75cm,minimum height=0.3cm

        begintikzpicture[every node/.style=draw,outer sep=0pt,thick,font=sffamily]

        %ORIGINAL SYSTEM
        node (m_1) [minimum width=1cm,minimum height=0.8cm]$m_1$;
        node (m_2)[right of= m_1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_2$;
        draw [spring] (m_1.east) -- (m_2.west) node[midway,below=1mm,draw=none]$k_12$;
        node (ground1) at (m_1.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
        draw (ground1.south west) -- (ground1.south east);
        draw [thick,decorate,decoration=zigzag,pre
        length=0.1cm,post length=0.85cm,segment length=6] (ground1.south) -| (m_1.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g1$ ;


        node (m_3)[right of= m_2,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_3$;
        draw [spring] (m_2.east) -- (m_3.west) node[midway,below=1mm,draw=none]$k_23$;
        node (ground2) at (m_2.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
        draw (ground2.south west) -- (ground2.south east);
        draw [thick,decorate,decoration=zigzag,pre
        length=0.1cm,post length=0.85cm,segment length=6] (ground2.south) -| (m_2.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g2$ ;

        node (m_4)[right of= m_3,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_4$;
        draw [spring] (m_3.east) -- (m_4.west) node[midway,below=1mm,draw=none]$k_34$;
        node (ground3) at (m_3.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
        draw (ground3.south west) -- (ground3.south east);
        draw [thick,decorate,decoration=zigzag,pre
        length=0.1cm,post length=0.85cm,segment length=6] (ground3.south) -| (m_3.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g3$ ;

        node (m_5)[right of= m_4,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_5$;
        draw [spring] (m_4.east) -- (m_5.west) node[midway,below=1mm,draw=none]$k_45$;
        node (ground4) at (m_4.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
        draw (ground4.south west) -- (ground4.south east);
        draw [thick,decorate,decoration=zigzag,pre
        length=0.1cm,post length=0.85cm,segment length=6] (ground4.south) -| (m_4.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g4$ ;

        node (ground5) at (m_5.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
        draw (ground5.south west) -- (ground5.south east);
        draw [thick,decorate,decoration=zigzag,pre
        length=0.1cm,post length=0.85cm,segment length=6] (ground5.south) -| (m_5.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g5$ ;

        node (m_a1)[right of= m_5,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,yshift=1cm,ultra thick]$m_a1$;
        node (m_a2)[right of= m_a1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,ultra thick]$m_a2$;
        draw [spring,ultra thick] (m_a1.east) -- (m_a2.west) node[midway,below=1mm,draw=none]$k_a3$;
        draw [ultra thick,decorate,decoration=zigzag,pre
        length=3cm,post length=0.85cm,segment length=6] (m_4.north) |- ([yshift=-1.5mm]m_a1.north west) node[midway,above=2mm,xshift=28mm,draw=none]$k_a1$ ;
        draw [ultra thick,decorate,decoration=zigzag,pre
        length=0.8cm,post length=0.65cm,segment length=6] (m_5.north) |- ([yshift=1.5mm]m_a1.south west) node[midway,below=1mm,xshift=9mm,draw=none]$k_a2$ ;

        endtikzpicture

        enddocument






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 1 hour ago









        Milo

        5,74321345




        5,74321345




















            up vote
            4
            down vote













            Slightly different from Milo's nice answer.




            1. midway in conjunction of -| is a bit tricky as this will be the coordinate of the kink. pos=0.75 is in the middle of the vertical stretch and pos=0.25 in the middle of the horizontal one. I thus propose just to play with pos=... instead of adding too many xshifts.


            2. north west corresponds to 135. If you use 145 instead you are slightly below north west.

            3. I am not an expert on fonts, sorry.

            Here's the code.



            documentclassstandalone
            usepackagetikz
            usetikzlibrarycalc,patterns,decorations.pathmorphing,decorations.markings,positioning

            begindocument
            tikzsetspring/.style=thick,decorate,decoration=zigzag,pre length=0.3cm,post
            length=0.3cm,segment length=6,
            short spring/.style=thick,decorate,decoration=zigzag,pre length=0.05cm,post
            length=0.05cm,segment length=6,
            damper/.style=thick,decoration=markings,
            mark connection node=dmp,
            mark=at position 0.5 with

            node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum
            width=15pt,minimum height=3pt,draw=none] ;
            draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);
            draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);

            , decorate,
            ground/.style=fill,pattern=north east lines,draw=none,minimum
            width=0.75cm,minimum height=0.3cm,
            ground_magenta/.style=fill,pattern=north east lines,pattern color=magenta,draw=none,minimum
            width=0.75cm,minimum height=0.3cm

            begintikzpicture[every node/.style=draw,outer sep=0pt,thick,font=sffamily]

            %ORIGINAL SYSTEM
            node (m_1) [minimum width=1cm,minimum height=0.8cm]$m_1$;
            node (m_2)[right of= m_1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_2$;
            draw [spring] (m_1.east) -- (m_2.west) node[midway,below=1mm,draw=none]$k_12$;
            node (ground1) at (m_1.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
            draw (ground1.south west) -- (ground1.south east);
            draw [thick,decorate,decoration=zigzag,pre
            length=0.1cm,post length=0.85cm,segment length=6] (ground1.south) -| (m_1.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g1$ ;


            node (m_3)[right of= m_2,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_3$;
            draw [spring] (m_2.east) -- (m_3.west) node[midway,below=1mm,draw=none]$k_23$;
            node (ground2) at (m_2.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
            draw (ground2.south west) -- (ground2.south east);
            draw [thick,decorate,decoration=zigzag,pre
            length=0.1cm,post length=0.85cm,segment length=6] (ground2.south) -| (m_2.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g2$ ;

            node (m_4)[right of= m_3,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_4$;
            draw [spring] (m_3.east) -- (m_4.west) node[midway,below=1mm,draw=none]$k_34$;
            node (ground3) at (m_3.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
            draw (ground3.south west) -- (ground3.south east);
            draw [thick,decorate,decoration=zigzag,pre
            length=0.1cm,post length=0.85cm,segment length=6] (ground3.south) -|
            (m_3.south) node[midway,below=2pt,xshift=-3mm,draw=none]$k_g3$ ;

            node (m_5)[right of= m_4,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_5$;
            draw [spring] (m_4.east) -- (m_5.west) node[midway,below=2pt,draw=none]$k_45$;
            node (ground4) at (m_4.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
            draw (ground4.south west) -- (ground4.south east);
            draw [thick,decorate,decoration=zigzag,pre
            length=0.1cm,post length=0.85cm,segment length=6] (ground4.south) -|
            (m_4.south) node[midway,below=2pt,xshift=-3mm,draw=none]$k_g4$ ;

            node (ground5) at (m_5.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
            draw (ground5.south west) -- (ground5.south east);
            draw [thick,decorate,decoration=zigzag,pre
            length=0.1cm,post length=0.85cm,segment length=6] (ground5.south) -|
            (m_5.south) node[midway,below=2pt,xshift=-3mm,draw=none]$k_g5$ ;

            node (m_a1)[right of= m_5,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,yshift=1cm,ultra thick]$m_a1$;
            node (m_a2)[right of= m_a1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,ultra thick]$m_a2$;
            draw [spring,ultra thick] (m_a1.east) -- (m_a2.west) node[midway,below=2pt,draw=none]$k_a3$;
            draw [ultra thick,decorate,decoration=zigzag,pre
            length=3cm,post length=0.85cm,segment length=6] (m_4.north) |- (m_a1.145)
            node[pos=0.8,below=2pt,draw=none]$k_a1$ ;
            draw [ultra thick,decorate,decoration=zigzag,pre
            length=0.5cm,post length=0.85cm,segment length=6] (m_5.north) |- (m_a1.215)
            node[pos=0.7,below=2pt,draw=none]$k_a2$ ;

            endtikzpicture

            enddocument


            enter image description here






            share|improve this answer




















            • +1 from me. :-)
              – Milo
              55 mins ago










            • @Milo Thanks. I upvoted your recent answers, too, and of course the one above.
              – marmot
              53 mins ago














            up vote
            4
            down vote













            Slightly different from Milo's nice answer.




            1. midway in conjunction of -| is a bit tricky as this will be the coordinate of the kink. pos=0.75 is in the middle of the vertical stretch and pos=0.25 in the middle of the horizontal one. I thus propose just to play with pos=... instead of adding too many xshifts.


            2. north west corresponds to 135. If you use 145 instead you are slightly below north west.

            3. I am not an expert on fonts, sorry.

            Here's the code.



            documentclassstandalone
            usepackagetikz
            usetikzlibrarycalc,patterns,decorations.pathmorphing,decorations.markings,positioning

            begindocument
            tikzsetspring/.style=thick,decorate,decoration=zigzag,pre length=0.3cm,post
            length=0.3cm,segment length=6,
            short spring/.style=thick,decorate,decoration=zigzag,pre length=0.05cm,post
            length=0.05cm,segment length=6,
            damper/.style=thick,decoration=markings,
            mark connection node=dmp,
            mark=at position 0.5 with

            node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum
            width=15pt,minimum height=3pt,draw=none] ;
            draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);
            draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);

            , decorate,
            ground/.style=fill,pattern=north east lines,draw=none,minimum
            width=0.75cm,minimum height=0.3cm,
            ground_magenta/.style=fill,pattern=north east lines,pattern color=magenta,draw=none,minimum
            width=0.75cm,minimum height=0.3cm

            begintikzpicture[every node/.style=draw,outer sep=0pt,thick,font=sffamily]

            %ORIGINAL SYSTEM
            node (m_1) [minimum width=1cm,minimum height=0.8cm]$m_1$;
            node (m_2)[right of= m_1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_2$;
            draw [spring] (m_1.east) -- (m_2.west) node[midway,below=1mm,draw=none]$k_12$;
            node (ground1) at (m_1.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
            draw (ground1.south west) -- (ground1.south east);
            draw [thick,decorate,decoration=zigzag,pre
            length=0.1cm,post length=0.85cm,segment length=6] (ground1.south) -| (m_1.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g1$ ;


            node (m_3)[right of= m_2,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_3$;
            draw [spring] (m_2.east) -- (m_3.west) node[midway,below=1mm,draw=none]$k_23$;
            node (ground2) at (m_2.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
            draw (ground2.south west) -- (ground2.south east);
            draw [thick,decorate,decoration=zigzag,pre
            length=0.1cm,post length=0.85cm,segment length=6] (ground2.south) -| (m_2.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g2$ ;

            node (m_4)[right of= m_3,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_4$;
            draw [spring] (m_3.east) -- (m_4.west) node[midway,below=1mm,draw=none]$k_34$;
            node (ground3) at (m_3.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
            draw (ground3.south west) -- (ground3.south east);
            draw [thick,decorate,decoration=zigzag,pre
            length=0.1cm,post length=0.85cm,segment length=6] (ground3.south) -|
            (m_3.south) node[midway,below=2pt,xshift=-3mm,draw=none]$k_g3$ ;

            node (m_5)[right of= m_4,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_5$;
            draw [spring] (m_4.east) -- (m_5.west) node[midway,below=2pt,draw=none]$k_45$;
            node (ground4) at (m_4.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
            draw (ground4.south west) -- (ground4.south east);
            draw [thick,decorate,decoration=zigzag,pre
            length=0.1cm,post length=0.85cm,segment length=6] (ground4.south) -|
            (m_4.south) node[midway,below=2pt,xshift=-3mm,draw=none]$k_g4$ ;

            node (ground5) at (m_5.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
            draw (ground5.south west) -- (ground5.south east);
            draw [thick,decorate,decoration=zigzag,pre
            length=0.1cm,post length=0.85cm,segment length=6] (ground5.south) -|
            (m_5.south) node[midway,below=2pt,xshift=-3mm,draw=none]$k_g5$ ;

            node (m_a1)[right of= m_5,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,yshift=1cm,ultra thick]$m_a1$;
            node (m_a2)[right of= m_a1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,ultra thick]$m_a2$;
            draw [spring,ultra thick] (m_a1.east) -- (m_a2.west) node[midway,below=2pt,draw=none]$k_a3$;
            draw [ultra thick,decorate,decoration=zigzag,pre
            length=3cm,post length=0.85cm,segment length=6] (m_4.north) |- (m_a1.145)
            node[pos=0.8,below=2pt,draw=none]$k_a1$ ;
            draw [ultra thick,decorate,decoration=zigzag,pre
            length=0.5cm,post length=0.85cm,segment length=6] (m_5.north) |- (m_a1.215)
            node[pos=0.7,below=2pt,draw=none]$k_a2$ ;

            endtikzpicture

            enddocument


            enter image description here






            share|improve this answer




















            • +1 from me. :-)
              – Milo
              55 mins ago










            • @Milo Thanks. I upvoted your recent answers, too, and of course the one above.
              – marmot
              53 mins ago












            up vote
            4
            down vote










            up vote
            4
            down vote









            Slightly different from Milo's nice answer.




            1. midway in conjunction of -| is a bit tricky as this will be the coordinate of the kink. pos=0.75 is in the middle of the vertical stretch and pos=0.25 in the middle of the horizontal one. I thus propose just to play with pos=... instead of adding too many xshifts.


            2. north west corresponds to 135. If you use 145 instead you are slightly below north west.

            3. I am not an expert on fonts, sorry.

            Here's the code.



            documentclassstandalone
            usepackagetikz
            usetikzlibrarycalc,patterns,decorations.pathmorphing,decorations.markings,positioning

            begindocument
            tikzsetspring/.style=thick,decorate,decoration=zigzag,pre length=0.3cm,post
            length=0.3cm,segment length=6,
            short spring/.style=thick,decorate,decoration=zigzag,pre length=0.05cm,post
            length=0.05cm,segment length=6,
            damper/.style=thick,decoration=markings,
            mark connection node=dmp,
            mark=at position 0.5 with

            node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum
            width=15pt,minimum height=3pt,draw=none] ;
            draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);
            draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);

            , decorate,
            ground/.style=fill,pattern=north east lines,draw=none,minimum
            width=0.75cm,minimum height=0.3cm,
            ground_magenta/.style=fill,pattern=north east lines,pattern color=magenta,draw=none,minimum
            width=0.75cm,minimum height=0.3cm

            begintikzpicture[every node/.style=draw,outer sep=0pt,thick,font=sffamily]

            %ORIGINAL SYSTEM
            node (m_1) [minimum width=1cm,minimum height=0.8cm]$m_1$;
            node (m_2)[right of= m_1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_2$;
            draw [spring] (m_1.east) -- (m_2.west) node[midway,below=1mm,draw=none]$k_12$;
            node (ground1) at (m_1.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
            draw (ground1.south west) -- (ground1.south east);
            draw [thick,decorate,decoration=zigzag,pre
            length=0.1cm,post length=0.85cm,segment length=6] (ground1.south) -| (m_1.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g1$ ;


            node (m_3)[right of= m_2,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_3$;
            draw [spring] (m_2.east) -- (m_3.west) node[midway,below=1mm,draw=none]$k_23$;
            node (ground2) at (m_2.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
            draw (ground2.south west) -- (ground2.south east);
            draw [thick,decorate,decoration=zigzag,pre
            length=0.1cm,post length=0.85cm,segment length=6] (ground2.south) -| (m_2.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g2$ ;

            node (m_4)[right of= m_3,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_4$;
            draw [spring] (m_3.east) -- (m_4.west) node[midway,below=1mm,draw=none]$k_34$;
            node (ground3) at (m_3.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
            draw (ground3.south west) -- (ground3.south east);
            draw [thick,decorate,decoration=zigzag,pre
            length=0.1cm,post length=0.85cm,segment length=6] (ground3.south) -|
            (m_3.south) node[midway,below=2pt,xshift=-3mm,draw=none]$k_g3$ ;

            node (m_5)[right of= m_4,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_5$;
            draw [spring] (m_4.east) -- (m_5.west) node[midway,below=2pt,draw=none]$k_45$;
            node (ground4) at (m_4.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
            draw (ground4.south west) -- (ground4.south east);
            draw [thick,decorate,decoration=zigzag,pre
            length=0.1cm,post length=0.85cm,segment length=6] (ground4.south) -|
            (m_4.south) node[midway,below=2pt,xshift=-3mm,draw=none]$k_g4$ ;

            node (ground5) at (m_5.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
            draw (ground5.south west) -- (ground5.south east);
            draw [thick,decorate,decoration=zigzag,pre
            length=0.1cm,post length=0.85cm,segment length=6] (ground5.south) -|
            (m_5.south) node[midway,below=2pt,xshift=-3mm,draw=none]$k_g5$ ;

            node (m_a1)[right of= m_5,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,yshift=1cm,ultra thick]$m_a1$;
            node (m_a2)[right of= m_a1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,ultra thick]$m_a2$;
            draw [spring,ultra thick] (m_a1.east) -- (m_a2.west) node[midway,below=2pt,draw=none]$k_a3$;
            draw [ultra thick,decorate,decoration=zigzag,pre
            length=3cm,post length=0.85cm,segment length=6] (m_4.north) |- (m_a1.145)
            node[pos=0.8,below=2pt,draw=none]$k_a1$ ;
            draw [ultra thick,decorate,decoration=zigzag,pre
            length=0.5cm,post length=0.85cm,segment length=6] (m_5.north) |- (m_a1.215)
            node[pos=0.7,below=2pt,draw=none]$k_a2$ ;

            endtikzpicture

            enddocument


            enter image description here






            share|improve this answer












            Slightly different from Milo's nice answer.




            1. midway in conjunction of -| is a bit tricky as this will be the coordinate of the kink. pos=0.75 is in the middle of the vertical stretch and pos=0.25 in the middle of the horizontal one. I thus propose just to play with pos=... instead of adding too many xshifts.


            2. north west corresponds to 135. If you use 145 instead you are slightly below north west.

            3. I am not an expert on fonts, sorry.

            Here's the code.



            documentclassstandalone
            usepackagetikz
            usetikzlibrarycalc,patterns,decorations.pathmorphing,decorations.markings,positioning

            begindocument
            tikzsetspring/.style=thick,decorate,decoration=zigzag,pre length=0.3cm,post
            length=0.3cm,segment length=6,
            short spring/.style=thick,decorate,decoration=zigzag,pre length=0.05cm,post
            length=0.05cm,segment length=6,
            damper/.style=thick,decoration=markings,
            mark connection node=dmp,
            mark=at position 0.5 with

            node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum
            width=15pt,minimum height=3pt,draw=none] ;
            draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);
            draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);

            , decorate,
            ground/.style=fill,pattern=north east lines,draw=none,minimum
            width=0.75cm,minimum height=0.3cm,
            ground_magenta/.style=fill,pattern=north east lines,pattern color=magenta,draw=none,minimum
            width=0.75cm,minimum height=0.3cm

            begintikzpicture[every node/.style=draw,outer sep=0pt,thick,font=sffamily]

            %ORIGINAL SYSTEM
            node (m_1) [minimum width=1cm,minimum height=0.8cm]$m_1$;
            node (m_2)[right of= m_1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_2$;
            draw [spring] (m_1.east) -- (m_2.west) node[midway,below=1mm,draw=none]$k_12$;
            node (ground1) at (m_1.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
            draw (ground1.south west) -- (ground1.south east);
            draw [thick,decorate,decoration=zigzag,pre
            length=0.1cm,post length=0.85cm,segment length=6] (ground1.south) -| (m_1.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g1$ ;


            node (m_3)[right of= m_2,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_3$;
            draw [spring] (m_2.east) -- (m_3.west) node[midway,below=1mm,draw=none]$k_23$;
            node (ground2) at (m_2.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
            draw (ground2.south west) -- (ground2.south east);
            draw [thick,decorate,decoration=zigzag,pre
            length=0.1cm,post length=0.85cm,segment length=6] (ground2.south) -| (m_2.south) node[midway,below=1mm,xshift=-3mm,draw=none]$k_g2$ ;

            node (m_4)[right of= m_3,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_4$;
            draw [spring] (m_3.east) -- (m_4.west) node[midway,below=1mm,draw=none]$k_34$;
            node (ground3) at (m_3.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
            draw (ground3.south west) -- (ground3.south east);
            draw [thick,decorate,decoration=zigzag,pre
            length=0.1cm,post length=0.85cm,segment length=6] (ground3.south) -|
            (m_3.south) node[midway,below=2pt,xshift=-3mm,draw=none]$k_g3$ ;

            node (m_5)[right of= m_4,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]$m_5$;
            draw [spring] (m_4.east) -- (m_5.west) node[midway,below=2pt,draw=none]$k_45$;
            node (ground4) at (m_4.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
            draw (ground4.south west) -- (ground4.south east);
            draw [thick,decorate,decoration=zigzag,pre
            length=0.1cm,post length=0.85cm,segment length=6] (ground4.south) -|
            (m_4.south) node[midway,below=2pt,xshift=-3mm,draw=none]$k_g4$ ;

            node (ground5) at (m_5.south west) [ground,yshift=-0.8cm,xshift=-0.5cm,rotate=90,anchor=north] ;
            draw (ground5.south west) -- (ground5.south east);
            draw [thick,decorate,decoration=zigzag,pre
            length=0.1cm,post length=0.85cm,segment length=6] (ground5.south) -|
            (m_5.south) node[midway,below=2pt,xshift=-3mm,draw=none]$k_g5$ ;

            node (m_a1)[right of= m_5,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,yshift=1cm,ultra thick]$m_a1$;
            node (m_a2)[right of= m_a1,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm,ultra thick]$m_a2$;
            draw [spring,ultra thick] (m_a1.east) -- (m_a2.west) node[midway,below=2pt,draw=none]$k_a3$;
            draw [ultra thick,decorate,decoration=zigzag,pre
            length=3cm,post length=0.85cm,segment length=6] (m_4.north) |- (m_a1.145)
            node[pos=0.8,below=2pt,draw=none]$k_a1$ ;
            draw [ultra thick,decorate,decoration=zigzag,pre
            length=0.5cm,post length=0.85cm,segment length=6] (m_5.north) |- (m_a1.215)
            node[pos=0.7,below=2pt,draw=none]$k_a2$ ;

            endtikzpicture

            enddocument


            enter image description here







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 1 hour ago









            marmot

            69.6k476148




            69.6k476148











            • +1 from me. :-)
              – Milo
              55 mins ago










            • @Milo Thanks. I upvoted your recent answers, too, and of course the one above.
              – marmot
              53 mins ago
















            • +1 from me. :-)
              – Milo
              55 mins ago










            • @Milo Thanks. I upvoted your recent answers, too, and of course the one above.
              – marmot
              53 mins ago















            +1 from me. :-)
            – Milo
            55 mins ago




            +1 from me. :-)
            – Milo
            55 mins ago












            @Milo Thanks. I upvoted your recent answers, too, and of course the one above.
            – marmot
            53 mins ago




            @Milo Thanks. I upvoted your recent answers, too, and of course the one above.
            – marmot
            53 mins ago

















             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f457344%2ftikz-mechanical-picture-fix-issues%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            How to decode/decipher Mozilla Firefox proprietary .jsonlz4 format? (sessionstore-backups/recovery.jsonlz4)

            White Anglo-Saxon Protestant

            How to be valuable when automation & IT are stealing my job (and maybe my whole career)? [closed]