How to use the andes.consts.Gx0 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 / governor.py View on Github external
def jac0(self, dae):
        super(TG2, self).jac0(dae)
        dae.add_jac(Fx0, -self.iT2, self.xg, self.xg)
        dae.add_jac(Fx0, -mul(self.iT2, self.gain, 1 - self.T12), self.xg,
                    self.omega)

        dae.add_jac(Gx0, 1.0, self.pout, self.xg)
        dae.add_jac(Gx0, -mul(self.gain, self.T12), self.pout, self.omega)
        dae.add_jac(Gy0, -1.0, self.pout, self.pout)
github cuihantao / andes / andes / models / pss.py View on Github external
dae.add_jac(Gy0, -self.u0, self.v2, self.v2)
        dae.add_jac(Gy0, -self.u0, self.v3, self.v3)
        dae.add_jac(Gy0, mul(self.T34, self.u0), self.v3, self.v2)
        dae.add_jac(Gy0, -self.u0, self.v4, self.v4)
        dae.add_jac(Gy0, mul(self.KsT56, self.u0), self.v4, self.v3)
        dae.add_jac(Gy0, self.u0, self.vss, self.v4)
        dae.add_jac(Gy0, -self.u0, self.vss, self.vss)
        dae.add_jac(Gy0, -self.u0, self.vst, self.vst)
        dae.add_jac(Gy0, self.u0, self.vst, self.vss)
        dae.add_jac(Gy0, self.u0, self.vf, self.vst)
        dae.add_jac(Gx0, mul(self.Ic2, self.u0), self.In, self.w)
        dae.add_jac(Gx0, mul(self.Ic1, self.u0), self.In, self.omega)
        dae.add_jac(Gx0, mul(self.A5, self.u0), self.v1, self.q1)
        dae.add_jac(Gx0, self.u0, self.v1, self.q0)
        dae.add_jac(Gx0, mul(self.A6, self.u0), self.v1, self.q2)
        dae.add_jac(Gx0, self.u0, self.v2, self.x1)
        dae.add_jac(Gx0, self.u0, self.v3, self.x2)
        dae.add_jac(Gx0, -self.u0, self.v4, self.x3)
        dae.add_jac(Fx0, self.u0, self.q0, self.q1)
        dae.add_jac(Fx0, self.u0, self.q1, self.q2)
        dae.add_jac(Fx0, self.u0, self.q2, self.q3)
        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)
github cuihantao / andes / andes / models / windturbine.py View on Github external
dae.add_jac(Gy0, -self.rs, self.isq, self.isq)
        dae.add_jac(Gy0, -1, self.vrd, self.vrd)
        dae.add_jac(Gy0, -1, self.vrq, self.vrq)
        dae.add_jac(Gy0, -1, self.vsd, self.vsd)
        dae.add_jac(Gy0, -1, self.vsq, self.vsq)
        dae.add_jac(Gy0, -1, self.vref, self.vref)
        dae.add_jac(Gy0, -1, self.pwa, self.pwa)
        dae.add_jac(Gy0, -1, self.pw, self.pw)
        dae.add_jac(Gy0, -1, self.cp, self.cp)
        dae.add_jac(Gy0, -1, self.lamb, self.lamb)
        dae.add_jac(Gy0, -1, self.ilamb, self.ilamb)
        dae.add_jac(Gx0, self.xmu, self.isd, self.irq)
        dae.add_jac(Gx0, -self.xmu, self.isq, self.ird)
        dae.add_jac(Gx0, -self.rr, self.vrd, self.ird)
        dae.add_jac(Gx0, -self.rr, self.vrq, self.irq)
        dae.add_jac(Gx0, 2, self.pwa, self.omega_m)
        dae.add_jac(Fx0, -div(1, self.Tp), self.theta_p, self.theta_p)
        dae.add_jac(Fx0, mul(self.Kp, self.phi, div(1, self.Tp)), self.theta_p,
                    self.omega_m)
        dae.add_jac(Fx0, -div(1, self.Ts), self.ird, self.ird)
        dae.add_jac(Fx0, -div(1, self.Te), self.irq, self.irq)
        dae.add_jac(Fy0, -mul(self.KV, div(1, self.Ts)), self.ird, self.vref)
        dae.add_jac(Fy0, mul(div(1, self.Ts), self.KV - div(1, self.xmu)),
                    self.ird, self.v)
        dae.add_jac(Gy0, 1e-6, self.isd, self.isd)
        dae.add_jac(Gy0, 1e-6, self.isq, self.isq)
        dae.add_jac(Gy0, 1e-6, self.vrd, self.vrd)
        dae.add_jac(Gy0, 1e-6, self.vrq, self.vrq)
        dae.add_jac(Gy0, 1e-6, self.vsd, self.vsd)
        dae.add_jac(Gy0, 1e-6, self.vsq, self.vsq)
        dae.add_jac(Gy0, 1e-6, self.vref, self.vref)
        dae.add_jac(Gy0, 1e-6, self.pwa, self.pwa)
