Пример #1
0
def try_analyse_func3():
    def g_func(m, t):
        a = t + 2
        b = m + 6
        c = a + b
        d = m * 2 + c
        return d

    from pprint import pprint

    df = DiffEquation(func=None, g=g_func)
    pprint(df.expressions)
    pprint(df.returns)
    pprint(df.get_f_expressions())
    pprint(df.get_g_expressions())
    print('-' * 30)
Пример #2
0
def try_analyse_func():
    import numpy as np

    def int_m(m, t, V):
        alpha = 0.1 * (V + 40) / (1 - np.exp(-(V + 40) / 10))
        beta = 4.0 * np.exp(-(V + 65) / 18)
        return alpha * (1 - m) - beta * m, (alpha, beta)

    from pprint import pprint

    df = DiffEquation(int_m)
    pprint(df.expressions)
    pprint(df.returns)
    pprint(df.get_f_expressions())
    pprint(df.get_g_expressions())
    print('-'* 30)
Пример #3
0
def try_analyse_func2():
    def func(m, t):
        a = t + 2
        b = m + 6
        c = a + b
        d = m * 2 + c
        return d, c

    from pprint import pprint

    df = DiffEquation(func=func, g=np.zeros(10))
    pprint(df.expressions)
    pprint(df.returns)
    pprint(df.get_f_expressions())
    pprint(df.get_g_expressions())
    print('-' * 30)