0

I am new to LaTeX. I have researched how to draw diagrams and found that TikZ could help. Please could someone give me a direction with the below image...

My document uses the article class of and it is really simple. Hope someone can help.

1
  • Welcome! This question seems to be identical, or at least very similar, to one that was posted some hours ago, and deleted. While many users here can produce such diagrams, the purpose of this site is to exchange more abstract information that is useful to many users.
    – user194703
    Mar 23, 2020 at 23:18

1 Answer 1

1

What you are asking here can be found scattered over some posts here. Some suggestions:

  • It might be advantageous to store some of the parameters in TikZ functions via declare function.
  • You can switch between sharp and rounded corners along a path. To make this a bit more practical you can define short cuts like sc and rc in the below code.
  • For the random shape you may use the random steps decoration.

Other than that it is mostly tedious to produce the desired output.

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}[declare function={L=3;t=0.8;d=3;r=0.4;P=4;},
    rc/.style={rounded corners=r*1cm},sc/.style={sharp corners},
    >=stealth]
 \draw[semithick] (0,0) coordinate (start)-- ++ (0,d) foreach \X [count=\Y] in 
  {0.1,0.1+0.8/3,0.1+1.6/3,0.9} {coordinate[pos=\X] (auxL\Y) 
    } [rc] -- ++ (P,0) [sc] -- ++ (0,t)  coordinate (p1)
  --++ (L,0) coordinate[pos=0.4] (p2) coordinate (p3) [rc] -- ++ (0,-t) [sc] 
  -- ++ (P,0)   coordinate[pos=0.3] (p4) coordinate[pos=0.4] (p5)  coordinate (p6)
   -- ++ (0,-d)  coordinate (p7)
  foreach \X [count=\Y] in 
  {0,1/3,2/3,1} {coordinate[pos=\X] (auxR\Y) 
    }
  [rc] -- ++(-P,0)[sc] --++ (0,-t) coordinate (p8)
  -- ++(-L,0) [rc] --++(0,t) coordinate (p12) [sc] -- cycle
  ([xshift=0.6cm]auxR2) node[right]{$S$}
  foreach \Y in {1,...,4}
  {(auxR\Y) edge[->,shorten <=2pt] ++ (0.6,0)
  (auxL\Y) node[left,circle,draw,inner sep=2pt](c\Y) {}};
 \draw ([yshift=2mm]p1) -- coordinate (p9) ++ (0,0.8) ([yshift=2mm]p3) -- ++ (0,0.8)
    ([xshift=2mm]p3) -- ++ (0.8,0) coordinate[pos=0.8] (p10)
    ([xshift=2mm]p8) -- ++ (0.8,0) coordinate[pos=0.8] (p11);
 \draw[<->] (p2) -- node[fill=white]{$H$} (p2|-p8); 
 \draw[<->] (p9) -- node[fill=white]{$L$} (p3|-p9); 
 \draw[<->] (p10) -- node[fill=white]{$t$} (p10|-p6); 
 \draw[<->] (p11) -- node[fill=white]{$t$} (p11|-p7); 
 \draw[<->] (p5) -- node[fill=white]{$d$} (p5|-p7); 
 \draw[<-] (p12) ++ (45:r) ++ (-r,-r) -- ++ (-135:0.5) node[below left] {$r$};
 \fill[decorate,decoration={random steps,segment length=pi*1pt},gray!50] 
 (c1.west|-start) to[bend left] ++ (0,d);
 \draw (c1.west|-start) -- ++ (0,d);
\end{tikzpicture}
\end{document}

enter image description here

I hope that this gives you a start and some of the information to draw the graphs you need.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .