SciML / diffeqpy

Solving differential equations in Python using DifferentialEquations.jl and the SciML Scientific Machine Learning organization
MIT License
508 stars 39 forks source link

Running example code from the README doesn't work #104

Closed rdaems closed 8 months ago

rdaems commented 1 year ago

If I run

from diffeqpy import de
def f(u,p,t):
    return -u
u0 = 0.5
tspan = (0., 1.)
prob = de.ODEProblem(f, u0, tspan)
integrator = de.init(prob, de.Tsit5())
de.step_b(integrator)

I get the following error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [29], in <cell line: 7>()
      5 tspan = (0., 1.)
      6 prob = de.ODEProblem(f, u0, tspan)
----> 7 integrator = de.init(prob, de.Tsit5())
      8 de.step_b(integrator)

File ~/research/ideas/.venv/lib/python3.8/site-packages/julia/core.py:176, in JuliaModule.__getattr__(self, name)
    174 def __getattr__(self, name):
    175     try:
--> 176         return self.__try_getattr(name)
    177     except AttributeError:
    178         if name.endswith("_b"):

File ~/research/ideas/.venv/lib/python3.8/site-packages/julia/core.py:199, in JuliaModule.__try_getattr(self, name)
    196 if self._julia._isdefined(jl_module, name):
    197     return self._julia.eval(jl_fullname)
--> 199 raise AttributeError(name)

AttributeError: Tsit5
ChrisRackauckas commented 8 months ago

Fixed by new PythonCall backend.