Skip to content
All work
  • NTNU
  • TMA4320 Introduction to Scientific Computing
  • Group of 3
  • Grade A

Physics-Informed Neural Networks for Indoor Temperature

How warm is it in every corner of a room when you only have nine sensors? We trained a neural network to fill in the gaps, and on its own it invented temperature patterns that are physically impossible. Teaching it the law of how heat spreads fixed that.

Team
Group of 3, with Andrine Holen and Emily Ann Mercer. We each worked through every task, compared approaches and results, and then split the final write-up.
Period
Feb 2026
Status
Completed
Grade
A
Tools
Python · JAX · NumPy · matplotlib · pytest

Problem

To heat a building efficiently you need to know the temperature everywhere, but in practice you only have a few imprecise sensors and do not know the physical parameters. The task: reconstruct the temperature in a 10 × 5 m room over 24 hours from nine noisy sensors, and try to learn the unknown parameters at the same time.

heat equation
∂T∂t=αΔT+q(x,y)\frac{\partial T}{\partial t} = \alpha \Delta T + q(x,y)

Technical skills

  • Finite-difference methods for partial differential equations (implicit Euler, Robin boundary conditions)
  • Neural networks in JAX: forward pass, training loop, JIT compilation
  • Automatic differentiation and vectorisation (grad, vmap)
  • Physics-informed loss functions and parameter estimation
  • Gradient-based optimisation with Adam
  • Hyperparameter studies and visualising results with matplotlib
  • Structured Python projects with configuration files and automated tests (pytest)

Approach

  1. Numerical reference

    An implicit finite-difference solver gives the 'true' temperature and generates synthetic sensor data.

  2. Neural network

    A small fully connected network in JAX learns temperature as a function of position and time, from sensor data only.

  3. Physics-informed network

    The same network, but the loss also penalises violations of the heat equation and boundary conditions, computed with automatic differentiation. The unknown physical parameters are learned alongside.

  4. Experiments

    Varying sensor density, noise, network size, training length, learning rate and loss weights.

Diagram of a fully connected neural network with inputs x, y and t, three hidden layers and output temperature T.
The network maps position and time (x,y,t)(x, y, t) to temperature TT.[Figure from the TMA4320 assignment text]

Results

Numerical solution
Finite-difference solution: a round warm area centred on the heat source.
Neural network
Neural network prediction: a diagonal warm band across the room.
PINN
PINN prediction: a smooth warm area around the heat source.
The temperature in the room after 24 hours, from the same nine sensors. A plain neural network (middle) draws a warm stripe that cannot happen physically. When it also has to obey the heat equation (right), it gets close to the correct answer (left).[Report figure]

The full results, code and report are on GitHub.

See the project on GitHub (opens in new tab)