动态积分方程系统

时间:2018-08-17 13:38:00

标签: python scipy odeint

我有一个适用于var indexHandler = function (db *sql.DB) http.HandlerFunc{ return function(w http.ResponseWriter, r *http.Request){ // now have access to db } } http.HandleFunc("/posts", indexHandler()) Python模块的ODE系统:

odeint

该系统对应于具有两个状态,三个强度的马尔可夫链。

方程组可以包含不同数量的方程。能否根据用户输入的方程式数量随时生成它们?

1 个答案:

答案 0 :(得分:1)

请参见以下创建n个方程的方法:

def get_equation(p, t, lmbds, n):
    """ Returns equation for provided n. """
    # Create and return equation

def equations(p, t, lmbds, eq_num):
    equations = []
    for n in range(eq_num):
        equation = get_equation(p, t, lmbds, n)
        equations.append(equation)
    return np.array(*equations)