NeumannBoundaryCondition<T>

Models & Types · AiDotNet.PhysicsInformed.PDEs

Pins the solution’s slope on the boundary rather than its value: ∂u/∂n = flux.

Implements: IBoundaryCondition<T>

For Beginners

A Dirichlet condition says what the value is at the edge. A Neumann condition says how fast it is changing there — which is what you know when the edge is insulated, or when a fixed amount is flowing in. An insulated rod end has zero flux: no heat crosses it, so the temperature gradient there is zero. That is the default here.

How It Works

The other half of what a boundary-value problem usually needs, alongside DirichletBoundaryCondition (#2099).

Example

var architecture = new NeuralNetworkArchitecture<double>(
    InputType.OneDimensional, NeuralNetworkTaskType.Regression, inputSize: 2, outputSize: 1);
            
// Insulated at both ends: no flux across the boundary
var insulated = new NeumannBoundaryCondition<double>(flux: 0.0, lowerBound: 0.0, upperBound: 1.0);
            
var pinn = new PhysicsInformedNeuralNetwork<double>(
    architecture, new HeatEquation<double>(), new IBoundaryCondition<double>[] { insulated });

Constructors

Constructor Summary
NeumannBoundaryCondition(double flux, double lowerBound, double upperBound, int coordinate, double tolerance) Initializes a Neumann condition on one input coordinate.

Properties

Property Summary
string Name { get; }

Methods

Method Summary
T ComputeBoundaryResidual(Vector<T> inputs, Vector<T> outputs, PDEDerivatives<T> derivatives)
bool IsOnBoundary(Vector<T> inputs)