Table of Contents

Interface IMultiScalePDE<T>

Namespace
AiDotNet.PhysicsInformed.Interfaces
Assembly
AiDotNet.dll

Defines the interface for multi-scale Partial Differential Equations.

public interface IMultiScalePDE<T> : IPDESpecification<T>

Type Parameters

T

The numeric type (float, double, etc.) used for calculations.

Inherited Members

Remarks

For Beginners: Multi-scale PDEs describe phenomena that occur across multiple length or time scales. Examples include:

  • Turbulent flows (large eddies to small vortices)
  • Materials science (atomic to macroscopic behavior)
  • Climate modeling (local weather to global patterns)
  • Biological systems (molecular to tissue level)

Why Multi-scale is Challenging: Traditional single-scale methods struggle because:

  1. Fine scale requires tiny mesh elements (expensive)
  2. Coarse scale misses important details
  3. Different scales have different time dynamics

Multi-scale Solution Strategy:

  1. Decompose solution into scale components: u = u_coarse + u_fine
  2. Learn each scale with appropriate resolution
  3. Couple scales through cross-scale interactions
  4. Use appropriate loss weights for each scale

Key Concepts:

  • Characteristic Length Scale: The typical size of features at each scale
  • Scale Separation: When scales are well-separated (e.g., 10x ratio)
  • Cross-scale Coupling: How different scales interact
  • Homogenization: Averaging fine-scale behavior for coarse-scale equations

Properties

NumberOfScales

Gets the number of scales in the problem.

int NumberOfScales { get; }

Property Value

int

Remarks

For Beginners: This indicates how many distinct length/time scales are present. For example:

  • 2 scales: macro + micro (common in composite materials)
  • 3 scales: macro + meso + micro (turbulence modeling)

ScaleCharacteristicLengths

Gets the characteristic length scales of the problem.

T[] ScaleCharacteristicLengths { get; }

Property Value

T[]

Remarks

For Beginners: Characteristic lengths define the "size" of each scale. Example for a composite material:

  • ScaleCharacteristics[0] = 1.0 (macroscopic, meters)
  • ScaleCharacteristics[1] = 0.001 (fiber scale, millimeters)
  • ScaleCharacteristics[2] = 0.000001 (molecular scale, micrometers)

Methods

ComputeScaleCoupling(int, int, T[], T[], T[], PDEDerivatives<T>, PDEDerivatives<T>)

Computes the coupling term between two scales.

T ComputeScaleCoupling(int coarseIndex, int fineIndex, T[] inputs, T[] coarseOutputs, T[] fineOutputs, PDEDerivatives<T> coarseDerivatives, PDEDerivatives<T> fineDerivatives)

Parameters

coarseIndex int

Index of the coarser scale.

fineIndex int

Index of the finer scale.

inputs T[]

The coordinates.

coarseOutputs T[]

Solution at the coarse scale.

fineOutputs T[]

Solution at the fine scale.

coarseDerivatives PDEDerivatives<T>

Derivatives at the coarse scale.

fineDerivatives PDEDerivatives<T>

Derivatives at the fine scale.

Returns

T

The coupling residual (should be zero when scales are properly coupled).

Remarks

For Beginners: Coupling terms ensure consistency between scales. For example, in homogenization:

  • Coarse scale "sees" averaged effect of fine scale
  • Fine scale is modulated by coarse scale gradient

Mathematically:

  • Upscaling: Average fine-scale solution matches coarse-scale solution
  • Downscaling: Fine-scale boundary conditions come from coarse-scale solution

ComputeScaleResidual(int, T[], T[], PDEDerivatives<T>)

Computes the PDE residual at a specific scale.

T ComputeScaleResidual(int scaleIndex, T[] inputs, T[] outputs, PDEDerivatives<T> derivatives)

Parameters

scaleIndex int

The index of the scale (0 = coarsest, increasing = finer).

inputs T[]

The spatial and temporal coordinates.

outputs T[]

The predicted solution values at this scale.

derivatives PDEDerivatives<T>

The derivatives of the solution at this scale.

Returns

T

The PDE residual at this scale.

GetScaleLossWeight(int)

Gets the recommended loss weight for each scale.

T GetScaleLossWeight(int scaleIndex)

Parameters

scaleIndex int

The scale index.

Returns

T

Recommended weight for this scale's loss contribution.

Remarks

For Beginners: Different scales may need different loss weights because:

  • Coarse scale dominates in magnitude
  • Fine scale captures important details
  • Imbalanced gradients can cause training difficulties

Common strategies:

  • Weight proportional to 1/scale_length (finer scales get higher weights)
  • Adaptive weighting based on gradient magnitudes

GetScaleOutputDimension(int)

Gets the output dimension for a specific scale.

int GetScaleOutputDimension(int scaleIndex)

Parameters

scaleIndex int

The scale index.

Returns

int

Number of output components at this scale.

Remarks

Different scales may have different output dimensions. For example, in turbulence:

  • Coarse scale: mean velocity (3 components)
  • Fine scale: velocity fluctuations (3 components) + Reynolds stresses (6 components)