How to use the andes.consts.Fx0 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 / avr.py View on Github external
def jac0(self, dae):
        dae.add_jac(Gy0, -1, self.vref, self.vref)
        dae.add_jac(Gy0, mul(self.K0, self.T21, self.T43), self.vr, self.vref)
        dae.add_jac(Gy0, -1, self.vr, self.vr)
        dae.add_jac(Gx0, self.T43, self.vr, self.vr1)
        dae.add_jac(Gx0, self.K0, self.vr, self.vr2)
        dae.add_jac(Gx0, -mul(self.K0, self.T21, self.T43), self.vr, self.vm)
        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, -div(1, self.T1), self.vr1, self.vr1)
        dae.add_jac(Fx0, -mul(self.K0, div(1, self.T1), 1 - self.T21),
                    self.vr1, self.vm)
        dae.add_jac(Fx0, mul(div(1, self.K0), div(1, self.T3), 1 - self.T43),
                    self.vr2, self.vr1)
        dae.add_jac(Fx0, -div(1, self.T3), self.vr2, self.vr2)
        dae.add_jac(Fx0, -mul(self.T21, div(1, self.T3), 1 - self.T43),
                    self.vr2, self.vm)
        dae.add_jac(Fy0, div(1, self.Tr), self.vm, self.v)
        dae.add_jac(Fy0, mul(self.K0, div(1, self.T1), 1 - self.T21), self.vr1,
                    self.vref)
        dae.add_jac(Fy0, mul(self.T21, div(1, self.T3), 1 - self.T43),
                    self.vr2, self.vref)
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 / pss.py View on Github external
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)
        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)
github cuihantao / andes / andes / models / governor.py View on Github external
def jac0(self, dae):
        super(TG1, self).jac0(dae)
        dae.add_jac(Gy0, -self.u + 1e-6, self.pin, self.pin)

        dae.add_jac(Gx0, -mul(self.u, self.gain), self.pin, self.omega)
        dae.add_jac(Gy0, mul(self.u, self.gain), self.pin, self.wref)

        dae.add_jac(Fx0, -mul(self.u, self.iTs) + 1e-6, self.xg1, self.xg1)
        dae.add_jac(Fy0, mul(self.u, self.iTs), self.xg1, self.pin)

        dae.add_jac(Fx0, mul(self.u, self.k2, self.iTc), self.xg2, self.xg1)
        dae.add_jac(Fx0, -mul(self.u, self.iTc), self.xg2, self.xg2)

        dae.add_jac(Fx0, mul(self.u, self.k4, self.iT5), self.xg3, self.xg2)
        dae.add_jac(Fx0, mul(self.u, self.k4, self.k1, self.iT5), self.xg3,
                    self.xg1)
        dae.add_jac(Fx0, -mul(self.u, self.iT5), self.xg3, self.xg3)

        dae.add_jac(Gx0, self.u, self.pout, self.xg3)
        dae.add_jac(Gx0, mul(self.u, self.k3), self.pout, self.xg2)
        dae.add_jac(Gx0, mul(self.u, self.k3, self.k1), self.pout, self.xg1)
        dae.add_jac(Gy0, -self.u + 1e-6, self.pout, self.pout)
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 / vsc.py View on Github external
def power_jac0(self, dae):
        dae.add_jac(Gx0, self.iTf, self.dwdt, self.w)
        dae.add_jac(Gx0, -1, self.dwdt, self.xdw)

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

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

        dae.add_jac(Gy0, -self.Ki, self.ref1, self.dwdt)
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 / synchronous.py View on Github external
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 / synchronous.py View on Github external
def jac0(self, dae):
        dae.add_jac(Gy0, -self.u, self.a, self.p)
        dae.add_jac(Gy0, -self.u, self.v, self.q)
        dae.add_jac(Gy0, -self.u + 1e-6, self.vd, self.vd)
        dae.add_jac(Gy0, -self.u + 1e-6, self.vq, self.vq)
        dae.add_jac(Gy0, -1.0, self.p, self.p)
        dae.add_jac(Gy0, -1.0, self.q, self.q)
        dae.add_jac(Gy0, 1.0, self.pm, self.pm)
        dae.add_jac(Gy0, 1.0, self.vf, self.vf)

        dae.add_jac(Fx0, 1e-6, self.delta, self.delta)
        dae.add_jac(Fx0, mul(self.u, self.system.wb), self.delta,
                    self.omega)
github cuihantao / andes / andes / models / pss.py View on Github external
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)
        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)