[pstricks] psNewton

Markus Krebs markuskrebs at web.de
Wed Apr 13 17:20:40 CEST 2011


Dear All!

Copy & Paste is a weird thing.

Now it's working fine.

Sorry for my stupid post.

Thanks a lot to Herbert!

Markus


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 :-)
>
> With the pst-plot from
> http://texnik.dante.de/tex/generic/pst-plot/
> you can use:
>
> \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
>
> 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/1bc17aaa/attachment.html>


More information about the PSTricks mailing list