Many biological species possess a circadian clock, which helps them anticipate daily variations in the environment. In the absence of external stimuli, the rhythm persists autonomously with a period of approximately 24 h. However, single pulses of light, nutrients, chemicals or temperature can shift the clock phase. In the case of light- and temperature-cycles, this allows entrainment of the clock to cycles of exactly 24 h. Circadian clocks have the remarkable property of temperature compensation, that is, the period of the circadian rhythm remains relatively constant within a physiological range of temperatures. For several organisms, temperature-regulated processes within the circadian clock have been identified in recent years. However, how these processes contribute to temperature compensation is not fully understood. Here, we theoretically investigate temperature compensation in general oscillatory systems. It is known that every oscillator can be locally temperature compensated around a reference temperature, if reactions are appropriately balanced. A balancing is always possible if the control coefficient with respect to the oscillation period of at least one reaction in the oscillator network is positive. However, for global temperature compensation, the whole physiological temperature range is relevant. Here, we use an approach which leads to an optimization problem subject to the local balancing principle. We use this approach to analyse different circadian clock models proposed in the literature and calculate activation energies that lead to temperature compensation.