{
 "cells": [
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": [
    "# Differential Equations\n",
    "\n",
    "In `braincell`, we often need to define time-varying states, such as membrane potential, gating variables, and concentrations. The evolution of these states is usually determined by differential equations.\n",
    "\n",
    "To uniformly describe these dynamic states, `braincell` provides two very important foundational components:\n",
    "\n",
    "- `DiffEqState`: used to define dynamic state variables with derivatives and diffusion terms.\n",
    "- `DiffEqModule`: used to construct the core interfaces required to implement differential equations.\n",
    "\n",
    "With `DiffEqState` and `DiffEqModule`, we can express various differential equation systems in a clear and modular way, converting electrophysiological mechanisms into numerically computable model structures, which are key tools for building neural dynamic models.\n",
    "\n",
    "Below, we introduce the purposes and usage of these two modules.\n",
    "\n",
    "## DiffEqState\n",
    "\n",
    "`DiffEqState` is a general implementation for all state variables that evolve based on differential equations, inheriting from `brainstate.ShortTermState`.\n",
    "\n",
    "You can update its derivatives and diffusion terms in the differential equation module, and the framework will automatically handle integration and related steps.\n",
    "\n",
    "## DiffEqModule\n",
    "\n",
    "`DiffEqModule` is a `mixin` class that provides modules with a differential equation modeling interface.\n"
   ],
   "id": "5d883e45c577260c"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
