A simple implementation of a Physics-Informed Neural Network (PINN) to predict the temperature of a cooling cup of coffee, based on [1].
We consider a cooling coffee cup and try to predict the temperature of the coffee after 10-15 mins. We make 10 measurements in the first 5 mins and we don't want to wait any longer, so we train a neural network (NN) to predict the temperature for us.
We assume the coffee cools following a simple Newton's cooling law:
where
We include the PDE, the equation presented above, in the loss function of the NN. This works as a regularizer for the network and helps it follow the physics where data is missing as visualized below.
[1] Physics-informed Neural Networks: a simple tutorial with PyTorch