Boundary Value Problem Solver
The Boundary Value Problem Solver solves a second-order linear ODE of the form \\( u”(x) + p(x)u'(x) + q(x)u(x) = f(x) \\) with boundary conditions \\( u(a) = \alpha \\), \\( u(b) = \beta \\), using the finite difference method, visualizing the solution with p5.js and displaying steps with MathJax.
Boundary Value Problem Solver
The Boundary Value Problem Solver computes the solution to a second-order linear ODE \\( u”(x) + p(x)u'(x) + q(x)u(x) = f(x) \\) with boundary conditions \\( u(a) = \alpha \\), \\( u(b) = \beta \\), using the finite difference method. Input the domain, boundary values, coefficient functions \\( p(x) \\), \\( q(x) \\), \\( f(x) \\), and the number of grid points. The solution is visualized with p5.js, and computational steps are shown with MathJax. Results can be shared or embedded.
Example 1: Simple BVP
Equation: \\( u”(x) = -1 \\), with \\( u(0) = 0 \\), \\( u(1) = 0 \\), \\( N = 100 \\).
Step 1: Discretize domain \\( [0,1] \\) into 100 points.
Step 2: Set up finite difference equations.
Step 3: Solve the tridiagonal system.
Result: A parabolic solution satisfying the boundary conditions.
Example 2: BVP with Linear Term
Equation: \\( u”(x) + u(x) = 0 \\), with \\( u(0) = 0 \\), \\( u(1) = 1 \\), \\( N = 100 \\).
The solution resembles a sine function due to the oscillatory nature.
Example 3: BVP with First Derivative
Equation: \\( u”(x) + 2u'(x) = 0 \\), with \\( u(0) = 1 \\), \\( u(1) = 0 \\), \\( N = 100 \\).
The first derivative term introduces exponential behavior.
Example 4: Constant Coefficients
Equation: \\( u”(x) – u(x) = -1 \\), with \\( u(0) = 0 \\), \\( u(1) = 0 \\), \\( N = 100 \\).
The negative \\( q(x) \\) term affects the curvature of the solution.
Example 5: Larger Domain
Equation: \\( u”(x) = -2 \\), with \\( u(0) = 0 \\), \\( u(2) = 0 \\), \\( N = 200 \\).
A larger domain amplifies the parabolic shape of the solution.