Our differential equations journey is nearing its end, but
mathematics itself is endless. This chapter introduces several active
research frontiers — Neural ODEs, delay differential equations,
stochastic differential equations, and fractional differential equations
— which are profoundly changing our understanding of dynamical systems.
Finally, we review the core content of the entire series and provide
readers with a complete learning roadmap.
Neural ODEs
From ResNet to Continuous
Depth
Residual networks (ResNet) in deep learning can be written as:
As the number of layers approaches
infinity and changes per layer become infinitesimal, this becomes an
ODE:This is the core idea of
Neural ODEs.
Advantages of Neural ODEs
Memory efficiency: No need to store all
intermediate states
Adaptive computation: Complex inputs can use more
"layers"
Continuous-time modeling: Naturally handles
irregular time series
Reversibility: Both forward and backward
computation are exact
Backpropagation and the
Adjoint Method
Traditional backpropagation requires storing all intermediate
activations. Neural ODEs use the adjoint method:
Define the adjoint state, which
satisfies:Parameter
gradients:
An important application of Neural ODEs is Continuous
Normalizing Flows.
Given an initial distribution, through ODE
transformation:The probability density change
satisfies:This allows transforming simple
distributions (like Gaussian) into complex distributions for generative
models.
Delay Differential Equations
(DDEs)
Basic Concepts
Many systems' current rate of change depends not only on the current
state but also on past states:whereis the delay time.
Examples: - Population dynamics: Adult reproduction
depends on individuals bornyears ago - Control systems: Sensor
and actuator response delays - Neural networks: Signal transmission
delays
Delay
Logistic EquationThis is Hutchinson's
equation, describing delayed density-dependent growth of a single
species.
Surprising result: When, the equilibrium becomes
unstable and periodic oscillations emerge!
defstochastic_differential_equations(): """Stochastic differential equation examples""" np.random.seed(42) fig, axes = plt.subplots(2, 2, figsize=(14, 10)) # Brownian motion ax1 = axes[0, 0] n_paths = 10 n_steps = 1000 T = 1.0 dt = T / n_steps for _ inrange(n_paths): dW = np.random.normal(0, np.sqrt(dt), n_steps) W = np.concatenate([[0], np.cumsum(dW)]) t = np.linspace(0, T, n_steps + 1) ax1.plot(t, W, linewidth=1, alpha=0.7) ax1.axhline(y=0, color='k', linewidth=0.5) ax1.set_xlabel('Time', fontsize=12) ax1.set_ylabel('$W_t$', fontsize=12) ax1.set_title('Brownian Motion (Wiener Process)', fontsize=14, fontweight='bold') ax1.grid(True, alpha=0.3) # Geometric Brownian motion ax2 = axes[0, 1] mu = 0.1# Drift rate sigma = 0.3# Volatility S0 = 100# Initial price for _ inrange(n_paths): dW = np.random.normal(0, np.sqrt(dt), n_steps) W = np.concatenate([[0], np.cumsum(dW)]) t = np.linspace(0, T, n_steps + 1) # Analytical solution S = S0 * np.exp((mu - 0.5*sigma**2)*t + sigma*W) ax2.plot(t, S, linewidth=1, alpha=0.7) ax2.axhline(y=S0, color='k', linestyle='--', alpha=0.5) ax2.set_xlabel('Time', fontsize=12) ax2.set_ylabel('$S_t$', fontsize=12) ax2.set_title(f'Geometric Brownian Motion (μ={mu}, σ={sigma})', fontsize=14, fontweight='bold') ax2.grid(True, alpha=0.3) # Ornstein-Uhlenbeck process (mean reversion) ax3 = axes[1, 0] theta = 1.0# Reversion speed mu_ou = 0.0# Long-term mean sigma_ou = 0.5 defeuler_maruyama_ou(X0, T, n_steps, theta, mu, sigma): dt = T / n_steps X = np.zeros(n_steps + 1) X[0] = X0 for i inrange(n_steps): dW = np.random.normal(0, np.sqrt(dt)) X[i+1] = X[i] + theta*(mu - X[i])*dt + sigma*dW return X t = np.linspace(0, 5, 1000) for X0 in [-2, -1, 0, 1, 2]: X = euler_maruyama_ou(X0, 5, 999, theta, mu_ou, sigma_ou) ax3.plot(t, X, linewidth=1, alpha=0.7) ax3.axhline(y=mu_ou, color='k', linestyle='--', label='Long-term mean') ax3.set_xlabel('Time', fontsize=12) ax3.set_ylabel('$X_t$', fontsize=12) ax3.set_title('Ornstein-Uhlenbeck Process (Mean Reversion)', fontsize=14, fontweight='bold') ax3.legend() ax3.grid(True, alpha=0.3) # Probability density evolution ax4 = axes[1, 1] # GBM distribution at different times times = [0.1, 0.5, 1.0] S_range = np.linspace(50, 200, 200) for t in times: # Log-normal distribution mean_log = np.log(S0) + (mu - 0.5*sigma**2)*t std_log = sigma * np.sqrt(t) pdf = 1/(S_range * std_log * np.sqrt(2*np.pi)) * \ np.exp(-(np.log(S_range) - mean_log)**2 / (2*std_log**2)) ax4.plot(S_range, pdf, linewidth=2, label=f't = {t}') ax4.axvline(x=S0, color='k', linestyle='--', alpha=0.5) ax4.set_xlabel('$S_t$', fontsize=12) ax4.set_ylabel('PDF', fontsize=12) ax4.set_title('GBM: Probability Density Evolution', fontsize=14, fontweight='bold') ax4.legend() ax4.grid(True, alpha=0.3) plt.tight_layout() plt.savefig('stochastic_differential_equations.png', dpi=150, bbox_inches='tight') plt.show()
stochastic_differential_equations()
Fokker-Planck Equation
The probability densityof
an SDE satisfies the Fokker-Planck equation (or
Kolmogorov forward equation):This is
a partial differential equation connecting SDEs and PDEs.
Fractional Differential
Equations
Fractional Derivatives
Riemann-Liouville fractional integral:
Caputo fractional derivative:where.
Physical Meaning
Fractional derivatives have memory effects— the
current state depends on the entire history, not just the instantaneous
rate of change.
Applications: - Viscoelastic materials: Between
purely elastic and purely viscous - Anomalous diffusion: Diffusion rate
proportional to() - Porous media flow:
Non-Darcy flow
Fractional Relaxation
Standard first-order relaxation:, solution
is(exponential decay)
Fractional relaxation:The solution involves the Mittag-Leffler
function:where
deffractional_differential_equations(): """Fractional differential equation examples""" from scipy.special import gamma defmittag_leffler(alpha, z, n_terms=100): """Compute Mittag-Leffler function E_α(z)""" result = 0 for k inrange(n_terms): result += z**k / gamma(alpha*k + 1) return result fig, axes = plt.subplots(2, 2, figsize=(14, 10)) # Fractional relaxation ax1 = axes[0, 0] t = np.linspace(0, 10, 200) lambda_val = 1.0 # Different orders alphas = [0.5, 0.75, 1.0, 1.5] for alpha in alphas: if alpha == 1.0: y = np.exp(-lambda_val * t) label = f'α = 1 (exponential)' else: y = np.array([mittag_leffler(alpha, -lambda_val * ti**alpha) for ti in t]) label = f'α = {alpha}' ax1.plot(t, y, linewidth=2, label=label) ax1.set_xlabel('Time', fontsize=12) ax1.set_ylabel('y(t)', fontsize=12) ax1.set_title('Fractional Relaxation', fontsize=14, fontweight='bold') ax1.legend() ax1.grid(True, alpha=0.3) ax1.set_ylim(0, 1.1) # Anomalous diffusion ax2 = axes[0, 1] # Mean square displacement <x ²> ∝ t^α t = np.linspace(0.1, 10, 100) for alpha in [0.5, 1.0, 1.5, 2.0]: msd = t**alpha if alpha < 1: label = f'α = {alpha} (subdiffusion)' elif alpha == 1: label = f'α = {alpha} (normal)' elif alpha < 2: label = f'α = {alpha} (superdiffusion)' else: label = f'α = {alpha} (ballistic)' ax2.plot(t, msd, linewidth=2, label=label) ax2.set_xlabel('Time', fontsize=12) ax2.set_ylabel('Mean Square Displacement', fontsize=12) ax2.set_title('Anomalous Diffusion', fontsize=14, fontweight='bold') ax2.legend() ax2.grid(True, alpha=0.3) ax2.set_yscale('log') ax2.set_xscale('log') # Viscoelastic material response ax3 = axes[1, 0] # Strain response under step stress t = np.linspace(0, 5, 200) # Elastic ax3.axhline(y=1, color='b', linestyle='--', linewidth=2, label='Elastic (α=0)') # Viscous ax3.plot(t, t, 'r--', linewidth=2, label='Viscous (α=1)') # Fractional (viscoelastic) for alpha in [0.3, 0.5, 0.7]: strain = t**alpha ax3.plot(t, strain, linewidth=2, label=f'Viscoelastic (α={alpha})') ax3.set_xlabel('Time', fontsize=12) ax3.set_ylabel('Strain (normalized)', fontsize=12) ax3.set_title('Viscoelastic Response (Step Stress)', fontsize=14, fontweight='bold') ax3.legend() ax3.grid(True, alpha=0.3) ax3.set_xlim(0, 5) ax3.set_ylim(0, 5) # Mittag-Leffler function ax4 = axes[1, 1] z = np.linspace(-5, 0, 200) for alpha in [0.5, 0.75, 1.0, 1.25, 1.5]: E = np.array([mittag_leffler(alpha, zi) for zi in z]) if alpha == 1.0: label = f'α = 1 (exp(z))' else: label = f'α = {alpha}' ax4.plot(z, E, linewidth=2, label=label) ax4.set_xlabel('z', fontsize=12) ax4.set_ylabel('$E_α(z)$', fontsize=12) ax4.set_title('Mittag-Leffler Function', fontsize=14, fontweight='bold') ax4.legend() ax4.grid(True, alpha=0.3) ax4.set_ylim(0, 1.5) plt.tight_layout() plt.savefig('fractional_differential_equations.png', dpi=150, bbox_inches='tight') plt.show()
fractional_differential_equations()
Modern Developments in
Numerical Methods
Structure-Preserving
Algorithms
Traditional numerical methods may destroy important properties of
physical systems. Symplectic integrators preserve the
phase space volume of Hamiltonian systems:
St ö rmer-Verlet algorithm:$
$
Exponential Integrators
For stiff systems, exponential integrators use matrix exponentials to
exactly handle the linear part:where.
Physics-Informed Neural
Networks (PINNs)
Combining neural networks with physical laws:
Loss function:
Complete Series Knowledge
Review
Core Knowledge Summary
First-Order Equations
Type
Standard Form
Solution Method
Separable
Separate variables and integrate
Linear
Integrating factor
Exact
,
Potential function method
Bernoulli
Substitution
Riccati
Transform after finding particular solution
Higher-Order Linear
Equations
Constant coefficient homogeneous equations:
Characteristic roots determine solution form
Online Courses: 1. MIT 18.03 - Differential
Equations 2. MIT 18.06 - Linear Algebra (matrix method foundation) 3.
Coursera - Introduction to Dynamical Systems and Chaos
Neural ODE: Implement a simple Neural ODE model
to learn spiral data dynamics. Compare parameter efficiency with
standard neural networks.
Delay effects: Consider a feedback control
system with delay:Analyze stability for different delaysand design a Smith predictor for
compensation.
Stochastic resonance: Add noise to a double-well
potential system:Explore the effect of noise intensityon transition behavior.
Fractional oscillator: Analyze the fractional
harmonic oscillator:Compare oscillation behavior for
differentwith the standard
oscillator.
Physics-informed network: Use PINN to solve the
boundary value problem:Analyze convergence and
accuracy.
Theoretical Problems
Prove that symplectic integrators preserve phase space volume
(discrete version of Liouville's theorem).
Explain why It ô and Stratonovich integrals give different
results and when each applies.
Derive the Fokker-Planck equation and explain its relationship to
SDEs.
Prove that the Mittag-Leffler function reduces to the exponential
function when.
Discuss the universal approximation properties of Neural ODEs —
what kinds of functions can they represent?
Application Problems
Financial options: Simulate stock prices using
geometric Brownian motion and calculate Monte Carlo prices for European
call options.
Epidemic prediction: Introduce stochasticity
into the SIR model and analyze uncertainty in epidemic
prediction.
Neuroscience: Implement the Hodgkin-Huxley model
and analyze neural action potentials.
Climate modeling: Implement the simplified
Lorenz-63 model and analyze the butterfly effect and predictability
timescales.
Programming Projects
Implement a complete ODE solver library including:
Explicit methods: Euler, RK4, RK45
Implicit methods: Backward Euler, Crank-Nicolson
Symplectic methods: St ö rmer-Verlet
Adaptive step size control
Stiffness detection
Build an interactive phase plane analysis tool that can:
Plot vector fields
Trace trajectories
Automatically identify and classify equilibria
Compute Lyapunov exponents
Implement a Neural ODE framework supporting:
Arbitrary neural network architectures
Adjoint method backpropagation
Adaptive ODE solvers
Continuous normalizing flows
Conclusion
Differential equations are the language for describing the laws of
change in nature. From Newton's celestial mechanics to modern machine
learning, they have always stood at the frontier of science.
Our journey began with the simplest first-order equations, passed
through the elegant framework of linear theory, traversed the complex
landscape of nonlinear worlds, and finally arrived at the new continents
of stochastic and fractional calculus. This is not just an accumulation
of mathematical techniques but training in ways of thinking — how to see
patterns in change, how to capture dynamics with equations.
But this is just the beginning. True understanding comes from
application — when you model a real problem with ODEs, when you debug
numerical code to make solutions converge, when you stare at a chaotic
attractor thinking about the nature of predictability — in those
moments, differential equations become not symbols in a textbook but
tools for understanding the world.
I hope this series can be a valuable stop on your mathematical
journey. Happy learning, and never stop exploring!
References
Chen, R. T. Q., et al. (2018). Neural Ordinary Differential
Equations. NeurIPS.
Kloeden, P. E., & Platen, E. (1992). Numerical Solution of
Stochastic Differential Equations. Springer.
Diethelm, K. (2010). The Analysis of Fractional Differential
Equations. Springer.
Hairer, E., Lubich, C., & Wanner, G. (2006). Geometric
Numerical Integration. Springer.
Raissi, M., Perdikaris, P., & Karniadakis, G. E. (2019).
Physics-informed neural networks. Journal of Computational
Physics.
Smith, H. (2011). An Introduction to Delay Differential
Equations. Springer.
Series Complete
Thank you for reading the "Erta Ordinary Differential Equations"
series. This is Chapter 18, also the final chapter of this
series.
Post title:Ordinary Differential Equations (18): Advanced Topics and Summary
Post author:Chen Kai
Create time:2019-06-30 11:15:00
Post link:https://www.chenk.top/ode-chapter-18-advanced-topics-summary/
Copyright Notice:All articles in this blog are licensed under BY-NC-SA unless stating additionally.