Place labels at the end of arrows and how to break lines inside TikZ nodes

tikz-pgf

I'm trying to replicate this block diagram but I'm having trouble with certain details. This is the block diagram that I'm trying to replicate:

enter image description here

This is what I have:

enter image description here

I just need help in with the letters in the blocks I can't manage to put one word under another, also I want to make the arrows line and head a little more bold and thick and finally I need to find a way to write something at the right side of the arrows.

Here is the code for the second figure:

\documentclass{beamer} 
\usetheme{Boadilla}
\usepackage[utf8]{inputenc} 
\usepackage{tikz}  
\usepackage{mathtools} 
\usetikzlibrary{shapes,arrows} 
\usepackage{subfig} 
\usepackage{babel,blindtext} 
\usepackage{subcaption}

\usefonttheme{professionalfonts} % using non standard fonts for beamer
\usefonttheme{serif} % default family is serif

% \title{Ejemplo de Diseño de un Controlador}
\author{Julio Ortegón} 
% \institute{Universidad de los Andes} 
\date{}
\begin{document}

\maketitle

\begin{frame}{}

\centering

\bigskip 
\bigskip
    
\tikzstyle{block} = [draw, fill=white, rectangle, 
    minimum height=3em, minimum width=6em   ]
\tikzstyle{Fi} = [coordinate]
\tikzstyle{Rd} = [coordinate] 
\tikzstyle{Qd} = [coordinate]  
\tikzstyle{Qa} = [coordinate] 
\tikzstyle{Wd} = [coordinate] 
\tikzstyle{QCHP} = [coordinate]  
\tikzstyle{aRQ} = [coordinate] 
\tikzstyle{pinstyle} = [pin edge={to-,ultra thick,black}] 

\begin{tikzpicture}[auto, node distance=2cm,>=latex']
%Declara los nodos
\node [Fi, name=Fi] {}; 
\node [block, right of=Fi] (CHP) {\textbf{CHP} $n_W,n_Q$ };  
\node [QCHP, name =QCHP, right of=CHP,node distance = 2.5 cm] {}; 
\node [Qa,name=Qa, right of=QCHP, node distance = 2.5cm,label={right:$Q_a$}] {};
\node[aRQ,name=aRQ,above of=Qa, node distance = 1.5cm]{}; 
\node [block, right of=aRQ,node distance = 1.2cm] (WARG) {\textbf{WARG} };   
\node[Rd,name=Rd, right of=WARG, node distance = 2cm,label={right:$R_d$}] {};  
\node[Qd,name=Qd,below of=Qa,node distance = 1.5cm, right = 3.25cm,label={right:$Q_d$}]{};  
\node[Wd,name=Wd,below of=Qd,node distance = 1.5cm, right = 0.1cm,label={right:$W_d$}]{}; 

% \draw [->] (Controller1) -- node[name= ] {$ $} (system);
% \node [output, right of=system] (output) {};
% \node [block, below = 2 cm, right = 4cm] (Controller2) {$1+sK_h$}; 

%Ahora conectamos los bloques 

\draw [draw,->] (Fi) -- node {$F_i$} (CHP); 
\draw [->] (CHP) -- node {$Q^{\text{CHP}}$} (QCHP);  
\draw [->] (QCHP) -- node {$\alpha^{\text{CHP}}_{\text{aQ}}Q^{\text{CHP}}$} (Qa);   
\draw [->] (QCHP) |- node {$\qquad\qquad\qquad\;\; \alpha^{\text{CHP}}_{\text{RQ}}Q^{\text{CHP}}$} (aRQ);   
\draw [->] (WARG) -- node {} (Rd); 
\draw [->] (QCHP) |- node {$\qquad\qquad\qquad\;\; \alpha^{\text{CHP}}_{\text{QQ}}Q^{\text{CHP}}$} (Qd); 
\draw [->] (CHP) |- node {$\qquad\qquad\qquad\qquad\qquad\; W^{\text{CHP}}$} (Wd);


\end{tikzpicture}
\end{frame} 

 
\end{document}

I appreciate the help.

Best Answer

I would suggest a few improvements of your code.

First, I would use \tikzset instead of \tikzstyle, since it is much easier to define multiple styles this way.

Second, instead of using empty nodes that you style as coordinates, you can directly define \coordinates at a certain position and name them using (name). This naming technique also works with nodes.

Then, in order to later easier place the label nodes, I added two helper coordinates. I also adjusted the alignments of the WARG and the Wd nodes.

You can align nodes on paths using the pos, above, below, right or left options and by placing them at the right position in the path: If you place the node last, it will be put at the end of the path. You can place multiple nodes on one path.

To have a line break inside a node, you need to set its alignment using the align option. Then you can use \\ to insert a forced line break.

\documentclass[border=1mm, tikz]{standalone}
\usetikzlibrary{shapes,arrows} 

\usepackage{amsmath}

\begin{document}

\tikzset{
    block/.style={draw, fill=white, rectangle, 
    minimum height=3em, minimum width=6em},
    every path/.style={very thick},
}

\begin{tikzpicture}[auto, node distance=2cm, >=latex']
%Declara los nodos
\coordinate (Fi) at (0,0); 
\node [block, right of=Fi, align=center] (CHP) {\textbf{CHP} \\ $n_W,n_Q$};  
\coordinate [right of=CHP, node distance=2.5cm] (QCHP); 
\coordinate [right of=QCHP, node distance=2.5cm] (Qa);  
\coordinate [above of=Qa, node distance=1.5cm] (aRQ); 
\node [block, anchor=west] at (aRQ) (WARG) {\textbf{WARG}};   
\coordinate [right of=WARG, node distance=2cm] (Rd);  
\coordinate [below of=Qa, node distance=1.5cm, right=3.25cm] (Qd);  
\coordinate [below of=Qd, node distance=1.5cm] (Wd); 

\coordinate [below of=Qa, node distance=1.5cm] (helper 1);
\coordinate [below of=QCHP, node distance=3cm] (helper 2);

%Ahora conectamos los bloques 

\draw [->] (Fi) -- node {$F_i$} (CHP); 
\draw [->] (CHP) -- (QCHP) node[above, xshift=-20pt] {$Q^{\text{CHP}}$};  
\draw [->] (QCHP) -- (Qa) node[above, xshift=-30pt] {$\alpha^{\text{CHP}}_{\text{aQ}}Q^{\text{CHP}}$} node[right] {$Q_a$};   
\draw [->] (QCHP) |- (aRQ) node[above, xshift=-30pt] {$\alpha^{\text{CHP}}_{\text{RQ}}Q^{\text{CHP}}$};   
\draw [->] (WARG) -- (Rd) node[right] {$R_d$};
\draw [->] (QCHP) |- (helper 1) node[above, xshift=-30pt] {$\alpha^{\text{CHP}}_{\text{QQ}}Q^{\text{CHP}}$} -- (Qd) node[right] {$Q_d$};
\draw [->] (CHP) |- (helper 2) node[above, xshift=-20pt] {$W^{\text{CHP}}$} -- (Wd) node[right] {$W_d$};


\end{tikzpicture}

\end{document}

enter image description here