Finite Difference Method Solver Form
Use this tool for one-dimensional steady diffusion, heat transfer, electrostatic potential, or similar fixed-boundary physics profiles.
Example Data Table
This sample setup represents a steady one-dimensional temperature field with a constant internal source and fixed values at both boundaries.
| Parameter | Example Value | Meaning |
|---|---|---|
| Profile Name | Temperature | Physical quantity being solved |
| Domain Length L | 1.0 | Total length of the one-dimensional region |
| Interior Nodes N | 10 | Number of unknown interior grid points |
| Coefficient k | 2.5 | Diffusivity or conductivity coefficient |
| Left Boundary | 100 | Known value at x = 0 |
| Right Boundary | 40 | Known value at x = L |
| Source Type | Constant | Uses s(x) = a |
| Source Amplitude a | 60 | Uniform internal generation strength |
| Query Position x | 0.35 | Interpolation location for a reported value |
Formula Used
The calculator solves the steady one-dimensional boundary-value equation
-k d²u/dx² = s(x)
on 0 ≤ x ≤ L, with fixed boundary conditions
u(0) = u_left and u(L) = u_right.
The uniform grid spacing is
h = L / (N + 1).
At every interior node, the second derivative is approximated by
(u[i-1] - 2u[i] + u[i+1]) / h².
The discrete linear equation becomes
-(k/h²)u[i-1] + (2k/h²)u[i] - (k/h²)u[i+1] = s(x[i]).
This produces a tridiagonal matrix solved efficiently with the Thomas algorithm.
Available source models are
s(x) = a,
s(x) = a + bx,
and
s(x) = a sin(ωx).
The gradient is estimated using finite differences, and flux is computed from
q = -k du/dx.
Residuals measure how closely the numerical profile satisfies the discrete governing equation.
How to Use This Calculator
- Enter the physical quantity name, such as temperature, potential, or concentration.
- Set the domain length, number of interior nodes, and positive coefficient value.
- Provide the known left and right boundary values.
- Select a source model, then enter the required source parameters.
- Choose a query position inside the domain for interpolated reporting.
- Press the solve button to show results above the form and below the header.
- Review the graph, summary cards, and node-by-node result table.
- Use the export buttons to save the computed results as CSV or PDF.
Frequently Asked Questions
1) What does this finite difference solver calculate?
It computes a one-dimensional steady profile for problems like heat conduction, diffusion, or electrostatic potential with known values at both ends.
2) Why does the number of interior nodes matter?
More interior nodes make the grid finer. A finer grid usually improves accuracy, but it also increases the number of unknowns and output rows.
3) What does the coefficient k represent?
It is the transport strength, such as thermal conductivity or diffusivity. Larger values generally reduce curvature for the same source intensity.
4) When should I use the constant source option?
Use it when generation or forcing stays uniform across the domain, such as constant internal heat generation inside a bar or slab.
5) What does residual mean in the results table?
The residual shows how well each interior node satisfies the discretized governing equation. Smaller values indicate a cleaner numerical solution.
6) Why are exact and numerical values both shown?
The exact profile provides a benchmark for the selected source models. Comparing both curves helps you judge discretization accuracy quickly.
7) How is flux computed here?
Flux is calculated from the gradient using q = -k du/dx. Boundary points use one-sided differences, while interior points use central differences.
8) Can I use this for quantities besides temperature?
Yes. The same one-dimensional equation form also models concentration, electric potential, and similar steady transport fields with fixed boundaries.