[pstricks] A little bit more complicated function definition fails again. Was: Can't use a mathematical function defined with FPeval in \psplot

Juergen Rose rose at rz.uni-potsdam.de
Tue Apr 15 16:05:33 CEST 2014


Am Dienstag, den 15.04.2014, 14:38 +0200 schrieb Herbert Voss:
> Am 15.04.2014 14:01, schrieb Juergen Rose:
> 
> > But if I remove the fixed value for myMathFuncTwo{3.5} an try to use the
> > calculated value FPeval\myMathFuncTwo{\myMathFunction{2}{(\Vre{})}}:
> >
> > \documentclass{article}
> >
> > \usepackage[nomessages]{fp}
> > \usepackage{pst-plot}
> >
> > \def\Vre{350}
> >
> > \begin{document}
> >
> > \edef\nonr#1#2{2*((#2)/2)^(1/3)/((2)^0.5*(#1))+(6)^0.5/2-1}
> > \def\myMathFunction#1#2{(\nonr{(#1)}{(#2)}) * 5 - (\nonr{(#1)}{(#2)})^2}
> 
> 
> \documentclass{article}
> \usepackage[nomessages]{fp}
> \usepackage{pst-plot}
> \def\Vre{350}
> 
> \begin{document}
> 
> \edef\nonr#1#2{2*((#2)/2)^(1/3)/((2)^0.5*(#1))+(6)^0.5/2-1}
> \edef\myMathFunction#1#2{(\nonr{#1}{#2}) * 5 - (\nonr{#1}{#2})^2}
> 
> \FPeval\myMathFuncTwo{\myMathFunction{2}{(\Vre)}}
> 
> \pspicture[shift=*](-1,0)(15,7)
> \psaxes{->}(14.5,7.5)
> \psline[linecolor=red](0,0.5)(2,0.5)
> \psline[linecolor=red](2,0.5)(2,\myMathFuncTwo)
> \psplot[algebraic,linecolor=red,linewidth=1.5pt]{2}{5}{%
>   \myMathFunction{x}{\Vre}%
> }
> \psplot[algebraic,linecolor=red,linewidth=1.5pt]{5}{14}{%
>   \myMathFunction{x}{\Vre}%
> }
> \endpspicture
> \end{document}
> 
> Herbert

Thanks, it works. I hope, that I can handle \newcommand, \edef and \dev
anytime without problems.

Regards Juergen





More information about the PSTricks mailing list