Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Solve Heat PDE with PINNs

MediumMachine Learning00:00
Practice interviewer
In session
5 left
00:00

Your question is Solve Heat PDE with PINNs. Take a moment with it on the right.

Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).

You need to log in / sign up to chat or submit.

Problem

Business Context

ThermaGrid, an industrial simulation software company, wants a fast surrogate model for 1D heat diffusion in metal rods used in manufacturing calibration workflows. Finite-difference solvers are accurate but too slow to run repeatedly during parameter sweeps, so the team wants a Physics-Informed Neural Network (PINN) that learns the temperature field while respecting the governing PDE.

Dataset

The training data combines sparse sensor observations with collocation points sampled from the physical domain. The goal is to predict temperature u(x,t)u(x,t)u(x,t) over space and time while enforcing the heat equation ut=αuxxu_t = \alpha u_{xx}ut​=αuxx​.

Data GroupSizeDescription
Sensor observations8,000 rowsNoisy measurements of temperature at selected (x,t)(x,t)(x,t) points
Initial condition points500 rowsTemperature profile at t=0t=0t=0
Boundary condition points1,000 rowsTemperatures at x=0x=0x=0 and x=1x=1x=1 across time
PDE collocation points50,000 rowsUnlabeled (x,t)(x,t)(x,t) samples used to minimize PDE residual
  • Domain: x∈[0,1]x \in [0,1]x∈[0,1], t∈[0,1]t \in [0,1]t∈[0,1]
  • Target: Continuous — temperature u(x,t)u(x,t)u(x,t)
  • Noise: Gaussian sensor noise with standard deviation about 1% of temperature range
  • Missing data: No missing values in coordinates; only collocation points have no direct target labels by design

Success Criteria

A good solution should achieve test MAE below 0.01 on held-out sensor points, PDE residual MSE below 1e-4 on a validation grid, and satisfy boundary and initial conditions within 0.01 absolute error.

Constraints

  • The model must encode physical laws directly in the loss function, not only fit labeled data
  • Training should complete on a single GPU or modern CPU within 2 hours
  • The approach should be explainable to simulation engineers who care about physical consistency

Deliverables

  1. Build a PINN that predicts temperature u(x,t)u(x,t)u(x,t) for the 1D heat equation
  2. Define a loss function combining data loss, boundary loss, initial-condition loss, and PDE residual loss
  3. Explain how automatic differentiation is used to compute utu_tut​ and uxxu_{xx}uxx​
  4. Evaluate predictive accuracy and physical consistency on held-out data
  5. Discuss when a PINN is preferable to a purely data-driven neural network