I tried to read other topics regarding \newcommand* to create a macros in order to have repeated summations with a single command but I was not able to understand the logic behind it. Let me explain better: I would like to create a \newcommand that simply by typing \repsum{9}{F}{u}, where 9 is the repetition number, can create an output like
F_1u_1+F_2u_2+F_3u_3+...+F_8u_8+F_9u_9.
Can someone help me with this matter? Thank you very much :)
EDIT
Thank you for your answers. I am sorry if I did not post a MWE. The answer provided by current user and zarko does the trick but it uses tikzpicture, while I'd like to use it in Math mode. I'll add an example to show you what I'd like to do (in pseudo code the newcommand)
\documentclass{article}
\newcommand*{\repsum}[3]{
for i=1:#1
if i~=#1
#2_i#3_i+
else
#2_i#3_i
end
end
\begin{document}
The CUF Refined theory expands the summation as
\begin{equation}
u=\repsum{9}{F}{u}=F_\tau u_\tau
\end{equation}
where the last expression exploits the Einstein notation.
\end{document}
\documentclass{...}
and ending with\end{document}
. – albert Sep 5 '18 at 9:56