Approximated sawtooth wave is generated based on the mathematical principle of being equal to a sine wave at the same frequency (50Hz) and infinite sum of multiple frequency sine waves with diminishing amplitude.
sawtooth wave =
(1/pi)*(1V)*(sine at 50Hz) +
(1/pi)*(1/2V)*(sine at 100Hz) +
(1/pi)*(1/3V)*(sine at 150Hz) +
(1/pi)*(1/4V)*(sine at 200Hz) +
(1/pi)*(1/5V)*(sine at 250Hz) + ...