How to use the andes.consts.Fy0 function in andes

To help you get started, we’ve selected a few andes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cuihantao / andes / andes / models / vsc.py View on Github external
def voltage_jac0(self, dae):
        dae.add_jac(Gy0, -self.u - 1e-6, self.ref2, self.ref2)
        dae.add_jac(Gy0, -self.KQ, self.ref2, self.q)
        dae.add_jac(Gy0, self.Kp2, self.Idref, self.ref2)
        dae.add_jac(Gy0, -self.Kp2, self.Idref, self.vd)
        dae.add_jac(Gy0, -self.u - 1e-6, self.Idref, self.Idref)
        dae.add_jac(Gy0, -self.u - 1e-6, self.Iqref, self.Iqref)
        dae.add_jac(Gy0, -self.Kp3, self.Iqref, self.vq)

        dae.add_jac(Gx0, 1, self.Idref, self.Nd)
        dae.add_jac(Gx0, 1, self.Iqref, self.Nq)

        dae.add_jac(Fy0, mul(self.Ki2, self.u), self.Nd, self.ref2)
        dae.add_jac(Fy0, -mul(self.Ki2, self.u), self.Nd, self.vd)
        dae.add_jac(Fy0, -mul(self.Ki3, self.u), self.Nq, self.vq)
github cuihantao / andes / andes / models / measurement.py View on Github external
def jac0(self, dae):
        dae.add_jac(Fy0, self.iTv, self.vm, self.v)
        dae.add_jac(Fx0, -self.iTv + 1e-6, self.vm, self.vm)

        dae.add_jac(Fy0, self.iTa, self.am, self.a)
        dae.add_jac(Fx0, -self.iTa + 1e-6, self.am, self.am)
github cuihantao / andes / andes / models / synchronous.py View on Github external
def jac0(self, dae):
        wn = mul(self.system.wb, self.u)
        dae.add_jac(Fy0, wn, self.psid, self.vd)

        dae.add_jac(Fy0, wn, self.psiq, self.vq)
github cuihantao / andes / andes / models / synchronous.py View on Github external
dae.add_jac(Gy0, mul(self.u, self.xd2) + 1e-6, self.Id, self.Id)
        dae.add_jac(Gx0, -self.u, self.Id, self.e2q)

        dae.add_jac(Gy0, mul(self.u, self.xq2) + 1e-6, self.Iq, self.Iq)
        dae.add_jac(Gx0, self.u, self.Iq, self.e2d)

        dae.add_jac(Fx0, -mul(self.u, self.b3) + 1e-6, self.e1d, self.e1d)
        dae.add_jac(Fy0, mul(self.u, self.b4), self.e1d, self.Iq)

        dae.add_jac(Fx0, -mul(self.u, self.a4) + 1e-6, self.e1q, self.e1q)
        dae.add_jac(Fy0, mul(self.u, self.a6), self.e1q, self.vf)
        dae.add_jac(Fy0, -mul(self.u, self.a5), self.e1q, self.Id)

        dae.add_jac(Fx0, -mul(self.u, self.b1) + 1e-6, self.e2d, self.e2d)
        dae.add_jac(Fx0, mul(self.u, self.b1), self.e2d, self.e1d)
        dae.add_jac(Fy0, mul(self.u, self.b2), self.e2d, self.Iq)

        dae.add_jac(Fx0, -mul(self.u, self.a1) + 1e-6, self.e2q, self.e2q)
        dae.add_jac(Fx0, mul(self.u, self.a1), self.e2q, self.e1q)
        dae.add_jac(Fy0, mul(self.u, self.a3), self.e2q, self.vf)
        dae.add_jac(Fy0, -mul(self.u, self.a2), self.e2q, self.Id)
github cuihantao / andes / andes / models / coi.py View on Github external
def jac0(self, dae):
        dae.add_jac(Gy0, 1, self.omega, self.omega)
        dae.add_jac(Gy0, 1, self.delta, self.delta)

        dae.add_jac(Gy0, self.iTd, self.dwdt, self.omega)
        dae.add_jac(Gx0, -1, self.dwdt, self.xdw)

        dae.add_jac(Fy0, self.iTd**2, self.xdw, self.omega)
        dae.add_jac(Fx0, -self.iTd, self.xdw, self.xdw)

        dae.add_jac(Gy0, -1, self.dwdt, self.dwdt)
github cuihantao / andes / andes / models / avr.py View on Github external
def jac0(self, dae):
        dae.add_jac(Gy0, -1, self.vref, self.vref)
        dae.add_jac(Gx0, -self.u0, self.vf, self.vfout)
        dae.add_jac(Fx0, -div(1, self.Tr), self.vm, self.vm)
        dae.add_jac(Fx0, -mul(self.Ka, self.iTa), self.vr1, self.vm)
        dae.add_jac(Fx0, -mul(self.Ka, self.iTa), self.vr1, self.vr2)
        dae.add_jac(Fx0, -div(1, self.Ta), self.vr1, self.vr1)
        dae.add_jac(Fx0, -mul(self.Ka, self.KfTf, self.iTa), self.vr1,
                    self.vfout)
        dae.add_jac(Fx0, -div(1, self.Tf), self.vr2, self.vr2)
        dae.add_jac(Fx0, -mul(self.KfTf, div(1, self.Tf)), self.vr2,
                    self.vfout)
        dae.add_jac(Fy0, div(1, self.Tr), self.vm, self.v)
        dae.add_jac(Fy0, mul(self.Ka, self.iTa), self.vr1, self.vref)
