Mathematica 绘制单格点格林函数等值线图
单格点格林函数是指在一个二维平面上,仅有一个点作为源点的格林函数。假设该点的坐标为'(x_0,y_0)',则其单格点格林函数为:/n/n$$G(x,y) = -/frac{1}{2/pi} /ln/left(/sqrt{(x-x_0)^2 + (y-y_0)^2}/right)$$/n/n在Mathematica中,可以使用ContourPlot函数绘制单格点格林函数的等值线图,代码如下:/n/nmathematica/nContourPlot[-1/(2 Pi) Log[Sqrt[(x - 1)^2 + (y - 1)^2]], {x, -2, 4}, {y, -2, 4}, Contours -> 10, ColorFunction -> /'Rainbow/', PlotLegends -> Automatic]/n/n/n其中,Contours参数指定等值线的数量,ColorFunction参数指定颜色映射方案,PlotLegends参数自动显示图例。运行该代码可以得到下图:/n/n
原文地址: https://www.cveoy.top/t/topic/nu1C 著作权归作者所有。请勿转载和采集!