DirichletBoundaryCondition<T>
Models & Types · AiDotNet.PhysicsInformed.PDEs
Pins the solution to a fixed value on the boundary: u = value.
Implements: IBoundaryCondition<T>
For Beginners
A differential equation on its own has infinitely many solutions — it says how things change, not where they start or end. A Dirichlet condition supplies one of the missing facts: “at the edge of the domain, the value is this”. Holding a metal rod’s end at 0°C is a Dirichlet condition.
How It Works
Five PINN types take IBoundaryCondition<T>[] in their constructors and the library
implemented the interface zero times, so every user had to write this before they could solve
anything (#2099). A physics-informed network without boundary conditions is not solving a
boundary-value problem, so this is the common case rather than an edge one.
Example
var architecture = new NeuralNetworkArchitecture<double>(
InputType.OneDimensional, NeuralNetworkTaskType.Regression, inputSize: 2, outputSize: 1);
// u = 0 wherever the first input coordinate is at 0 or 1
var bc = new DirichletBoundaryCondition<double>(boundaryValue: 0.0, lowerBound: 0.0, upperBound: 1.0);
var pinn = new PhysicsInformedNeuralNetwork<double>(
architecture, new HeatEquation<double>(), new IBoundaryCondition<double>[] { bc });
Constructors
| Constructor | Summary |
|---|---|
DirichletBoundaryCondition(double boundaryValue, double lowerBound, double upperBound, int coordinate, double tolerance) |
Initializes a Dirichlet 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) |