github cuihantao / andes / andes / models / pss.py View on Github external
dae.add_jac(Fx0, -mul(self.H3, self.u0, div(1, self.H4)), self.q3,
                    self.q3)
        dae.add_jac(Fx0, -mul(self.u0, div(1, self.H4)), self.q3, self.q0)
        dae.add_jac(Fx0, -mul(self.H2, self.u0, div(1, self.H4)), self.q3,
                    self.q2)
        dae.add_jac(Fx0, -mul(self.H1, self.u0, div(1, self.H4)), self.q3,
                    self.q1)
        dae.add_jac(Fx0, -mul(self.u0, div(1, self.T2)), self.x1, self.x1)
        dae.add_jac(Fx0, -mul(self.u0, div(1, self.T4)), self.x2, self.x2)
        dae.add_jac(Fx0, -mul(self.u0, div(1, self.T6)), self.x3, self.x3)
        dae.add_jac(Fy0, mul(self.u0, div(1, self.H4)), self.q3, self.In)
        dae.add_jac(Fy0, mul(self.u0, div(1, self.T2), 1 - self.T12), self.x1,
                    self.v1)
        dae.add_jac(Fy0, mul(self.u0, div(1, self.T4), 1 - self.T34), self.x2,
                    self.v2)
        dae.add_jac(Fy0, mul(self.KsT56, self.u0, div(1, self.T6)), self.x3,
                    self.v3)
        dae.add_jac(Gy0, 1e-6, self.In, self.In)
        dae.add_jac(Gy0, 1e-6, self.v1, self.v1)
        dae.add_jac(Gy0, 1e-6, self.v2, self.v2)
        dae.add_jac(Gy0, 1e-6, self.v3, self.v3)
        dae.add_jac(Gy0, 1e-6, self.v4, self.v4)
        dae.add_jac(Gy0, 1e-6, self.vss, self.vss)
        dae.add_jac(Gy0, 1e-6, self.vst, self.vst)
github cuihantao / andes / andes / models / wind.py View on Github external
def jac0(self, dae):
        dae.add_jac(Gy0, -1, self.ws, self.ws)
        dae.add_jac(Fx0, -self.iT, self.vw, self.vw)
        dae.add_jac(Fy0, self.iT, self.vw, self.ws)
github cuihantao / andes / andes / models / pss.py View on Github external
dae.add_jac(Fx0, -mul(self.u0, div(1, self.T2)), self.x2, self.x2)
        dae.add_jac(Fx0, -mul(self.u0, div(1, self.T4)), self.u3, self.u3)
        dae.add_jac(Fx0, -mul(self.u0, div(1, self.T6)), self.u4, self.u4)
        dae.add_jac(Fx0, -mul(self.u0, div(1, self.T8)), self.u5, self.u5)
        dae.add_jac(Fx0, -mul(self.u0, div(1, self.T10)), self.u6, self.u6)
        dae.add_jac(Fy0, mul(self.K1, self.u0, div(1, self.T1)), self.x1,
                    self.In1)
        dae.add_jac(Fy0, mul(self.K2, self.u0, div(1, self.T2)), self.x2,
                    self.In2)
        dae.add_jac(Fy0, mul(self.T34, self.u0, div(1, self.T4)), self.u3,
                    self.In)
        dae.add_jac(Fy0, mul(self.u0, div(1, self.T6), 1 - self.T56), self.u4,
                    self.x3)
        dae.add_jac(Fy0, mul(self.u0, div(1, self.T8), 1 - self.T78), self.u5,
                    self.x4)
        dae.add_jac(Fy0, mul(self.u0, div(1, self.T10), 1 - self.T910),
                    self.u6, self.x5)
        dae.add_jac(Gy0, 1e-6, self.In1, self.In1)
        dae.add_jac(Gy0, 1e-6, self.In2, self.In2)
        dae.add_jac(Gy0, 1e-6, self.In, self.In)
        dae.add_jac(Gy0, 1e-6, self.x3, self.x3)
        dae.add_jac(Gy0, 1e-6, self.x4, self.x4)
        dae.add_jac(Gy0, 1e-6, self.x5, self.x5)
        dae.add_jac(Gy0, 1e-6, self.x6, self.x6)
        dae.add_jac(Gy0, 1e-6, self.vss, self.vss)
        dae.add_jac(Gy0, 1e-6, self.vst, self.vst)
github cuihantao / andes / andes / models / measurement.py View on Github external
def jac0(self, dae):
        dae.add_jac(Fy0, mul(self.iTf**2, self.iwn), self.xt, self.a)
        dae.add_jac(Fx0, -self.iTf, self.xt, self.xt)

        dae.add_jac(Fx0, -self.iTw, self.w, self.w)

        dae.add_jac(Fx0, -self.iTw, self.w, self.xt)
        dae.add_jac(Fy0, mul(self.iTw, self.iwn, self.iTf), self.w, self.a)

        dae.add_jac(Gx0, self.iTd, self.dwdt, self.w)
        dae.add_jac(Gx0, -1, self.dwdt, self.xdw)

        dae.add_jac(Fx0, self.iTd**2, self.xdw, self.w)
        dae.add_jac(Fx0, -self.iTd, self.xdw, self.xdw)

        dae.add_jac(Gy0, -1, self.dwdt, self.dwdt)