The first function is required where a significant amount of energy storage takes place in the reservoir capacitor. This is initially empty and fills rapidly at switch-on. An uncontrolled current surge can damage components in its path, including the rectifier diodes, so the resistor restricts the peak current value. In doing so, it dissipates an energy equal to the energy stored in the fully charged capacitor. This energy, in joules, is calculated as one half of the capacitance value, in farads, multiplied by the square of the voltage value, in volts. If this energy is greater than a few tenths of a joule, or if the peak power is high, it is generally advisable to select wirewound technology.