I want to implement a Control House Heating System using Nonlinear MPC with data-driven methods, using CasADi. I have a system with a state x(t), which is the internal temperature. The first input is a measured disturbance, and the second is a manipulated variable. For this, I want to train a PyTorch network that is traceable and differentiable so that I can use it with CasADi (L4CasADi). I’ve tried to follow this code l4CasADi, but I’m not sure how to handle the measured disturbance. Does anyone have any ideas or could help me with this?