[pstricks] \psplotDiffEqn (pstricks-add)

Dominique RODRIGUEZ dominique.rodriguez at waika9.com
Wed Jun 3 14:56:20 CEST 2009


Hello,

>  I want to translate the set of differential equations of the 'spiral of
>  cornu' example from the pstricks-add manual, Section 36.2 from algebraic
>  into Postscript syntax.

You are quite malicious ! I wrote the ps to alg translator to easyly describe the
description using the natural algebraic notation !

>  >From the Postscript reference I know that the sin and cos operators
>  want angles in degrees as their argument. Hence, I have to multiply the
>  arguments of sin and cos, as given in Eqs. (4) and (5) on Page 170 of
>  pstricks-add-doc.pdf, by 180/Pi which led me to the following formulation:
>
>  \documentclass{article}
>  \usepackage{pstricks-add}
>
>  \begin{document}
>  \psset{unit=8}
>   \begin{pspicture}(1,1)\psgrid[subgriddiv=5]
>   \psplotDiffEqn[
>     whichabs=0,whichord=1,linecolor=red,method=rk4,
>  %   algebraic=true,
>     plotpoints=500,showpoints=true
>   ]{0}{10}{0 0}{
>  %   %algebraic
>  %   cos(Pi*x^2/2)|sin(Pi*x^2/2)
>     %Postscript

Here add :  pop pop

>     x dup mul 2 div 180 mul cos %% dx/dt
>     x dup mul 2 div 180 mul sin %% dy/dt
>   }
>   \end{pspicture}
>  \end{document}

The solver calls the function description with the vector on the stack : x y,
and the description leave dx dy at the end, if you don't use x and y just drop them.

Bye
Dominique
-- 
  Les Galinières - 07460 St André de C. FRANCE-- tel: (+33)475.39.05.82



More information about the PSTricks mailing list