Skip to content

Latest commit

 

History

42 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BrainSignal Simulator

Project Overview

BrainSignal Simulator is a modular, web-based computational platform for modeling, simulating, and analyzing dynamical systems and neural computation models. It brings differential-equation systems and discrete neural network computation — under one unified simulation engine.

What problem does it solve? Studying computational neuroscience and dynamical systems usually means juggling different tools for different model types: one library for chaotic systems like Lorenz, another for spiking neurons, another for numerical ODE solvers, another for basic neural networks. BrainSignal Simulator instead provides a single, pluggable architecture where any model (chaotic system, biological neuron, or neural network) can be dropped into the same simulation loop, and any numerical integration method can be attached to it independently.

How it works, conceptually:

  1. A model (e.g. Lorenz system, LIF neuron, Izhikevich neuron, or ANN) defines its own state and its own differential equation (or, for ANN, its own forward-computation rule).
  2. A solver (Euler, RK4, Adaptive RK, Leapfrog, Verlet, Improved Euler) is attached independently — the same model can be simulated with different solvers to compare accuracy, stability, and performance.
  3. A central SimulationEngine, paired with a Scheduler that advances simulation time, drives the step-by-step evolution: at every tick, ODE-based models are advanced through the chosen solver, while ANN models bypass the solver entirely and perform a direct forward pass.
  4. Every state is recorded into a SimulationResult, which the API serializes back to the client as time series data ready for plotting.
  5. On top of this core loop, the project also implements a small symbolic math engine (variables, constants, binary/unary expressions, and an evaluator) used to represent and evaluate model equations programmatically rather than hard-coding them, and a working Spiking Neural Network (SNN) built from multiple LIF neurons running in parallel, which additionally emits discrete spike events once each neuron's membrane potential crosses its threshold.

The project currently supports:

  • Chaotic dynamical systems (Lorenz system)
  • Biophysical neuron models (LIF, Izhikevich)
  • Artificial neural networks (ANN, feedforward)
  • Spiking neural networks (SNN, built from LIF neurons)
  • Multiple numerical integration methods (Euler, Improved Euler/Heun, RK4, Adaptive RK, Leapfrog, Verlet)

Features

Module Description
Simulation Engine Central engine that drives time evolution, solver dispatching, and state recording
Numerical Solvers 6 solvers: Euler, Improved Euler, RK4, Adaptive RK, Leapfrog, Verlet
Neural Models LIF (Leaky Integrate-and-Fire), Izhikevich, ANN, SNN
Symbolic Math Engine Custom expression system (Variable, Constant, Binary/Unary Expression, Evaluator) for defining equations
REST API FastAPI backend with endpoints for simulation, ANN training/inference, and SNN execution
Web Frontend Lightweight HTML/CSS/JS interface for visualization, no build tool required

Mathematical Models

Lorenz System (chaotic attractor)

dx/dt = σ(y - x)
dy/dt = x(ρ - z) - y
dz/dt = xy - βz

LIF Neuron (Leaky Integrate-and-Fire)

dV/dt = ( -(V - V_rest) + R·I ) / τ
if V ≥ threshold → spike, V ← V_reset

Izhikevich Neuron

dV/dt = 0.04V² + 5V + 140 - u + I
du/dt = a(bV - u)

Numerical Solvers

Solver Used for
Euler Fast approximation, LIF/Izhikevich in low-precision mode
Improved Euler (Heun) More accurate alternative to Euler
RK4 High precision — Lorenz, neuron models
Adaptive RK Stiff systems, dynamic step-size control
Leapfrog Energy-preserving systems
Verlet Physics-based integration

About

Web-based neural simulation platform for modeling, simulating, and analyzing neural systems using numerical solvers

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages