[pstricks] implicite functions

Herbert Voss Herbert.Voss at alumni.TU-Berlin.DE
Tue Oct 12 17:45:39 CEST 2004


Hi,

I have no idea if this makes sense, because there are too many
different implicit functions where the Steffensen algorithmn
may fail.

However, if someone wants to play araound with the code,
here it is with the example from Arnaud:

(yVal^2-1/yVal)sin^x-const=0

You have to define the function as PostScript procedure /func,
where the x value is given by psplot and yVal is the
iterated y value.


/func {
   /yVal exch def

   ....... the implicit function f(yVal,x)=0

}

and it is called with \psplot as

\psplot{start}{end}{
   startvalue Steffensen
}

if this makes sense, then we can think of an option implicit=true,
to make it easier to handle.


Herbert


\documentclass[12pt]{article}%
\usepackage{pstricks}%
\usepackage{pstricks-add}%
\begin{document}

\begin{pspicture*}(-5,-2.5)(5,2.5)
\psaxes(0,0)(-5,-2.5)(5,2.5)%
\pstVerb{
   /eps1 0.0001 def % x
   /eps2 0.001 def % y
   /MaxIter 10 def
%------------------------ the implicit function -----------------------
   /func {
     /yVal exch def
     yVal dup mul 1.0 yVal div sub x sin dup mul mul const sub
   } def
%------------------------ the implicit function -----------------------
   /Steffensen {
     /y0 exch def % the start value
     /Iter 0 def
     {
       y0 func /F exch def
       F abs eps2 lt { exit } if
       y0 F sub /Phi exch def
       Phi func /F2 exch def
       F2 abs eps2 le { exit }{
         Phi y0 sub dup mul Phi F2 sub 2 Phi mul sub y0 add div /Diff 
exch def
         y0 Diff sub /y0 exch def
         Diff abs eps1 le { exit } if
       } ifelse
       /Iter Iter 1 add def
       Iter MaxIter gt { exit } if
     } loop
     y0
   } def
}
\pscircle(0,0){1}%
\multido{\rA=0.01+0.2}{5}{
   \psplot[linecolor=red,polarplot=true]{1}{179}{
     /const \rA\space def
     .4 Steffensen
   }
   \psplot[linecolor=red,polarplot=true]{181}{359}{
     /const \rA\space def
     .4 Steffensen
   }
}
\end{pspicture*}



\end{document}




-- 
http://TeXnik.de/
http://PSTricks.de/
ftp://ftp.dante.de/tex-archive/info/math/voss/Voss-Mathmode.pdf
http://www.dante.de/faq/de-tex-faq/
http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes




More information about the PSTricks mailing list