Following up on my previous question, I would like to know how I can automatically and robustly create the parallel form of a signal-flow diagram for the following without manual drawing of the lines/nodes:
Consider a transfer function without repeated poles
Each term is a first-order subsystem with R(s) as the input, and the output C(s) can be considered the sum of the three terms
Therefore, this leads to the following desired parallel form of the signal-flow diagram
My questions about my code below are:
1- why doesn't foreach work in my code?
2- How to fine-tune the position of amark labels to make them move away a bit from the curved lines?
3- How can I robustly automate the process of drawing the diagram without the manual drawing of lines/nodes?
4- Is there a more simplified code of the code below using tikz-cd, matrix of nodes, or chains?
\documentclass[tikz,border=5mm]{standalone}
\usetikzlibrary{calc,decorations.markings,positioning,arrows.meta,matrix}
\newif\iflabrev
\begin{document}
\begin{tikzpicture}[
node distance = 15mm and 15mm,
relative = false,
label revd/.is if = labrev,
label revd/.default = true,
amark/.style = {
decoration={
markings,
mark=at position {0.5} with {
\arrow{stealth},
\iflabrev \node[below] {#1};\else \node[above] {#1};\fi
}
},
postaction={decorate}
},
terminal/.style 2 args={draw,alias=ln,circle,inner sep=2pt,label={#1:#2}},
]
\path
node[terminal={left}{$R(s)$}] (R) {}
node[above right=of R, terminal={}{}] (sX-1) {}
node[right=of sX-1, terminal={}{}] (X-1) {}
node[right=of R, terminal={}{}] (sX-2) {}
node[right=of sX-2, terminal={}{}] (X-2) {}
node[right=of X-2, terminal={right}{$C(s)$}] (C) {}
node[below right=of R, terminal={}{}] (sX-3) {}
node[right=of sX-3, terminal={}{}] (X-3) {}
;
%
\foreach \X in {1,...,3}{
(sX-\X) edge[amark=1/s] (X-\X)
};
\path (R) edge[out=90,in=180,amark=12] (sX-1) (X-1) edge[out=-90,in=-90,amark=-2] (sX-1) edge[out=0,in=90,amark=1] (C);
\path (R) edge[amark=-24] (sX-2) (X-2) edge[out=-90,in=-90,amark=-3] (sX-2) edge[amark=1] (C);
\path (R) edge[out=-90,in=180,amark=12,label revd] (sX-3) (X-3) edge[out=-90,in=-90,amark=-4] (sX-3) edge[out=0,in=-90,amark=1,label revd] (C);
\end{tikzpicture}
\end{document}






1on the arrows on the right seem to be redundant, or is there a possibility they change, and if so, how? – Nov 13 '20 at 23:06amarkandamark'are distinguished byedge labelvsedge label', which swaps the position of the edge label. – Nov 14 '20 at 01:19\def\GraphInput{12/-2,-24/-3,12/-4,5/-7}the output looks weird https://i.ibb.co/sy26sNY/image.png instead of being symmetric with two parallel branches on each side of the centerlne connectingR(s)andC(s). Additionally, this\def\GraphInput{12/-2,-24/-3,12/-4,5/-7,3/-3}should have one middle straight (of12/-4) branch with two symmetrical ones on each side not like this https://i.ibb.co/JBgp23K/image.png – Diaa Nov 20 '20 at 00:08dim(which got advertised recently on this site...) but should have checked carefully. Fixed it. – Nov 20 '20 at 00:21-24not overlap the neighbor branch as shown here https://i.ibb.co/Vx2hKJ9/image.png? – Diaa Nov 20 '20 at 17:10ifnum\X=-24then another label option is activated to make separation around the label be reduced or move it closer to its respective branch? – Diaa Nov 20 '20 at 17:21