fealpy
fealpy copied to clipboard
有限元求解 Poisson 方程示例
魏老师您好,我在您的个人网站中https://www.weihuayi.cn/fealpy/poisson_fem.html ,我把这个算例写到了Spyder中,发现有个地方报错。 A, b = bc.apply(A, b),我改为了A, b = bc.apply(A, b, uh)。但是最后还是有不对的地方。
(下面是运行结果) {'l_2 error': Function(0.00153418), 'L_2 error': 0.004954239343698881, 'H_1 error': 0.21753633632067068} Traceback (most recent call last):
File "C:\Users\lihongpeng\New_Fealpy\poisson_fem_2d_why.py", line 32, in
File "c:\users\lihongpeng\desktop\fealpy\fealpy\functionspace\Function.py", line 63, in add_plot axes.plot_trisurf(
AttributeError: 'AxesSubplot' object has no attribute 'plot_trisurf'
在你的文件中,要导入 from mpl_toolkits.mplot3d import Axes3D
画图的时候要指定来3D的图:
fig = plt.figure() axes = fig.gca(projection='3d')