On Tue, Jan 3, 2012 at 2:59 PM, Yun Tao <[email protected]> wrote: > Hi all, > > Having just jumped on the Fipy bandwagon, I'm wondering how it fares in > handling stochastic PDEs. >
I don't know a whole lot about stochastic PDEs. We do have some examples buried in doctests. See the examples in the following: < http://www.ctcms.nist.gov/fipy/fipy/generated/variables.html#module-fipy.variables.uniformNoiseVariable > < http://www.ctcms.nist.gov/fipy/fipy/generated/variables.html#module-fipy.variables.gammaNoiseVariable > < http://www.ctcms.nist.gov/fipy/fipy/generated/variables.html#module-fipy.variables.exponentialNoiseVariable > < http://www.ctcms.nist.gov/fipy/fipy/generated/variables.html#module-fipy.variables.exponentialNoiseVariable > < http://www.ctcms.nist.gov/fipy/fipy/generated/variables.html#module-fipy.variables.gaussianNoiseVariable > < http://www.ctcms.nist.gov/fipy/fipy/generated/variables.html#module-fipy.variables.betaNoiseVariable > None of these include examples that actually solve a PDE, but the noise variables can be tagged onto terms in the same way as other variables to form PDEs that include stochastic sources. Having gone through multiple examples provided on the website so far, one > of the major problems I'm facing is the setting of initial condition as a > probability density function. This step seems to require more than just > setting the value of CellVariable as a function of > mesh.getCellCenters()[0]. Any insight? > Would this do for a uniform mesh (for non-uniform meshes you can use the the noise variables included above)? from fipy import Grid1D, CellVariable, numerix, Viewer m = Grid1D(nx=100) v = CellVariable(mesh=m) v[:] = numerix.random.exponential(size=len(v)) Viewer(v).plot() raw_input('wait') Hope that helps. -- Daniel Wheeler
_______________________________________________ fipy mailing list [email protected] http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