github cuihantao / andes / andes / models / synchronous.py View on Github external
def jac0(self, dae):
        super(Ord6a, self).jac0(dae)
        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)
github cuihantao / andes / andes / models / synchronous.py View on Github external
def jac0(self, dae):
        super(Ord6a, self).jac0(dae)
        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 / dcbase.py View on Github external
def jac0(self, dae):
        dae.add_jac(Gx0, self.u, self.Idc, self.IL)
        dae.add_jac(Gy0, self.u, self.Idc, self.Idc)
        dae.add_jac(Fy0, self.iL, self.IL, self.v1)
        dae.add_jac(Fy0, -self.iL, self.IL, self.v2)
        dae.add_jac(Gy0, -self.u, self.v1, self.Idc)
        dae.add_jac(Gy0, self.u, self.v2, self.Idc)
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)
github cuihantao / andes / andes / models / pss.py View on Github external
dae.add_jac(Gy0, -self.u0, self.In, self.In)
        dae.add_jac(Gy0, -self.u0, self.x3, self.x3)
        dae.add_jac(Gy0, mul(self.T34, self.u0), self.x3, self.In)
        dae.add_jac(Gy0, mul(self.T56, self.u0), self.x4, self.x3)
        dae.add_jac(Gy0, -self.u0, self.x4, self.x4)
        dae.add_jac(Gy0, -self.u0, self.x5, self.x5)
        dae.add_jac(Gy0, mul(self.T78, self.u0), self.x5, self.x4)
        dae.add_jac(Gy0, -self.u0, self.x6, self.x6)
        dae.add_jac(Gy0, mul(self.T910, self.u0), self.x6, self.x5)
        dae.add_jac(Gy0, self.u0, self.vss, self.x6)
        dae.add_jac(Gy0, -self.u0, self.vss, self.vss)
        dae.add_jac(Gy0, self.u0, self.vst, self.vss)
        dae.add_jac(Gy0, -self.u0, self.vst, self.vst)
        dae.add_jac(Gy0, self.u0, self.vf, self.vst)
        dae.add_jac(Gx0, mul(self.Ic11, self.u0), self.In1, self.omega)
        dae.add_jac(Gx0, mul(self.Ic12, self.u0), self.In1, self.w)
        dae.add_jac(Gx0, mul(self.Ic21, self.u0), self.In2, self.omega)
        dae.add_jac(Gx0, mul(self.Ic22, self.u0), self.In2, self.w)
        dae.add_jac(Gx0, -self.u0, self.x3, self.u3)
        dae.add_jac(Gx0, self.u0, self.x4, self.u4)
        dae.add_jac(Gx0, self.u0, self.x5, self.u5)
        dae.add_jac(Gx0, self.u0, self.x6, self.u6)
        dae.add_jac(Fx0, -mul(self.u0, div(1, self.T1)), self.x1, self.x1)
        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)
github cuihantao / andes / andes / models / vsc.py View on Github external
def speed_jac0(self, dae):
        dae.add_jac(Gy0, -self.u - 1e-6, self.ref1, self.ref1)
        dae.add_jac(Gx0, self.u, self.ref1, self.xw)
        dae.add_jac(Fy0, self.u, self.adq, self.ref1)
        dae.add_jac(Fx0, -mul(self.D, self.iM, self.u), self.xw, self.xw)
        dae.add_jac(Fy0, -mul(self.iM, self.u), self.xw, self.p)
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)