[Tex/LaTex] PS-Tricks error Undefined control sequence. [\psline{->}]

pstricks

I get the error

Undefined control sequence. [\psline{->}]

when i try to run the code

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-all}
\usepackage{mathtools}
\begin{document}
\begin{pspicture}[showgrid=false](20,10)
\psline{->}(0,0)(20,0)
\psline{->}(0,0)(0,10)
\psplot{12.879}{17.121}{9-2*(15-x)^2} %Curve 2 
\psplot{0.757359}{9.24264}{9-0.5*(5-x)^2}%curve 1
\psline[linestyle=dotted]{}(5,0)(5,9)% Optimum curve 1 
\psline[linestyle=dotted]{}(15,0)(15,9) % Optimum curve 2
\psline[linestyle=dotted]{}(13.5,0)(13.5,4.5) % change in curve 2
\psline[linestyle=dotted]{}(0,4.5)(13.5,4.5) % lower horizontal line
\psline[linestyle=dotted]{}(3.5,0)(3.5,7.875) % change in curve 2
\psline[linestyle=dotted]{}(0,7.875)(3.5,7.875) %upper horizontal line

\psline[]{|-|}(3.5,2)(5,2)
\psline[]{|-|}(13.5,2)(15,2)
\psline[]{|-|}(2,4.5)(2,7.875)

\uput[45](4.8,-0.5){$t_1^*$}
\uput[45](3.3,-0.5){$t_1$}
\uput[45](14.8,-0.5){$t_2$}
\uput[45](13.3,-0.5){$t_2$}
\uput[45](4,2.2){$t'$}
\uput[45](14,2.2){$t'$}
\uput[45](0.5,5.8){$u_1\ge u_2$}
\uput[45](-0.5,4.2){$u_2$}
\uput[45](-0.5,7.6){$u_1$}
\end{pspicture}
\end{document}

Best Answer

The algebraic option is missing:

\psplot[algebraic]{12.879}{17.121}{9-2*(15-x)^2} %Curve 2 
\psplot[algebraic]{0.757359}{9.24264}{9-0.5*(5-x)^2}%curve 1
Related Question