Space-dependent diffusion with external function #229
francescabasini
started this conversation in
General
Replies: 1 comment 4 replies
-
You're almost there – simply use |
Beta Was this translation helpful? Give feedback.
4 replies
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.
-
Hello Dr. Zwicker,
thank you for this useful package!
$\frac{d P(x, t)}{dt} = -\nabla (P(x, t) V(x)) + (D(x)) \nabla^2 P(x, t) $
I am trying to solve a Fokker-Planck equation in 1d where drift and diffusion aee space dependent.
I was able to define my own initial condition for the distribution (P(x, 0)) and the drift (V(x)). For these, I supplied specific data values for each point on the grid which I calculated externally to the package. I report my code (working!) for reference.
However, in the code below, D is given as a constant over space but I would like to supply my own values for it as well.
My diffusion does not have an analytical expression for D(x), as I obtained it as a spline which is why I could not use something similar to example 2.15 from py-pde docs.
Thank you for considering my question
Beta Was this translation helpful? Give feedback.
All reactions