Dear Julia,
Following some examples, I am trying to solve a system ODE diff. eqs. on complex numbers, for which I have to use Complex array types. I have tried this from an example but it fails for me with Julia 1.0.3. Normal real/float ODE works fine, but when I try to use Complex array types I get such a problem (pls see below).
Could you please advise what I am doing wrong here?
Thanks a lot!
Best regards,
Balint
using DifferentialEquations
E = 200.0
function Eq(t::Float64, u::Array{Complex{Float64},1}, du::Array{Complex{Float64},1})
du[1] = -im * E * u[1]
du[2] = -im * E * u[2]
end
u = [1.0 + 0.0im, 1.5 + 0.0im]
T = 1000.0
prob = ODEProblem(Eq, u, (0, T))
prob.u0[1] = u[1]; prob.u0[2] = u[2]
sol = solve(prob; save_everystep=true, dense=false)
Stacktrace:
[1] (::ODEFunction{false,typeof(Eq),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing})(::Array{Complex{Float64},1}, ::Nothing, ::Vararg{Any,N} where N) at /Users/balintradics/.julia/packages/DiffEqBase/s4c9b/src/diffeqfunction.jl:188
[2] ode_determine_initdt(::Array{Complex{Float64},1}, ::Float64, ::Float64, ::Float64, ::Float64, ::Float64, ::typeof(DiffEqBase.ODE_DEFAULT_NORM), ::ODEProblem{Array{Complex{Float64},1},... (very long stack trace)