3D-plotting sine integral (PSTRICKS)
the package pst-func
has a PostScript macro Si which expects a value on the stack and returns the integral. For more information see the documentation of pst-func
. Here is only an idea of how it can be done. Don't know how to handle your values, because PostScript needs degrees for the sin function which can be done internally with DegtoRad
:
\listfiles
\documentclass{article}
\usepackage{pst-solides3d,pst-func}
\begin{document}
\psset{Decran=50,viewpoint=10 20 40 rtp2xyz,lightsrc=viewpoint}
\begin{pspicture}(-6,-4)(6,4)
\defFunction{func}(u,v)
{u}
{v}
{u tx@FuncDict begin Si end u 3 div sub u v Div RadtoDeg sin Pi dup mul div add }
\psSolid[object=surfaceparametree,base=-1 1 -1 1,function=func,
ngrid=40 40,hue=0 1]
\end{pspicture}
$x=u$, $y=v$ and
$z=\int_0^x \frac{\sin\left(\pi t \right)}{\pi t} -
\frac{1}{3} \mathrm{d}t+\frac{1}{\pi^2}\sin\left(\pi \frac{x}{y}\right)$
\end{document}
The Asymptote
is capable of calculations of the integral of f
from a
to b
using adaptive Simpson integration. However, when configured with the GNU Scientific Library (GSL
), it includes Si(x) = int(sin(t)/t, t=0..x)
function as well. plot-si.tex
:
\documentclass[10pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{asymptote}
\usepackage{lmodern}
\DeclareMathOperator{\Si}{Si}
\begin{document}
\begin{align}
z&=\int_0^x \frac{\sin\left(\pi t \right)}{\pi t} -
\frac{1}{3} \mathrm{d}t+\frac{1}{\pi^2}\sin\left(\pi \frac{x}{y}\right)
=\frac{\Si(\pi x)}{\pi}-\frac{x}3 +\frac{1}{\pi^2}\sin\left(\pi \frac{x}{y}\right)
\end{align}
\begin{asy}
size(200);
size3(200,200,50,IgnoreAspect);
import gsl;
import graph3;
import palette;
currentprojection=orthographic(camera=(3,5,4),up=(0,0,1),target=(0,0,0),zoom=0.9);
real f(pair p){return Si(pi*p.x)/pi-1/3*p.x+1/pi^2*sin(pi*p.x/p.y);}
real Arg(triple v) {return f((v.x,v.y));}
real ep=1e-7;
surface s=surface(f, (-1+ep,-1+ep),(1,1),nx=200);
s.colors(palette(s.map(Arg),Wheel()));
draw(s,render(merge=true));
\end{asy}
\end{document}
run latexmk -f pdf plot-si.tex
.