How to model a single phase half wave rectifier controlled rectifier on arduino?

I am using an arduino uno and I want to model single phase half wave rectifier so as to plot the output of the rectifier on the signal plotter.
The power supply is 50 Hz

The image below shows the graphs I want them to appear on the signal plotter.

Post the code for your best attempt (using code tags), and explain what is giving you trouble.

Look like you are talking about "phase angle voltage controller" from 0 to 180 degree.

There are a lot of "Arduino AC dimmer" on the net. They use the same principle. You can use a diode to rectify afterward.

jremington:
Post the code for your best attempt (using code tags), and explain what is giving you trouble.

I have no even a clue about the code to write but I will try the idea presented by ephitran, thank you all :slight_smile:

An SCR has state, so you have to model the state and detect when it should change.