//Example 3.1: Peak value of diode current and maximum reverse voltage //v_s is sinusoidal input voltage with peak 24V //battery charges to 12V I_d=(24-12)/100 max_v_rev=24+12; disp(I_d,"peak value of diode current (A)", max_v_rev,"maximum reverse voltage acrossthe diode (V)")