johnaparker / fplanck Goto Github PK
View Code? Open in Web Editor NEWNumerically solve the Fokker-Planck equation in N dimensions
License: MIT License
Numerically solve the Fokker-Planck equation in N dimensions
License: MIT License
Many thanks
Is it possible to provide the equations of "tilted_bigaussian" and "ring"? Thank you!
Hi, I really like your implementation.
I'm trying to use it to run some nonlinear simulations, and i've managed to adimensionalize the code to use it for 'non-physical' processes.
However i'm not sure how to input a time-dependent force, since non of the examples include this case.
I'm also struggling to pass keyword arguments for the force parameters, if you have any tip on how o do that, i'd really appreciate it.
I'm also modifying the code to use non-symmetrical domains. But hopefully i'll have that done fairly quick.
Cheers,
Alexis
how to run this program and get giff ?
please tell, which command
Dear John;
Thanks for providing a code to solve FP. I installed fplanck via conda in python 3.5, and now I am trying to re-run one of your examples, namely the ratchet.py:
https://github.com/johnaparker/fplanck/blob/master/examples/ratchet.py
however, I got some errors. The first error appeared after loading fplanck:
from . import utility
raise ValueError(f'input vector ({value}) does not have the correct dimensions (ndim = {ndim})')
SyntaxError: invalid syntax
As a quick solution, I just commented out the lines 12-13 in utility.py; that is:
# if vec.size != ndim:
# raise ValueError(f'input vector ({value}) does not have the correct dimensions (ndim = {ndim})')
Then, I got a second error:
class boundary(enum.Enum):
"""enum for the types ofboundary conditions"""
reflecting = enum.auto()
class boundary(enum.Enum):
"""enum for the types ofboundary conditions"""
reflecting = enum.auto()
periodic = enum.auto()
AttributeError: module 'enum' has no attribute 'auto'
In short, fplanck can not be loaded clean. Am I missing something?, perhaps a mistake from my side?, any suggestion?
Regards;
Eduardo
Implement space-dependent drag coefficients. Allow the user to call as fokker_planck(drag=F, ...)
where F
is a function of the spatial coordinates and returns the drag coefficient at that position.
https://arxiv.org/pdf/1804.01285.pdf
Appendix A
Hi,
I am very interested in using this software for a scientific project and I have a question about it. I have a 1D potential expressed in kJ/mol defined along a unit-less variable going from 0 to 1. Concerning the mesh, I am assuming - based on your examples - that I can create a mesh mesh = numpy.linspace(0,1e-9,ngrid_points)
with reflective boundary conditions but how about rescaling the potential to the units the software uses? I am not sure how to approach this, because the examples do not seem to cover this point. Any suggestion would be greatly appreciated!
Hey John,
I'm in an env where I don't have fplanck installed -- i.e, I just cloned the repo, and did not want to run pip install fplank
, because I'd like to play with the code.
In this case, do you get relative import path issues when you try to add initial distribution functions to functions.py
? When I pip install fplanck
in an env, and make changes to the work tree, the examples don't find my changes, because they correctly stop looking after they find the pip installed path.
Cheers!
Hello,
Thank you for writing a code to solve FPE. The examples seem to use some physics language, which I find difficult to translate to "standard" math formulation. Can you please let me know how to setup a problem to solve the following problem. Suppose the two state-variables follow
dy_t = x_tdt
dx_t = f(x_t, y_t)dt + bdW_t,
where b is a constant and f(x_t, y_t) is a general function (it ensures that x_t and y_t have stationary dynamics on 0<x<inf, y<0<inf).
I would like to solve for a stationary density g, which amount to solving the following FPE: -xg'_y - (f(x,y)g)'_x +b^2*g''_xx/2 = 0. Does you code allow to solve this problem? And if so, how one can do that?
Many thanks,
Igor
Sometimes, when the parameters are just right, the matrix is exactly singular and the steady-state PDF cannot be solved for. Is there a way to ensure the matrix is never singular? In the below case, the error occurs, but if S = 100.0001*nm
there is no error.
import numpy as np
from fplanck import fokker_planck, boundary
nm = 1e-9
viscosity = 8e-4
radius = 50*nm
S = 100*nm
def drag(x):
return 6*np.pi*viscosity*radius*(1 + np.abs(x)/S)
sim = fokker_planck(temperature=300, drag=drag, extent=200*nm,
resolution=5*nm, boundary=boundary.periodic)
steady = sim.steady_state()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.