Also, splot can be used to produce 3D surface plots. Ive been using the cplot command from the mpmath library to plot a complex function. If matplotlib is available, the functions plot and cplot in mpmath can be used to plot functions respectively as x-y graphs and in the complex plane. What we can conclude is if you want to evaluate the Riesz function and plot it with any sort of speed, you're going to have to do this purely in Numpy or simply switch over to C++ :) I don't know if Numpy has a zeta function or infinite series avaialable, but if not, you have to be creative in how you construct an evaluator for your function using Numpy. Adding legend to complex plot made with mpmath. Which is the imaginary part of the Riesz function up to some accuracy and within some domain rectangle defined by Max in the code. This took 10-20 minutes to run! Even though I set B = 10 and Max = 2 (the range end points on the 2D domain plane). mpmath. > fp.cplot(fp. In the mp4 branch, this is solved by adding a fixed-precision context. Riesz = lambda z: Riesz_expr.evalf(subs=)Įxcept (ValueError, TypeError, ZeroDivisionError) as exc:Īx.plot_surface(X, Y, W, rstride=1, cstride=1, cmap=cm.jet)Īx.plot_wireframe(X, Y, W, rstride=5, cstride=5) Many (though not all) of the algorithms in mpmath work well in fixed precision the main problem with supporting this feature has been that of providing an appropriate interface that avoids cluttering the code. from mpl_toolkits.mplot3d import Axes3Dįrom sympy import (I, oo, Sum, exp, pi, factorial, zeta, im, re) I found that Python 3.7.9 installs all of the above, without any problem (on Windows 10). If you run into trouble installing those, you have to install an earlier version of Python and try installing again (I do not recommend virtual environment systems such as conda). It is by no means optimal or pretty, but it should get you started.įirst you need to pip install: mpmath, sympy, numpy, matplotlib, scipy. The following code is hacked together from various sources on the web.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |