This example uses PSTricks package pst-ode to solve the differential equation numerically with the RKF45 method.
PSTricks requires the latex-->dvips-->ps2pdf workflow for typesetting. Since we use pgfplots here, solving the ODE with command \pstODEsolve is outsourced into an auxiliary document and the solution is written to file table.dat. Therefore, in order to typeset the code listed below, run pdflatex or lualatex with option --shell-escape.
Note that with RKF45, precision of the result does not depend on the chosen number of output points. The method uses adaptive step size control. For comparison, the solution with only 4 output points (t_0, t_1, t_2, t_e) is plotted against the fine-grained solution with 250 output points.
Typeset with pdflatex --shell-escape example.tex.
example.tex:
\documentclass{standalone}
%%%%%%%%%%%%%%%%%%%%%%% solve ODE in auxiliary document %%%%%%%%%%%%%%%%%%%%%%%%
\begin{filecontents}[overwrite]{solve.tex}
\documentclass{article}
\usepackage{pst-ode}
\begin{document}
% arguments:
% algebraicAll --> all arguments in algebraic notation
% saveData --> also write result into file `table.dat'
% `table' --> PostScript variable that takes result
% t | x[0] --> output format in `table' and `table.dat'
% 0, 10 --> integration interval t_0, t_e
% 250 --> number of saved output points t_0, t_1, ..., t_e
% 10 --> initial value
% 9.81 - ... --> right-hand side of ODE
\pstODEsolve[algebraicAll,saveData]{table}{ t | y[0] }{ 0 }{ 10 }{ 250 }{ 10 }{
9.81 - 1.15*10^-3 / (58*10^-3) * y[0]^2
}
% for comparison: 4 output points
\pstODEsolve[algebraicAll,saveData]{table2}{ t | y[0] }{ 0 }{ 10 }{ 4 }{ 10 }{
9.81 - 1.15*10^-3 / (58*10^-3) * y[0]^2
}
dummy text
\end{document}
\end{filecontents}
\immediate\write18{latex solve}
\immediate\write18{dvips solve}
\immediate\write18{ps2pdf -dNOSAFER solve.ps}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel=$t$,
ylabel=$v$,
ylabel style={rotate=-90}
]
\addplot [thin,black] table {table2.dat}; % solution with 4 output points
\addplot [blue] table {table.dat};
\end{axis}
\end{tikzpicture}
\end{document}

Alternatively, without --shell-escape, the auxiliary document solve.tex can by typeset manually before typesetting the main document example.tex:
latex solve
dvips solve
ps2pdf -dNOSAFER solve.ps
pdflatex example
pdflatex example
ps2pdf must be run with option -dNOSAFER in order to allow it to write files (table.dat).
pst-odepackage. It is simple to use, perhaps a bit less simple to compile. – Apr 30 '20 at 20:09pdflatexorxelatex. You can compile it withlatex, convert thedvitopdf, or usexelatex. However, sadly the results of both methods may not be the same. – Apr 30 '20 at 20:15tikz-pgfandasymptoteto get more attention – Black Mild Sep 02 '22 at 16:05