diff --git a/docs/references/models/brownian_motion.md b/docs/references/models/brownian_motion.md new file mode 100644 index 0000000..b3c72a2 --- /dev/null +++ b/docs/references/models/brownian_motion.md @@ -0,0 +1,3 @@ +# Brownian Motion + +::: hamilflow.models.brownian_motion diff --git a/hamilflow/models/brownian_motion.py b/hamilflow/models/brownian_motion.py index aae8269..1d80757 100644 --- a/hamilflow/models/brownian_motion.py +++ b/hamilflow/models/brownian_motion.py @@ -1,5 +1,5 @@ from functools import cached_property -from typing import Union +from typing import Dict, Optional, Union import numpy as np import pandas as pd @@ -63,6 +63,7 @@ class BrownianMotion: $$ References: + 1. Brownian motion and random walks. [cited 13 Mar 2024]. Available: https://web.mit.edu/8.334/www/grades/projects/projects17/OscarMickelin/brownian.html 2. Contributors to Wikimedia projects. Brownian motion. @@ -70,8 +71,13 @@ class BrownianMotion: Available: https://en.wikipedia.org/wiki/Brownian_motion """ - def __init__(self): - pass + def __init__( + self, + system: Dict[str, float], + initial_condition: Optional[Dict[str, float]] = {}, + ): + self.system = BrownianMotionSystem.model_validate(system) + self.initial_condition = BrownianMotionIC.model_validate(initial_condition) def __call__(self, n_steps: float, delta_t: float) -> pd.DataFrame: pass diff --git a/mkdocs.yml b/mkdocs.yml index 06d9951..aedfa53 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -84,6 +84,7 @@ nav: - "Tutorials": - "Introduction": tutorials/index.md - "Harmonic Oscillator": tutorials/harmonic_oscillator.py + - "Brownian Motion": tutorials/brownian_motion.py - References: - "Introduction": references/index.md - "Models":