コード例 #1
0
    def start_julia(self):

        import diffeqpy
        from diffeqpy import de

        self._julia = diffeqpy.setup()
        self._de = de
コード例 #2
0
ファイル: test_dde.py プロジェクト: tkf/diffeqpy
import diffeqpy
de = diffeqpy.setup()


def f(du, u, p, t):
    resid1 = -0.04 * u[0] + 1e4 * u[1] * u[2] - du[0]
    resid2 = +0.04 * u[0] - 3e7 * u[1]**2 - 1e4 * u[1] * u[2] - du[1]
    resid3 = u[0] + u[1] + u[2] - 1.0
    return [resid1, resid2, resid3]


u0 = [1.0, 0, 0]
du0 = [-0.04, 0.04, 0.0]
tspan = (0.0, 100000.0)
differential_vars = [True, True, False]
prob = de.DAEProblem(f, du0, u0, tspan, differential_vars=differential_vars)
sol = de.pysolve(prob)