Skip to content

KianiLab/FokkerPlanck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fokker-Planck Solution

A MATLAB mex implementation for numerically solving the Fokker-Planck equation using the Chang-Cooper method.

Description

This package provides a C-based MEX function (FP4) for solving the Fokker-Planck equation, which describes the temporal evolution of probability densities in diffusion processes.

Files

  • FP4.c - Source code for the MEX function
  • FP4.mex* - Compiled MEX binaries for different platforms (Windows, Mac, Linux)
  • tutorial_FokkerPlanck.m - Example script demonstrating usage and comparing different numerical methods

Usage

[ufinal, Pt, Pt_bound, Pg0, Pxt] = FP4(xmesh, uinit, k, sigma, bound_change, bound_margin, dt)

Input Parameters

  • xmesh - Spatial grid (column vector)
  • uinit - Initial probability density (column vector)
  • k - Drift rate
  • sigma - Standard deviation of the diffusion process
  • bound_change - Matrix with two columns specifying how boundaries change over time
  • bound_margin - Vector [lb_margin; ub_margin] specifying boundary margins
  • dt - Time step size

Output Parameters

  • ufinal - Final probability density
  • Pt - Survivor function (probability of not crossing bounds)
  • Pt_bound - Probability of crossing lower and upper bounds at each time step
  • Pg0 - Probability of being above zero at each time step
  • Pxt - Full probability density across space and time (optional, memory-intensive)

Example

See tutorial_FokkerPlanck.m for an example comparing different numerical methods.

Credit

Kiani lab (roozbeh@nyu.edu)

http://www.cns.nyu.edu/kianilab/Home.html

The code is released under a BSD license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors