Hi, I'm already develop a circuit that you mention.
Use that YouTube reference: https://youtu.be/m74lMUmmbX0
That is a master degree class, and that channel has a continuity of the development of simulation like that you want.
If help you, I suggest you subscribe. The only problem is the language of the video, but is simple you find the papers of Marcelo Vilalva for read and implemented youself (there's also a plecs demo based in that work).