3
\documentclass[a4paper, 12pt]{report}

\usepackage{tikz}
\usetikzlibrary{arrows.meta, chains, positioning, shapes.geometric, shapes.multipart }
\tikzstyle{rect} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=white]
\tikzstyle{arrow} = [thick,->,>=stealth]
\usetikzlibrary{shapes.multipart}
\usepackage{float}

\begin{document}

\begin{figure}[H]
    \centering
    \begin{tikzpicture}[node distance=2.5cm]
        \node (one) [rect] {Input excitation $p_{i+1}$ };
        \node (two) [rect, below of=one, align = center] {Calculate displacement response: \\  $x_{i+1} = x_{i} + \Delta t \mathit{x1}_{i} +  \frac{\Delta t^2}{2} \mathit{x2}_{i}$ };
        \node(three)[rect, below of=two]{Impose $x_{i+1}$ on test structure};
        \node(four)[rect, below of=three]{Measure restoring forces from $\mathit{fs}_{i+1}$ from the test  structure}; 
        \node(five)[rect, below of=four, align = center]{Calculate: \\  $\mathit{x2}_{i+1} = \left[m + \frac{\mathit{\Delta t}}{2} c\right]^{-1} \left[p_{i+1} - \mathit{fs}_{i+1} - c \mathit{x1}_{i} - \frac{\mathit{\Delta t}}{2} c \mathit{x2}_{i}\right]$ \\ $  \mathit{x1}_{i+1} = \mathit{x1}_{i} + \frac{\mathit{\Delta t}}{2}\left(\mathit{x2}_{i} + \mathit{x2}_{i+1}\right) $};
        \node(six)[rect, below of=five]{set $i = i+1$};
        \draw [arrow] (one) -- (two);
        \draw [arrow] (two) -- (three);
        \draw [arrow] (three) -- (four);
        \draw [arrow] (four) -- (five);
        \draw [arrow] (five) -- (six);
        \draw [arrow] (six.east) -- ++(4, 0) --  ++ (0, 12.5) -- (one) ;
    \end{tikzpicture}
    \caption{Newmark Explicit Scheme flowchart}
\end{figure}

\end{document}
4
  • \tikzstyle{arrow} = [thick,->,-{Stealth[length=3mm,width=3mm]}]
    – user31034
    Jun 13, 2019 at 19:20
  • I wanted all the arrow sizes to be of same length. This did not change my flowchart. Jun 13, 2019 at 19:46
  • This setting makes all the arrow size same. Did you see the marmot's answer?
    – user31034
    Jun 13, 2019 at 19:49
  • The arrows are of different length between the boxes. I want those arrows length to be same. Jun 13, 2019 at 20:09

1 Answer 1

3

There are many ways to improve this. And, as ferahfeza writes in the comment, you can use arrows.meta that you are loading (but I would not use \tikzstyle). The following simplifies the diagram and makes some things more automatic.

\documentclass[a4paper, 12pt]{report}
%\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,positioning}
\tikzset{rect/.style={rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=white},
arrow/.style={thick,-{Stealth[length=7pt]}}}
\usetikzlibrary{shapes.multipart}
\usepackage{float}

\begin{document}

\begin{figure}[H]
    \centering
    \begin{tikzpicture}
      \begin{scope}[local bounding box=nodes,node distance=2.5cm]
        \node (one) [rect] {Input excitation $p_{i+1}$ };
        \node (two) [rect, below of=one, align = center] {Calculate displacement response: \\  $\displaystyle x_{i+1} = x_{i} + \Delta t \mathit{x1}_{i} +  
        \frac{\Delta t^2}{2} \mathit{x2}_{i}$ };
        \node(three)[rect, below of=two]{Impose $x_{i+1}$ on test structure};
        \node(four)[rect, below of=three]{Measure restoring forces from $\mathit{fs}_{i+1}$ from the test  structure}; 
        \node(five)[rect, below of=four, align = center]{Calculate: \\  $\mathit{x2}_{i+1} = \left[m + \frac{\mathit{\Delta t}}{2} c\right]^{-1} \left[p_{i+1} - \mathit{fs}_{i+1} - c \mathit{x1}_{i} - \frac{\mathit{\Delta t}}{2} c \mathit{x2}_{i}\right]$ \\ $  \mathit{x1}_{i+1} = \mathit{x1}_{i} + \frac{\mathit{\Delta t}}{2}\left(\mathit{x2}_{i} + \mathit{x2}_{i+1}\right) $};
        \node(six)[rect, below of=five]{set $i = i+1$};
     \end{scope} 
     \foreach \X [remember=\X as \Y (initially one)]in {two,three,four,five,six}  
     {\draw [arrow] (\Y) -- (\X);}
     \draw [arrow] (six.east) -| ([xshift=2em]nodes.east) |- (one) ;
    \end{tikzpicture}
    \caption{Newmark Explicit Scheme Flowchart.}
\end{figure}

\end{document}

enter image description here

You must log in to answer this question.

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