Documentation

Comprehensive Guide to Numerical ODE Solving

Numerical Analysis BVP Theory Computational Math

Introduction

This platform provides advanced numerical solutions to boundary value problems (BVPs) for ordinary differential equations (ODEs). By leveraging Python-based computational engines, we offer high-precision solvers for scientific and engineering applications.

Finite Difference

Discretizes the domain into a grid and approximates derivatives using algebraic differences.

Shooting Method

Converts BVPs to Initial Value Problems (IVPs) and uses root-finding to satisfy boundaries.

Mathematical Foundation

A second-order BVP seeks a function \(y(x)\) on the interval \([a, b]\) such that:

\[ y''(x) = f(x, y, y'), \quad y(a) = \alpha, \quad y(b) = \beta \]

Existence & Uniqueness

We rely on the Picard-Lindelöf theorem. For linear problems of the form \(y'' + p(x)y' + q(x)y = r(x)\), a unique solution exists if \(p, q, r\) are continuous and \(q(x) > 0\).

Input Format

The parser supports standard mathematical notation. You specify the right-hand side of the second-order equation.

  • Arithmetic: +, -, *, /, **
  • Functions: sin, cos, exp, log, sqrt
  • Variables: x, y, yp (y')

Finite Difference Method

This method approximates derivatives using central finite differences on a uniform grid. For linear ODEs of the form \(y'' = P(x)y' + Q(x)y + R(x)\), the discretization leads to a tridiagonal system:

\[ y_{i-1}(2 + hP_i) - y_i(4 + 2h^2Q_i) + y_{i+1}(2 - hP_i) = 2h^2R_i \]

The domain is discretized into \(N\) points. Currently, the FD engine extracts linear coefficients using symbolic differentiation. Note: The Finite Difference method strictly requires Linear ODEs. For non-linear equations, the Shooting Method must be used.

Shooting Method

The shooting method converts the BVP into an Initial Value Problem (IVP). We guess an initial slope \(y'(a) = s\) and integrate using Runge-Kutta 45. The mismatch at the boundary \(y(b) - \beta\) (or \(y'(b) - \beta\)) is treated as a root-finding problem \(F(s) = 0\).

Pro Tip: The shooting method is inherently capable of solving high-order non-linear problems where finite differences might require complex Newton-Raphson iterations.

Error Analysis

Every numerical solution involves three primary error sources. Our Finite Difference engine utilizes a 3-point second-order backward difference for Neumann boundary conditions to ensure the global truncation precision strictly maintains \(O(h^2)\).

Truncation
\(O(h^2)\)
Round-off
Double Precision
Discretization
Grid Errors

Stability Theory

A method is stable if perturbations in input data lead to bounded change in the output. For our finite difference engine, we monitor the matrix condition number to ensure numerical stability.

Example Problems

Damped Oscillator
y'' = -0.5*yp - y + sin(x)
Constant Gravity
y'' = -9.81

Advanced Topics

The underlying engine uses SciPy and SymPy for symbolic differentiation and high-order integration. For stiff problems, the solver automatically handles convergence using iterative refinement.

Limitations

  • Supports only single second-order equations.
  • Interval [a, b] must be finite.
  • Boundary conditions must be fixed (Dirichlet) or mixed (Neumann).