Solve Settings
Formula Used
This solver targets the one-dimensional Poisson equation:
d²φ/dx² = −ρ(x)/ε
Using a uniform grid with spacing Δx, the interior finite-difference form becomes:
(φ_{i−1} − 2φ_i + φ_{i+1}) / Δx² = −ρ_i/ε
φ_i = 0.5 * (φ_{i−1} + φ_{i+1} + (ρ_i Δx²)/ε)
Electric field is computed as E(x) = −dφ/dx with central differences inside the domain.
How to Use This Calculator
- Set L and N. A larger N improves resolution.
- Enter ε in consistent units with your source.
- Choose a ρ(x) model and set its parameters.
- Apply boundary values φ(0) and φ(L).
- Select a method. SOR usually converges fastest.
- Pick tolerance and max iterations, then press Solve.
- Download CSV for full tables or PDF for a summary.
Example Data Table
Example settings: L=1, N=11, ε=1, constant ρ=1, φ(0)=0, φ(L)=0. Values shown are illustrative.
| i | x | ρ(x) | φ(x) | E(x) |
|---|---|---|---|---|
| 0 | 0.0 | 1.0 | 0.0000 | -0.4500 |
| 2 | 0.2 | 1.0 | 0.0800 | -0.2500 |
| 5 | 0.5 | 1.0 | 0.1250 | 0.0000 |
| 8 | 0.8 | 1.0 | 0.0800 | 0.2500 |
| 10 | 1.0 | 1.0 | 0.0000 | 0.4500 |
Professional Notes and Guidance
1) Purpose of the Poisson model
This calculator solves the one-dimensional Poisson equation to obtain a potential profile φ(x) driven by a source term ρ(x) and scaled by ε. In electrostatics, ρ may represent charge density and ε the permittivity. In diffusion, gravity, or elasticity analogs, the same form appears with different meanings.
2) Discrete grid and resolution
The domain is split into N points with spacing Δx = L/(N−1). Smaller Δx reduces truncation error but increases runtime. For smooth sources, N between 51 and 401 often balances speed and accuracy. Rapidly varying sources require higher N to prevent numerical smoothing.
3) Source functions included
Three source options are supported. Constant ρ is useful for textbook validation. Linear ρ(x)=ρ0+ax creates asymmetric curvature and is common in graded media. Sinusoidal ρ0 sin(2πx/L+phase) helps study oscillatory forcing and boundary interplay.
4) Boundary conditions and physical meaning
Dirichlet boundaries fix φ(0) and φ(L). In electrostatics this models held potentials on conductors. If both boundaries are zero, the solution reflects only internal sources. Nonzero boundaries tilt the solution and can dominate when |φ| is large.
5) Iterative methods and speed
Jacobi is simple but slow because it updates from the previous iteration only. Gauss–Seidel accelerates convergence by using updated values immediately. Successive over-relaxation (SOR) adds a relaxation factor ω. Values ω≈1.6–1.95 often reduce iterations dramatically for uniform grids.
6) Convergence controls and stability
The solver stops when the maximum update |Δφ| drops below the tolerance. Tight tolerances like 1e−10 can require many iterations at large N. If convergence is slow, increase max iterations, improve the initial guess, or tune ω. ω above 2 can destabilize updates and is automatically limited.
7) Interpreting φ and the electric field
The output table reports φ(x) and E(x)=−dφ/dx. Where ρ is positive, curvature is typically upward in this sign convention. The field changes sign near extrema of φ. Use CSV for plotting φ and E versus x in external tools.
8) Quick validation checks
For constant ρ with zero boundaries, φ is a parabola peaking near mid-domain. Refining the grid (higher N) should change φ smoothly and reduce discretization error. If you set ρ=0, the solver should return the linear interpolation between boundary values.
FAQs
1) What problem does this tool solve?
It solves the one-dimensional Poisson equation with fixed boundary potentials, using finite differences and iterative updates to compute φ(x) and the derived field E(x).
2) Which solver method should I choose?
SOR is usually fastest. Gauss–Seidel is a good baseline. Jacobi is simplest but tends to require more iterations, especially for larger grids.
3) How do I pick a good relaxation factor ω?
Start near 1.6 to 1.9. If iterations drop, keep it. If the solution oscillates or stalls, reduce ω toward 1.2–1.6.
4) Why does increasing N slow the solver?
More grid points mean more unknowns and more work per iteration. Also, iterative methods often converge slower as the grid becomes finer.
5) What units should I use?
Any consistent units work. Ensure ρ, ε, φ, and L are compatible so that (ρΔx²)/ε has the same units as φ in the update equation.
6) Can I model Neumann boundary conditions?
This page uses fixed potentials only. You can approximate a fixed derivative by choosing boundary potentials that enforce the desired slope over a small region.
7) Why is the PDF shorter than the CSV?
The PDF is a compact summary and includes only the first part of the table. Use the CSV export to capture every grid point for plotting and analysis.