If you reverse the polarity of the diode across the regulator it has the function to protect the regulator itself against the reverse current. If that diode is not present, the output capacitor could discharge through the regulator, so that the current will flows from the output towards the input of the regulator an can damage it. Usually this protection isn't really needed since the Vout-Vin is no high enough to damage the component since the capacitor will start to discharge toward the load.
I noticed that you supply the regulator by means an AC generator. I suppose it's a DC generator with superimposed a sinwave simulating the ripple in output of a Graetz bridge.