I have the software/ hardware part worked out. It's just that along the way I realized that I really don't know the answer to the basic question; why isn't the effective dc voltage equal to the area under ac curve, but instead the rms value.