Thermal Throttle Simulator

Medium Python Power Asked at Intel
Solve this problem

Model a CPU that heats under load and throttles its clock when it exceeds a temperature limit, then settles into a steady state. Report the sustained clock frequency.

Constraints

  • First-order thermal model: temperature rises proportionally to power and decays toward ambient.
  • Power is proportional to the clock frequency.
  • When temperature exceeds the limit, reduce the clock by 10 percent per step.
  • When it falls 5 degrees below the limit, restore 5 percent per step, capped at the base clock.
  • Return the average clock over the final quarter of the simulation.
Starter codePython
1def simulate_throttle(base_clock_mhz, t_limit_c, ambient_c=25.0, steps=1000):2    # TODO3    return 0.0