I'm trying to use diffeqpy to simulate some trajectories of the geometric Brownian motion but I'm having some issues accessing the elements of the solution.
In Julia, I would do simply res[1] to get the first path. I could then also do res[1](x) to get the value of that path at some arbitrary x in the domain of the solution. Can I do this in Python somehow?
When I try res[0] in Python, I get an error:
>>> res[0]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'PyCall.jlwrap' object is not subscriptable
I know that I could bypass this partly by using saveat=np.arange(t0, t1 + dt, dt), for example, in the call to de.solve, but that requires knowing x in advance.
I'm trying to use diffeqpy to simulate some trajectories of the geometric Brownian motion but I'm having some issues accessing the elements of the solution.
My code is the following:
In Julia, I would do simply
res[1]
to get the first path. I could then also dores[1](x)
to get the value of that path at some arbitraryx
in the domain of the solution. Can I do this in Python somehow?When I try
res[0]
in Python, I get an error:I know that I could bypass this partly by using
saveat=np.arange(t0, t1 + dt, dt)
, for example, in the call tode.solve
, but that requires knowingx
in advance.