Stochastic Differential Equation Solver Calculator

Simulate noisy dynamics using Euler and Milstein solvers. Tune drift, diffusion, paths, and step resolution. Review outputs quickly with exports, formulas, examples, and guidance.

Calculator Inputs

Reset

Use OU fields for Ornstein-Uhlenbeck, CIR fields for Cox-Ingersoll-Ross, and μ/σ for all supported models.

Example Data Table

Model Method x₀ μ / Rate σ Long Mean T Steps Paths
GBM Milstein 1.00 0.15 0.30 1.00 1.00 250 1000
OU Euler-Maruyama 0.50 θ = 1.20 0.18 0.90 2.00 400 1500
CIR Milstein 0.80 κ = 1.10 0.25 1.20 1.50 300 1200

Formula Used

A stochastic differential equation is written as dX = a(X,t)dt + b(X,t)dW, where a is the drift term, b is the diffusion term, and W is Wiener noise.

The Euler-Maruyama update is Xn+1 = Xn + a(Xn,tn)Δt + b(Xn,tn)ΔW.

The Milstein update is Xn+1 = Xn + aΔt + bΔW + 0.5bb′[(ΔW)2 − Δt]. It improves strong-order accuracy when the diffusion derivative exists.

Supported model coefficients are:

The calculator also compares empirical path statistics with theoretical mean and variance whenever a closed-form reference is available.

How to Use This Calculator

  1. Select the stochastic model that matches your physics process.
  2. Choose Euler-Maruyama for a baseline solver or Milstein for stronger path accuracy.
  3. Enter the initial state, drift, diffusion, time horizon, and model-specific coefficients.
  4. Set the number of time steps and simulation paths.
  5. Use a fixed random seed when you want repeatable outputs.
  6. Click Solve SDE to generate statistics and path samples.
  7. Inspect the mean, variance, percentiles, confidence interval, and error against theory.
  8. Export the summary table using the CSV or PDF buttons.

FAQs

1. What does this calculator solve?

It numerically solves one-dimensional stochastic differential equations with random forcing. You can simulate Brownian motion, Ornstein-Uhlenbeck, geometric Brownian motion, and CIR dynamics using path-based Monte Carlo methods.

2. When should I use Euler-Maruyama?

Use Euler-Maruyama for fast baseline studies, teaching, and quick sensitivity checks. It is simple and efficient, but it may need smaller time steps for acceptable accuracy.

3. Why choose the Milstein method?

Milstein includes an extra correction linked to the diffusion derivative. This usually improves strong convergence for multiplicative noise, especially in models such as geometric Brownian motion.

4. What do the simulation paths represent?

Each path is one possible realization of the random process over time. Looking at many paths helps you estimate distributions, moments, uncertainty bands, and rare behavior.

5. Why are theoretical and empirical results different?

Differences arise from finite sampling error and numerical discretization. Increasing the number of paths and reducing the time step usually improves agreement with theoretical expectations.

6. Can this tool support physics applications?

Yes. It is useful for noisy transport, diffusion-driven fluctuations, thermal forcing, Langevin-style approximations, population balances, and other random dynamical systems in physics.

7. Why does the CIR model stay nonnegative here?

The implementation clips negative updates to zero after each step. This practical safeguard helps preserve the model’s physical meaning when numerical noise would otherwise create invalid values.

8. What improves accuracy most effectively?

Start by increasing time steps, then increase path count. Smaller time steps reduce discretization error, while more paths reduce Monte Carlo noise in final statistics.

Related Calculators

markov chain monte carlometropolis monte carlokinetic monte carlodiscrete element methodconjugate heat transferquantum monte carlomultibody dynamicsstiff ode solveradaptive mesh refinementparticle in cell

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.