# Diffeqpy complex ODE

**URL:** https://discourse.julialang.org/t/diffeqpy-complex-ode/44530
**Category:** General Usage
**Tags:** package, diffeq, ode
**Created:** [August 7, 2020, 11:49pm UTC](https://discourse.julialang.org/t/diffeqpy-complex-ode/44530 "2020-08-07T23:49:09Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![m4hdiattar](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@m4hdiattar](https://discourse.julialang.org/u/m4hdiattar)
#### Post date: [August 7, 2020, 11:49pm UTC](https://discourse.julialang.org/t/diffeqpy-complex-ode/44530/1 "2020-08-07T23:49:09Z")

</div>

I am using diffeqpy package for solving my problem which is a system of complex ODEs.  
problem here is that it seems like the function ODEProblem is not working on complex equations and I got the error below:

can anyone help?

```julia
def Dz(dz, z, p, t):

  C = np.zeros(8)

  for i in range(n):
    for j in range(n):
      C[i] = C[i] + (1/n) * W[i,j] * z[j]
      # print('C =', C[7])
      # print('z = ', z[7])

  dz[0] = complex(c, w) * z[0] + complex(a, b) * z[0] * (abs(z[0])) ** 2 + C[0]
  dz[1] = complex(c, w) * z[1] + complex(a, b) * z[1] * (abs(z[1])) ** 2 + C[1]
  dz[2] = complex(c, w) * z[2] + complex(a, b) * z[2] * (abs(z[2])) ** 2 + C[2]
  dz[3] = complex(c, w) * z[3] + complex(a, b) * z[3] * (abs(z[3])) ** 2 + C[3]
  dz[4] = complex(c, w) * z[4] + complex(a, b) * z[4] * (abs(z[4])) ** 2 + C[4]
  dz[5] = complex(c, w) * z[5] + complex(a, b) * z[5] * (abs(z[5])) ** 2 + C[5]
  dz[6] = complex(c, w) * z[6] + complex(a, b) * z[6] * (abs(z[6])) ** 2 + C[6]
  dz[7] = complex(c, w) * z[7] + complex(a, b) * z[7] * (abs(z[7])) ** 2 + C[7]

  return dz

z0 = [1, 1, 0, 0, 0, 0, 1, 1]
tspan = (0.0, 100.0)

numba_Dz = numba.jit(Dz)

prob = de.ODEProblem(numba_Dz, z0, tspan)
sol = de.solve(prob)

```

```julia
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-30c2b7c6185d> in <module>()
      5 
      6 prob = de.ODEProblem(numba_Dz, z0, tspan)
----> 7 sol = de.solve(prob)

TypeError: can't convert complex to float

```

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [August 8, 2020, 1:02am UTC](https://discourse.julialang.org/t/diffeqpy-complex-ode/44530/2 "2020-08-08T01:02:43Z")

</div>

I’m not sure whether pyjulia handles this case. This might be a case that’s easier to do directly from Julia for right now.
