In the SimPowerSystems library there is a block for that. It is called "Discrete PLL-Driven Fundamental Value" and it is found in SPS->Extra Library->Discrete Measuremenent
you need to provide the expected frequency and a sin and a cos as reference to evaluate the angle.
If the frequency is unknown you'll need a second PLL which could provide this information. Just keep in mind that those block use PI controller and their dynamic might be a bit slow sometime
Great thanks dear Luc-Andre .. Great thanks dear sir.
I found the block and now using it. But, I didn't get the point of (sin and cos inputs). May you please shed more light .. To try it, when I put 0 and 1 as inputs for the sin and cos I get angle 90, and when I put 1 and 0 instead, I get angle 0. I realized that this is not the right way for their inputs. What to put as an input for sin and cos? On the other hand, value of the magnitude which I obtained is double the correct value ..
I think that tool block is just ideal block diagram. If you want to calculate angle please derived transfer function of that circuit as a ratio of voltage in frequency domain as a numerator polynomial and denominator polynomial in closed form . For typical , you can plot graph as a magnitude response and phase response of voltage gain as a function of input frequency in frequency domain. If you want to see the waveform why does it lag or lead in angle in time domain . You just you inverse Laplace's transform for continuous time system or Z's transform of E. I. Jury for discrete time system