[pstricks] psNewton

Markus Krebs markuskrebs at web.de
Wed Apr 13 17:09:02 CEST 2011


Dear Herbert!

Am 13.04.2011 12:05, schrieb Herbert Voss:
> Am 13.04.2011 08:18, schrieb Markus Krebs:
>
>> It may be useful for teaching to have a psNewton-macro
>
> Oh, there are a lot of useful things in the life :-)
Yes, indeed. You are part of these "things"! Thank's for your help! But ..
>
> With the pst-plot from
> http://texnik.dante.de/tex/generic/pst-plot/
> you can use:
I've tried.
>
> \documentclass{article}
> \usepackage{pst-plot}
> \begin{document}
>
> \def\f{-(1/192)*x^3-(1/12)*x-(1/192)*Pi*x^2-(1/12)*Pi+2}
> \def\fDerive{-(3/192)*x^2-(1/12)-(2/192)*Pi*x}
>
> \psset{plotpoints=2000,unit=0.5,algebraic}
> \begin{pspicture*}[showgrid](-20,-10)(8,20)
> \psaxes[Dx=6,Dy=4]{->}(0,0)(-20,-10)(8,20)[$x$,270][$y$,0]
> \psplot[algebraic,linewidth=2pt,linecolor=blue]{-20}{10}{\f}
> \psxTick(-15){x_0}
> \psNewton[linecolor=red,linewidth=0.5pt,showDerivation=false]{-15}{\f}{10} 
>
> %
> %-15, -9.567466932, -4.903526029, 3.026073041, 6.688396612, 
> 5.580230655 (Made by Maple)
> \end{pspicture*}
>
> \begin{pspicture*}[showgrid](-20,-10)(8,20)
> \psaxes[Dx=6,Dy=4]{->}(0,0)(-20,-10)(8,20)[$x$,270][$y$,0]
> \psplot[algebraic,linewidth=2pt,linecolor=blue]{-20}{10}{\f}
> \psxTick(-15){x_0}
> \psNewton[linecolor=red,linewidth=0.5pt,showpoints]{-15}{\f}[\fDerive]{10} 
>
> \end{pspicture*}
>
> \end{document}
>
>
> \psNewton{xStart}{Func}[f-Derivation]{steps}
>
> Without the optional [f-Derivation] it uses an epsilon of 0.01
> for the derivation
  *File List*
  article.cls    2007/10/19 v1.4h Standard LaTeX document class
   size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
pst-plot.sty    2010/01/22 package wrapper for pst-plot.tex
pstricks.sty    2011/03/27 v0.49 LaTeX wrapper for `PSTricks' (RN,HV)
    ifpdf.sty    2010/01/28 v2.1 Provides the ifpdf switch (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
pstricks.tex    2011/03/25 v2.19 `PSTricks' (tvz,hv)
pst-xkey.tex    2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
  xkeyval.sty    2008/08/13 v2.6a package option processing (HA)
  xkeyval.tex    2008/08/13 v2.6a key=value parser (HA)
   pst-fp.tex    2011/03/25 v2.19 `PST-fp' (hv)
   xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
    color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
    dvips.def    1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
pst-plot.tex    2011/04/13 1.29 `pst-plot' (tvz,hv)

Running tex won't come to an end!

Markus

>
> Herbert
>
>
> _______________________________________________
> PSTricks mailing list
> PSTricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
> archive: http://www.tug.org/pipermail/pstricks/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20110413/24d136e5/attachment.html>


More information about the PSTricks mailing list