If you wish Y1 and Y2 to be constants, you can use \pgfmathdeclarefunction for declaring them as functions that don't process any arguments and just deliver the constant's value.
In the example below I used \pgfkeys for defining macros \DeclareConstant and \DeclareConstants .
\DeclareConstant{⟨name of constant⟩}{⟨value of constant⟩} is used for declaring a single constant.
Several constants can be declared via \DeclareConstants:
\DeclareConstants processes a comma-separated list of ⟨name of constant⟩=⟨value of constant⟩-pairs:
\DeclareConstants{
⟨name of constant 1⟩=⟨value of constant 1⟩,
⟨name of constant 2⟩=⟨value of constant 2⟩,
...
⟨name of constant k⟩=⟨value of constant k⟩,
}
In case the value of a constant itself contains a comma, e.g., as separator of arguments/operands of another pgfmath-function, that value can/needs to be nested in curly braces:
⟨name of constant 2⟩={⟨value of constant 2⟩},
foobar={mod(-100,30)},
(The constant foobar will have the value -10. The tokens following = are passed to \pgfmathparse in the course of assigning the value and the tokens that result from the \pgfmathparse-calculations form what is delivered as value of the constant. This way calculations are not repeated whenever the constant in question is used.)
!!!!! Be aware that with \DeclareConstant and \DeclareConstants you can easily override already existing pgfmath-functions. !!!!!
So please don't declare a constant sin or cos or the like. ;-)
Section "97 Customizing the mathematical engine" of pgfmanual.pdf, the manual for TikZ and pgf, says about names of functions:
The name of the function can consist of, uppercase or lowercase letters, numbers or the underscore _. In line with many programming languages,
a function name cannot begin with a number or contain any spaces.
(The spurious comma right behind the phrase "can consist of" is in the manual—I did not remove it for the sake of citing exactly.)
So you can, e.g., define a constant/function Y1, but you cannot define a constant/function 1Y.
\documentclass{article}
\usepackage{amsmath}
\usepackage{stanli}
\newcommand\DeclareConstant[2]{%
\pgfkeys{/MyStuff/declare constant={#1}{#2}}%
}%
\newcommand\DeclareConstants[1]{\pgfkeys{/MyStuff/.cd,#1,}}%
\newcommand\exchangeargs[2]{#2#1}%
\makeatletter
\pgfkeys{%
/MyStuff/.unknown/.code=\pgfkeys{/MyStuff/declare constant={\pgfkeyscurrentname}{#1}},
/MyStuff/declare constant/.code 2 args=%
\begingroup
\pgfmathparse{#2}%
\ifcat$\detokenize{#1}$\expandafter@firstoftwo\else\expandafter@secondoftwo\fi
{%
\GenericError{\space\space@spaces@spaces@spaces@spaces@spaces@spaces@spaces}%
{Constant declaration error: Name of constant not specified}%
{\space\space@spaces@spaces@spaces@spaces@spaces@spaces@spaces You cannot declare a constant without\MessageBreak specifying its name.}%
{You need some sort of identifier for referencing the constant.}%
\ifcat$\detokenize\expandafter{\pgfmathresult}$\expandafter@firstofone\else\expandafter@gobble\fi
{%
\GenericError{\space\space@spaces@spaces@spaces@spaces@spaces@spaces@spaces}%
{Constant declaration error: Value of constant not specified}%
{\space\space@spaces@spaces@spaces@spaces@spaces@spaces@spaces You cannot declare a constant without\MessageBreak specifying its value.}%
{Which aspect of a constant could be constant if not its value?\MessageBreak So there must be a value!}%
}%
\endgroup
}{%
\ifcat$\detokenize\expandafter{\pgfmathresult}$\expandafter@firstoftwo\else\expandafter@secondoftwo\fi
{%
\GenericError{\space\space@spaces@spaces@spaces@spaces@spaces@spaces@spaces}%
{Constant declaration error: Value of constant not specified}%
{\space\space@spaces@spaces@spaces@spaces@spaces@spaces@spaces You cannot declare a constant without\MessageBreak specifying its value.}%
{Which aspect of a constant could be constant if not its value?\MessageBreak So there must be a value!}%
\endgroup
}{%
\expandafter\endgroup
\expandafter\exchangeargs\expandafter{\expandafter{%
\expandafter\def
\expandafter\pgfmathresult
\expandafter{\pgfmathresult}%
}}{\pgfmathdeclarefunction*{#1}{0}}%
}%
},%
/MyStuff/declare constant/.value required,%
}%
\makeatother
\begin{document}
\begin{center}
\begin{tikzpicture}
% \DeclareConstant{Y1}{-3-3};
% \DeclareConstant{Y2}{-14};
\DeclareConstants{
Y1=-3-1-2, % yields Y1=-6
Y2={mod(-114,-100)}, % yields Y2=-14
% Y3=...,
% Y4=...,
% foobar=...,
% ...
};
\drawhelp lines,step=0.5 grid(15,24);
%%%%%%%%%%%%%%%%%%%%%%%%Loading%%%%%%%%%%%%%%%%
\point{a-LD}{0}{22.5};
\point{b-LD}{10}{22.5};
\point{su-LD}{2}{22.5+1.5};
\point{s-LD}{2}{22.5};
\point{sl-LD}{2}{22.5-0.5};
\point{TL-LD}{10}{22.5+2};
\point{CAP-LD}{10/2}{22.5-2.5};
% Elements
\beam{4}{a-LD}{b-LD};
%Supports
\support {1}{a-LD};
\support {2}{b-LD};
%Loads
\lineload{1}{a-LD}{b-LD}[0][2][0.035]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%First diagram%%%%%%%%%%%%%%%%%%
\point{a-FBD}{0}{22.5+Y1};
\point{b-FBD}{10}{22.5+Y1};
\point{TL-FBD}{210/3}{22.5+Y1};
\point{TLA-FBD}{210/3}{22.5+Y1+1.75};
\point{HR}{0-1.5}{22.5+Y1};
\point{VRA}{0}{22.5+Y1-1};
\point{VRB}{10}{22.5+Y1-1};
\point{CAP-FBD}{10/2}{22.5+Y1-3.5};
% Elements
\beam{4}{a-FBD}{b-FBD};
%%%%%%%%%%%%%%%%%Second diagram%%%%%%%%%%%%%%%%%%
\internalforces{a-FBD}{b-FBD}{-3}{6}[0][red]%[0]
\point{a-SFD}{0}{22.5+Y2};
\point{b-SFD}{10}{22.5+Y2};
\point{TL-SFD}{210/3}{22.5+Y2};
\point{TLA-SFD}{210/3}{22.5+Y2+1.75};
\point{VRA}{0}{22.5+Y2-1};
\point{VRB}{10}{22.5+Y2-1};
\point{CAP-SFD}{10/2}{22.5+Y2-3.5};
% Elements
\beam{4}{a-SFD}{b-SFD};
\internalforces{a-SFD}{b-SFD}{-3}{6}[3][red]%[0]
\end{tikzpicture}
\end{center}
\end{document}

\DeclareConstants{foo={mod(-100,30)}, bar=20, baz=2.5}As decimal-separator you always use the dot.The constant/functionfoowill be defined to deliver the value-10,barwill deliver20,bazwill deliver2.5. – Ulrich Diez Oct 24 '20 at 20:48