The variable voltage source block is a model for a controlled AC voltage source. This component provides a sinosoid voltage across its ports. The amplitude of the output voltage is governed by the explicit input and the frequency is defined by the user. The ohmic resistance of the block is zero.
Set voltage source parameter | |
Frequency (Hz) | 50 |
class VVsourceAC "Sin-wave voltage source" Pin p, n; Real v; Real VA "voltage"; parameter Real f = 50 "Frequency"; parameter Real PI=3.141592653589793; equation v = VA*Modelica.Math.sin(2*PI*f*time); v = p.v - n.v; 0 = p.i + n.i; end VVsourceAC;