如何在 py-pde (python) 中输入一般非线性 pde?
我正在尝试使用 py-pde 来模拟 2d 图 z=u(x,y) 的平均曲率流。
平均曲率流方程有一个函数 u 的 Hessian 项 请参阅此处的方程(D_i 表示相对于 x 和 y 的导数,其中 i = 1和 2 ,分别)
我尝试将 Hessian 写为梯度的梯度,但没有成功。下面的代码展示了一种尝试:
from pde import PDE, ScalarField, UnitGrid, CartesianGrid
grid = CartesianGrid([[0, 100], [0, 100]], [100, 100], periodic=[True, True]) # generate grid
state = ScalarField.from_expression(grid, "x/4 + y/4") # generate initial condition
eq = PDE({"u": "laplace(u)-(1/(1+dot(gradient(u),gradient(u))))*dot(gradient(u),gradient(gradient(u))*gradient(u))"}) # define the pde
result = eq.solve(state, t_range=1, dt=0.1)
result.plot()
是否可以使用 py-pde 来求解这个方程?怎么可能呢?
I'm trying to use py-pde to simulate the mean curvature flow for a 2d-graph z=u(x,y).
The equation for the Mean Curvature Flow has a term with the Hessian of the function u
see the equations here (D_i denotes the derivatives with respect to x and y, for i = 1 and 2 , respectively)
I tried to write the Hessian as the gradient of the gradient, but without success. The following code shows an attempt:
from pde import PDE, ScalarField, UnitGrid, CartesianGrid
grid = CartesianGrid([[0, 100], [0, 100]], [100, 100], periodic=[True, True]) # generate grid
state = ScalarField.from_expression(grid, "x/4 + y/4") # generate initial condition
eq = PDE({"u": "laplace(u)-(1/(1+dot(gradient(u),gradient(u))))*dot(gradient(u),gradient(gradient(u))*gradient(u))"}) # define the pde
result = eq.solve(state, t_range=1, dt=0.1)
result.plot()
Is it possible to use py-pde to solve this equation? How could it be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论