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

Herbert Voss Herbert.Voss at FU-Berlin.DE
Tue Apr 15 11:15:00 CEST 2014


Am 14.04.2014 07:52, schrieb Juergen Rose:
>> \documentclass{article}
>>
>> \usepackage[nomessages]{fp}
>> \usepackage{pst-plot}
>>
>> \def\Vre{700}
>>
>> \begin{document}
>>
>> \def\myMathFunction#1{
>>    \def\nonr##1{1000*(\Vre/2)^(1/3)/((2)^0.5*(##1))+(6)^0.5/2-1}
>>    (\nont{(#1)}) * 5 - (\nonr{(#1)})^2
>> }

it makes no sense to define a function inside a PostScript
context. Use

usepackage[nomessages]{fp}
\usepackage{pst-plot}
\def\Vre{700}

\begin{document}

\edef\nonr#1{1000*(\Vre/2)^(1/3)/((2)^0.5*(#1))+(6)^0.5/2-1}
\def\myMathFunction#1{(\nonr{(#1)}) * 5 - (\nonr{(#1)})^2}

\pspicture[shift=*](-1,0)(6,7)
\psaxes{->}(5.5,6)
\psplot[algebraic,linecolor=red,linewidth=1.5pt]{1}{5}{%
  \myMathFunction{x}%
}
\endpspicture
\end{document}

Herbert




More information about the PSTricks mailing list