BioMath - Overdrive77/BioSynapStudio-Public GitHub Wiki


BioMath Class

Summary

Utility class for mathematical operations used in biological simulations, including jitter generation and safe division.

Namespace

BioSynapStudio.Net.Core.Utils

Assembly

BioSynapStudio.Net.dll


Properties

Name Type Description
Rnd Random Singleton instance of Random used internally for generating randomized values.

Methods

Name Signature Description
GetJitter double GetJitter(double range) Returns a multiplicative jitter factor in the range [1.0 - range, 1.0 + range]. Useful for simulating biological variability.
GetAdditiveJitter double GetAdditiveJitter(double range) Returns a small additive noise value in the range [-range, +range], centered around 0.0.
SafeDiv double SafeDiv(double numerator, double denominator, double epsilon = 1e-9) Performs safe division, returning 0.0 if the denominator is near zero (within epsilon). Prevents divide-by-zero errors.

Usage Example

double jitteredValue = 100.0 * BioMath.GetJitter(0.05); // ~±5% variability
double noise = BioMath.GetAdditiveJitter(0.01);         // small random noise around 0
double result = BioMath.SafeDiv(10.0, 0.0);              // returns 0.0 instead of throwing

Remarks

  • GetJitter() and GetAdditiveJitter() are useful for simulating natural biological variability and noise.
  • SafeDiv() is especially useful in biological formulas where division by near-zero can occur, e.g., conductance models or membrane current equations.

See Also


Legal Notice

This software constitutes original intellectual property of the author, protected under international copyright and patent law. Patent: GB2506327.2 – Synthesized Emotional Cognition (SEC) DOI: 10.17605/OSF.IO/XERKF