
In the beginning I use the following code. So far so good.

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{multido}
\usepackage[nomessages]{fp}
\def\LoadConstants{}
\newcommand\const[3][3]{%
\edef\temporary{round(#3}%
\expandafter\FPeval\csname#2\expandafter\endcsname
\expandafter{\temporary:#1)}%
\edef\LoadConstants{\LoadConstants
\noexpand\pstVerb{/#2 \csname#2\endcsname\space def}}%
}
\const[1]{G}{9.8}
\const[1]{Tfinal}{2.0}
\def\y(#1){-G/2*#1^2}
\const[1]{Yfinal}{\y(Tfinal)}
\SpecialCoor
\usepackage{siunitx}
\begin{document}
\begin{pspicture}[showgrid=false](3.5,\Yfinal)
\LoadConstants
\psline(1.5,0)(1.5,\Yfinal)
\multido{\n=0.0+0.5}{5}
{
\const[1]{Yt}{\y(\n)}%
\rput[r](*1.25 {\y(\n)}){$\SI{\Yt}{\meter}$}
\psline(1.4,\Yt)(1.6,\Yt)
\rput[l](*1.75 {\y(\n)}){$t=\SI{\n}{\second}$}
\pscircle*(*3.5 {\y(\n)}){5pt}
}
\end{pspicture}
\end{document}
I changed my mind to use Yt instead of \Yt for the following. Because Yt is in PostScript world, I have to invoke an extra \LoadConstants again (see it in the looping).

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{multido}
\usepackage[nomessages]{fp}
\def\LoadConstants{}
\newcommand\const[3][3]{%
\edef\temporary{round(#3}%
\expandafter\FPeval\csname#2\expandafter\endcsname
\expandafter{\temporary:#1)}%
\edef\LoadConstants{\LoadConstants
\noexpand\pstVerb{/#2 \csname#2\endcsname\space def}}%
}
\const[1]{G}{9.8}
\const[1]{Tfinal}{2.0}
\def\y(#1){-G/2*#1^2}
\const[1]{Yfinal}{\y(Tfinal)}
\SpecialCoor
\usepackage{siunitx}
\begin{document}
\begin{pspicture}[showgrid=false](3.5,\Yfinal)%
\LoadConstants%
\psline(1.5,0)(!1.5 Yfinal)%
\multido{\n=0.0+0.5}{15}%
{%
\const[1]{Yt}{\y(\n)}%
\LoadConstants%This is needed to provide Yt in PostScript world.
\rput[r](*1.25 {\y(\n)}){$\SI{\Yt}{\meter}$}%
\psline(!1.4 Yt)(!1.6 Yt)%
\rput[l](*1.75 {\y(\n)}){$t=\SI{\n}{\second}$}%
\pscircle*(*3.5 {\y(\n)}){5pt}%
}%
\end{pspicture}%
\end{document}
Unfortunately, the vertical line gets shifted to the left. I have tried to find the cause of problem but I give up. You can see I have removed all possible white spaces but the problem still exists.
Could you find the source of problem? It is a hard puzzle!
Edit:
I checked the value of Yt using \psPrintValue and they use , instead of . as the decimal separator. Is it OK?
\documentclass[pstricks,border=12pt]{standalone}
\usepackage{multido}
\usepackage[nomessages]{fp}
%\def\LoadConstants{}
%\newcommand\const[3][3]{%
%\edef\temporary{round(#3}%
%\expandafter\FPeval\csname#2\expandafter\endcsname
%\expandafter{\temporary:#1)}%
%\edef\LoadConstants{\LoadConstants\ignorespaces
%\noexpand\pstVerb{/#2 \csname#2\endcsname\space def}\ignorespaces}\ignorespaces%
%}
\newcommand\const[3][3]{%
\edef\temporary{round(#3}%
\expandafter\FPeval\csname#2\expandafter\endcsname
\expandafter{\temporary:#1)}%
\pstVerb{/#2 \csname#2\endcsname\space def}%
}
\const[1]{G}{9.8}
\const[1]{Tfinal}{2.0}
\def\y(#1){-G/2*#1^2}
\const[1]{Yfinal}{\y(Tfinal)}
\SpecialCoor
\usepackage{siunitx}
\usepackage{pst-tools}
\begin{document}
\begin{pspicture}[showgrid=false](5,\Yfinal)%
%\LoadConstants%
\psline(1.5,0)(!1.5 Yfinal)%
\multido{\n=0.0+0.5}{15}%
{%
\const[1]{Yt}{\y(\n)}%
%\LoadConstants%
\rput[r](*1.25 {\y(\n)}){$\SI{\Yt}{\meter}$}%
\psline(!1.4 Yt)(!1.6 Yt)%
\rput[l](*1.75 {\y(\n)}){$t=\SI{\n}{\second}$}%
\pscircle*(*3.5 {\y(\n)}){5pt}%
\rput(*4 {\y(\n)}){\psPrintValue{Yt}}
}%
\end{pspicture}%
\end{document}

%at the end of line preceding\pstVerb?, there may be a missing\ignorespacesin the code that is revealed through this example... – Werner Apr 08 '13 at 16:52\SI{\Yt}{\meter}-->\SI{\Yt}{\m}and\SI{\n}{\second}-->\SI{\n}{\s}. – Svend Tveskæg Apr 08 '13 at 16:56\pst@killglueafter the\FPevalstatement solves the problem. – Stephan Lehmke Apr 08 '13 at 21:55