Ejemplo n.º 1
0
def test_run():
    c = CRN()

    c.r("P1 > m1 + P1", 0.01)
    c.r("m1 > ", 0.01)
    c.r("P1 + m2 <> PR1", [0.001, 0.001])

    c.set_state({"P1": 1})

    df = c.run(750)

    gradient(df, 'time', 1)
    gradient(df, 'time', 2)

    plot(df, 'time', c.E)
Ejemplo n.º 2
0
def test_run():
    c = CRN()

    c.r("P1 > m1 + P1", 0.01)
    c.r("m1 > ", 0.01)
    c.r("P1 + m2 <> PR1", [0.001, 0.001])

    c.set_state({"P1": 1})

    df = c.run(750)

    gradient(df, 'time', 1)
    gradient(df, 'time', 2)

    plot(df, 'time', c.E)
Ejemplo n.º 3
0
def test_N():
    c = CRN()
    c.r("A + 2B <> C", [1.0, 2.0])
    print(c.E)
    print(c.N)
    print(c.R)
    print(c.P)

    c.set_state(dict(C=55))
    print(c.x)
    print("v(x)")
    x = np.ones((3,1))*5
    print(c.v(x))

    d = c.run(0.001, 20)
    print(d)
Ejemplo n.º 4
0
def test_N():
    c = CRN()
    c.r("A + 2B <> C", [1.0, 2.0])
    print(c.E)
    print(c.N)
    print(c.R)
    print(c.P)

    c.set_state(dict(C=55))
    print(c.x)
    print("v(x)")
    x = np.ones((3, 1)) * 5
    print(c.v(x))

    d = c.run(0.001, 20)
    print(d)