Skip navigation links

Package dev.nm.analysis.differentialequation.pde.finitedifference.parabolic.dim1.heatequation

One-dimensional heat/diffusion problems with explicit initial and boundary data.

See: Description

Package dev.nm.analysis.differentialequation.pde.finitedifference.parabolic.dim1.heatequation Description

One-dimensional heat/diffusion problems with explicit initial and boundary data.

Problem, solver, grid

  1. Construct HeatEquation1D with diffusivity, interval length, terminal time, initial profile and both boundary functions.
  2. Choose Dirichlet, Neumann or mixed conditions using the documented left/right signs.
  3. Pass the problem and grid sizes to CrankNicolsonHeatEquation1D.
  4. Read the returned PDESolutionTimeSpaceGrid1D at integer grid indices and use t(m)/x(n) for physical coordinates.

Boundary values and units

The model is \(u_t=\beta u_{xx}\). Diffusivity uses length-squared/time units; space, time and all boundary functions must use consistent units. At the left boundary the derivative term has a minus sign; at the right it has a plus sign. Setting c1/c2 to zero gives fixed values, while setting them to one gives Neumann derivative conditions. Check compatibility with the initial profile.

For M time intervals and N interior spatial points, \(\Delta t=T/M\) and \(\Delta x=a/(N+1)\). Use M at least one and N at least two for this implementation. Time index zero is the initial profile; spatial solution values exist only at indices 1 through N. Boundary coordinates are available, but accessing their solution values raises UnsupportedOperationException.

Accuracy checks

Start with the sine-decay and insulated-constant examples. Check a known solution, then refine space and time for the actual problem. Second-order formal accuracy assumes sufficient regularity; implicit time stepping does not remove spatial error or guarantee nonnegative values on coarse grids.

Skip navigation links

Copyright © 2010-2026 NM Group. All Rights Reserved.