← Computational Mathematical Biology

SciPy

SciPy extends NumPy with algorithms for integration, differential equations, optimisation, probability distributions and linear algebra.

ODE solver

from scipy.integrate import solve_ivp

def model(t, y):
    r = 0.2
    return [r * y[0]]

sol = solve_ivp(model, [0, 20], [10])

Optimisation

from scipy.optimize import minimize

result = minimize(objective, x0=[0.2, 0.1])

The numerical method should be chosen according to the mathematical problem and checked for accuracy rather than treated as a black box.

Key idea. SciPy supplies tested numerical algorithms for many mathematical operations required by biological models.