2025 USA-NA-AIO Round 2, Problem 1, Part 1

Problem 1 (100 points)

Many physics systems are governed by the following type of partial differential equations (PDEs)

F \left( t, \mathbf{r}, u, u_t, u_{tt}, \nabla_{\mathbf{r}} \ u, \nabla^2_{\mathbf{r}} \ u \right) = 0 , \ \forall \ t \in \left[ 0 , T \right], \ \mathbf{r} \in \mathcal S

where

  • t \in \Bbb R: Time.

  • \mathbf{r} \in \Bbb R^3: Position.

  • u \left( t, \mathbf{r} \right) \in \Bbb R: A function of t and \mathbf{r} that is differentiable.

  • u_t: \frac{\partial u}{\partial t}.

  • u_{tt}: \frac{\partial^2 u}{\partial t^2}.

  • \mathcal S: A convex set in \Bbb R^3.

For such a physics system, if we know

  1. Initial condition (IC)

    • u \left( 0, \mathbf{r} \right) for all \mathbf{r} \in \mathcal S.

    • u_t \left( 0, \mathbf{r} \right) for all \mathbf{r} \in \mathcal S (This term is required if u_{tt} appears in F. Otherwise, it is not needed.).

  2. Boundary condition (BC)

    • u \left( t, \mathbf{r} \right) for all t \in \left[ 0 , T \right] and \mathbf{r} \in \text{Boundary} \left( \mathcal S \right).

Then the value of u \left( t , \mathbf{r} \right) for any t \in \left[ 0 , T \right] and \mathbf{r} \in \mathcal S is uniquely determined.

However, many such systems do not admit closed-form solutions. The canonical approach of discretizing a PDE to find numeric solutions has many limitations.

To avoid those challenges, in this problem, you are asked to use the deep neural network approach to solve a physics-informed PDE, hereafter called as Physics-Informed Neural Network (PINN).

In this problem, let us consider the following specific 1-dim thermal system:

  • A 1-dim rod with unit length.

  • The thermal diffusivity is \alpha > 0.

  • Two endpoints of the rod are connected to two heat reservoirs whose temperatures are constant and normalized as 0.

  • At time t = 0, the temperature distribution on the rod follows a sinusoidal pattern.

Denote by u \left( t, x \right) the temperature at time t on position x in the rod.

Thus, u \left( t, x \right) satisfies:

  1. PDE

    u_t - \alpha \ u_{xx} = 0 , \ x \in \left[ 0, 1 \right] , \ t \in \left[ 0, 1 \right] ,

    where

    • u_t: \frac{\partial u}{\partial t}.

    • u_x: \frac{\partial u}{\partial x}.

    • u_{xx}: \frac{\partial^2 u}{\partial x^2}.

  2. IC

    u \left( 0, x \right) = \sin \left( \pi x \right) , \ \forall \ x \in \left[ 0, 1 \right] .
  3. BC

    u \left( t, 0 \right) = u \left( t, 1 \right) = 0 , \ \forall \ t \in \left[ 0, 1 \right] .

Before starting this problem, make sure to run the following code first without any change:

import torch
import torch.nn as nn
from torch.utils.data import DataLoader, Dataset
import torch.optim as optim
import torch.autograd as autograd
import matplotlib.pyplot as plt
import numpy as np
from tqdm import tqdm

\color{red}{\text{WARNING !!!}}

  • Beyond importing libraries/modules/classes/functions in the preceeding cell, you are NOT allowed to import anything else for the following purposes:

    • As a part of your final solution. For instance, if a problem asks you to build a model without using sklearn but you use it, then you will not earn points.

    • Temporarily import something to assist you to get a solution. For instance, if a problem asks you to manually compute eigenvalues but you temporarily use np.linalg.eig to get an answer and then delete your code, then you violate the rule.

    Rule of thumb: Each part has its particular purpose to intentionally test you something. Do not attempt to find a shortcut to circumvent the rule.

Part 1 (10 points, non-coding task)

Prove that the solution to the above PDE, IC, and BC takes the following form:

u \left( t, x \right) = e^{- \alpha \pi^2 t} \sin \left( \pi x \right) .
  • Reasoning is required.

  • This part is used for the purpose of verifying the correctness of our subsequent PINN solution.

\color{green}{\text{### WRITE YOUR SOLUTION HERE ###}}

First, we have

\begin{align*} u_t \left( t, x \right) & = - \alpha \pi^2 u \left( t, x \right) \end{align*}

and

\begin{align*} u_{xx} \left( t, x \right) & = - \pi^2 u \left( t, x \right) . \end{align*}

Hence, u \left( t, x \right) satisfies the PDE.

Second,

\begin{align*} u \left( 0, x \right) & = \sin \left( \pi x \right) . \end{align*}

Hence, u \left( t, x \right) satisfies the IC.

Third,

\begin{align*} u \left( t, 0 \right) & = u \left( t, 1\right) = 0 . \end{align*}

Hence, u \left( t, x \right) satisfies the BC.

\color{red}{\text{""" END OF THIS PART """}}