0

How can I plot whittaker function; i mean what is the code?

I tried the below:

\documentclass{article}

\usepackage{mpmath}

\usepackage{tikz}

\usepackage{pgfplots}


\begin{document}

\begin{tikzpicture}

\begin{axis}[xlabel=$x$,ylabel=$y$,
xmin=-2,xmax=2,ymin=0,ymax=0.5, axis lines=center, axis equal]

\addplot[ color=blue,]{Whitw[1, x, 10], {x, -100, 0}};

\end{axis}

\end{tikzpicture}

\end{document}

closed as off-topic by Raaja, Phelype Oleinik, user156344, Tiuri, Kurt Mar 20 at 13:41

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Could you please give us the formula? – CarLaTeX Mar 20 at 7:16
  • 1
    Also, I can't seem to figure out where the mpmath package is from? – Andreas Storvik Strauman Mar 20 at 7:41
  • 4
    Isn't this also Maple or Mathematica syntax (Whitw[1, x, 10], {x, -100, 0}, at least this is not how plotting domains are specified in pgfplots)? Note that pgfplots cannot do the same as Maple or Mathematica so don't expect it to. – daleif Mar 20 at 7:42
  • @Domas as stated in this question: tex.stackexchange.com/questions/480221/…, please give us a formula of what you want to plot. Instead, please dont ask questions that involve numerical approximations that is to be done here. Because, such a type of question is out-of-scope in this site. – Raaja Mar 20 at 12:37
  • 4
    I'm voting to close this question as off-topic because this involves numerical approximations of math functions using external non TeX related consoles. – Raaja Mar 20 at 12:38
1

I don't think it is reasonable to calculate results for the Witteker fonction in TeX. But you can generate your data with some external program (for example Python like I have done) and then plot it using TikZ.

\documentclass[tikz,border=7pt]{standalone}
\usepackage{pgfplots}
\begin{document}
  \begin{tikzpicture}
    \begin{semilogyaxis}
      % data generated with iPython : https://colab.research.google.com/gist/kpym/41d4723d06bec948638602fd7f6922c0/whittakerw-for-tikz.ipynb
      \addplot coordinates {(-100.0,1.31E+118) (-99.0,3.28E+116) (-98.0,8.29E+114) (-97.0,2.12E+113) (-96.0,5.45E+111) (-95.0,1.42E+110) (-94.0,3.73E+108) (-93.0,9.93E+106) (-92.0,2.67E+105) (-91.0,7.25E+103) (-90.0,1.99E+102) (-89.0,5.53E+100) (-88.0,1.55E+99) (-87.0,4.41E+97) (-86.0,1.27E+96) (-85.0,3.68E+94) (-84.0,1.08E+93) (-83.0,3.22E+91) (-82.0,9.70E+89) (-81.0,2.96E+88) (-80.0,9.12E+86) (-79.0,2.85E+85) (-78.0,9.02E+83) (-77.0,2.89E+82) (-76.0,9.38E+80) (-75.0,3.08E+79) (-74.0,1.03E+78) (-73.0,3.47E+76) (-72.0,1.19E+75) (-71.0,4.12E+73) (-70.0,1.45E+72) (-69.0,5.18E+70) (-68.0,1.88E+69) (-67.0,6.90E+67) (-66.0,2.57E+66) (-65.0,9.74E+64) (-64.0,3.74E+63) (-63.0,1.46E+62) (-62.0,5.80E+60) (-61.0,2.34E+59) (-60.0,9.57E+57) (-59.0,3.99E+56) (-58.0,1.69E+55) (-57.0,7.27E+53) (-56.0,3.19E+52) (-55.0,1.42E+51) (-54.0,6.46E+49) (-53.0,2.99E+48) (-52.0,1.41E+47) (-51.0,6.77E+45) (-50.0,3.32E+44) (-49.0,1.66E+43) (-48.0,8.45E+41) (-47.0,4.39E+40) (-46.0,2.34E+39) (-45.0,1.27E+38) (-44.0,7.04E+36) (-43.0,4.00E+35) (-42.0,2.32E+34) (-41.0,1.38E+33) (-40.0,8.40E+31) (-39.0,5.24E+30) (-38.0,3.36E+29) (-37.0,2.21E+28) (-36.0,1.49E+27) (-35.0,1.03E+26) (-34.0,7.36E+24) (-33.0,5.40E+23) (-32.0,4.08E+22) (-31.0,3.18E+21) (-30.0,2.56E+20) (-29.0,2.13E+19) (-28.0,1.83E+18) (-27.0,1.63E+17) (-26.0,1.51E+16) (-25.0,1.44E+15) (-24.0,1.44E+14) (-23.0,1.49E+13) (-22.0,1.62E+12) (-21.0,1.83E+11) (-20.0,2.17E+10) (-19.0,2.69E+09) (-18.0,3.52E+08) (-17.0,4.85E+07) (-16.0,7.08E+06) (-15.0,1.10E+06) (-14.0,1.81E+05) (-13.0,3.19E+04) (-12.0,6.04E+03) (-11.0,1.24E+03) (-10.0,2.75E+02) (-9.0,6.69E+01) (-8.0,1.80E+01) (-7.0,5.36E+00) (-6.0,1.80E+00) (-5.0,6.90E-01) (-4.0,3.05E-01) (-3.0,1.58E-01) (-2.0,9.76E-02) (-1.0,7.26E-02)};
    \end{semilogyaxis}
  \end{tikzpicture}
\end{document}

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.