Replies: 1 comment 1 reply
-
This is certainly possible. Here is a little example that might get you on track: grid = pde.UnitGrid([32, 32], periodic=True)
field = pde.VectorField.random_uniform(grid)
velocity = pde.VectorField(grid, data=field.data) # set velocity field from numpy array
state = pde.ScalarField.random_normal(grid) # set initial state
D = 0.5
eq = pde.PDE({'P': f'-divergence(P * V) + {D}/2 * laplace(P)'}, consts={'V': velocity})
result = eq.solve(state, t_range=1e2, dt=1e-4, tracker=['progress', 'plot']) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Dear Dr. Zwicker,
Thanks for this wonderful package! I really appreciate your work, but I just have several questions about the package.
I want to solve this fokker-planck diffusion equation where
P = P(x,y,t) probability density function,
D = Diffusion coefficient,
V = (dx/dt, dy/dt) external drift velocity vector, which is my custom vector field in the form of numpy array
Is there any way to include custom vector field into the PDE?
Also how can I include vector term in the PDE? I could not find example codes that include vector term.
Can you show demonstration code?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions