boundary-value-problems

Solid

Problem-solving strategies for boundary value problems in odes pdes

AI & Automation 3,795 stars 297 forks Updated 4 months ago MIT

Install

View on GitHub

Quality Score: 86/100

Stars 20%
100
Recency 20%
50
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Boundary Value Problems ## When to Use Use this skill when working on boundary-value-problems problems in odes pdes. ## Decision Tree 1. **Problem Classification** - Two-point BVP: conditions at x=a and x=b? - Sturm-Liouville: eigenvalue problem? - Mixed conditions: Dirichlet, Neumann, Robin? 2. **Shooting Method** - Convert BVP to IVP - Guess missing initial conditions - Iterate to satisfy boundary conditions - `scipy.integrate.solve_ivp` + root finding 3. **Finite Difference Method** - Discretize domain: x_i = a + i*h - Replace derivatives with differences: y'' ~ (y_{i+1} - 2y_i + y_{i-1})/h^2 - Solve resulting linear system - `sympy_compute.py linsolve "tridiagonal_matrix" "boundary_vector"` 4. **Collocation/BVP Solver** - `scipy.integrate.solve_bvp(ode, bc, x, y_init)` - Provide initial mesh and guess - Check residual for accuracy 5. **Eigenvalue Problems** - Sturm-Liouville form: -(p(x)y')' + q(x)y = lambda*w(x)*y - Eigenvalues are real if p, w > 0 - Eigenfunctions orthogonal with weight w - `sympy_compute.py eigenvalues "sturm_liouville_matrix"` ## Tool Commands ### Scipy_Solve_Bvp ```bash uv run python -c "from scipy.integrate import solve_bvp; import numpy as np; ode = lambda x, y: [y[1], -y[0]]; bc = lambda ya, yb: [ya[0], yb[0]-1]; x = np.linspace(0, np.pi, 10); y = np.zeros((2, 10)); sol = solve_bvp(ode, bc, x, y); print('Solution at pi/2:', sol.sol(np.pi/2)[0])" ``` ### Sympy_Linsolve ```bash uv ...

Details

Author
parcadei
Repository
parcadei/Continuous-Claude-v3
Created
5 months ago
Last Updated
4 months ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category