Lets say I have a house with 2 rooms. One of them has a window that opens and closes T periodically. So the heat influx behavior of the window is like a square wave. There is an air conditioning unit in the other room that I am in control of and I need to turn this air conditioning unit to heat and cool in such a way that I can keep the temperature in both rooms between an upper and a lower threshold, and I need to do this while using as little energy as possible.
The heat in both rooms are modeled by first order differential equations.
Is there a class or specific area of study to approach problems like this? I need some resources.