Thermodynamical analysis of the dynamics of tumor interaction with the host immune system