Hi Sourav,
Are you looking for a solution similar to How to identify the highest value of a signal over time? - #2 by Kris_Eberle ?
If however, you are looking at a grid connected converter and need to know the peak voltage of your grid you could use the PLECS “Single-Phase PLL” component.
Could you provide a bit more detail on the application? It would be easier to suggest a solution with more context. For example, a peak detection algorithm implemented on a digital microcontroller would be modeled differently than one for an analog peak detection circuit.