You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ArgumentError: Cannot create a dual over scalar type ComplexF64. If the type behaves as a scalar, define ForwardDiff.can_dual(::Type{ComplexF64}) = true.
So I manually set
ForwardDiff.can_dual(::Type{ComplexF64}) = true
And run it again:
MethodError: no method matching Float64(::ForwardDiff.Dual{ForwardDiff.Tag{DynamicalSystemsBase.var"#5#11"{typeof(route), Vector{Int64}, Int64}, ComplexF64}, ComplexF64, 2})
Closest candidates are:
(::Type{T})(::Real, ::RoundingMode) where T<:AbstractFloat at C:\Softwares\Julia\share\julia\base\rounding.jl:200
(::Type{T})(::T) where T<:Number at C:\Softwares\Julia\share\julia\base\boot.jl:770
(::Type{T})(::VectorizationBase.Double{T}) where T<:Union{Float16, Float32, Float64, VectorizationBase.Vec{<:Any, <:Union{Float16, Float32, Float64}}, VectorizationBase.VecUnroll{var"#s35", var"#s34", var"#s33", V} where {var"#s35", var"#s34", var"#s33"<:Union{Float16, Float32, Float64}, V<:Union{Bool, Float16, Float32, Float64, Int16, Int32, Int64, Int8, UInt16, UInt32, UInt64, UInt8, SIMDTypes.Bit, VectorizationBase.AbstractSIMD{var"#s34", var"#s33"}}}} at
If I remove the im in the equation and change ComplexF64 to Float64 then it works fine.
So does this mean DynamicalSystem.jl doesn't support complex numbers?
sorry this will never be supported in DynamicalSystems.jl. Within the nonlinear dynamics theory it is much better to decompose your complex numbers into formal equations for the real and imaginary parts. Otherwise you are "hiding" the dimensionality of your state space. The example you post above is not two dimensional, but four. Decomposing that enables the rest of the library to work, because many algorithms must know the state space dimensionality to work. And with complex numbers, you can never know if the dimensionality is twice as much, or something in between.
So in conclusion, re-write your equations with real numbers by separating real and imaginary parts.
However, I am re-opening this, because an error needs to be put into the dynamical system creation when the state has complex numbers. The error should say "decompose into reals.".
The example is simple:
Was trying to define a Dynamical system. And:
So I manually set
And run it again:
If I remove the
im
in the equation and changeComplexF64
toFloat64
then it works fine.So does this mean DynamicalSystem.jl doesn't support complex numbers?
Package versions
versions:
The text was updated successfully, but these errors were encountered: