A basic example of HarmonicBalance.jl fails.
I am looking for ways to fix it. Advice is appreciated.
julia> using HarmonicBalance
│ Package HarmonicBalance not found, but a package named HarmonicBalance is
│ available from a registry.
│ Install package?
│ (@v1.10) pkg> add HarmonicBalance
└ (y/n/o) [y]: y
Resolving package versions...
Installed OffsetArrays ─ v1.14.2
Updating `~/.julia/environments/v1.10/Project.toml`
[e13b9ff6] + HarmonicBalance v0.12.3
Updating `~/.julia/environments/v1.10/Manifest.toml`
[621f4979] + AbstractFFTs v1.5.0
<< cut >>
Info Packages marked with ⌃ and ⌅ have new versions available. Those with ⌃ may be upgradable, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated -m`
Precompiling project...
✓ OffsetArrays
✓ OffsetArrays → OffsetArraysAdaptExt
✓ HarmonicBalance
3 dependencies successfully precompiled in 64 seconds. 367 already precompiled.
3 dependencies precompiled but different versions are currently loaded. Restart julia to access the new versions
julia> @variables t, x(t), ω0, ω, F, k
6-element Vector{Symbolics.Num}:
t
x(t)
ω0
ω
F
k
julia> diff_eom = DifferentialEquation(d(x,t,2) + ω0^2 * x - F * cos(ω*t), x)
System of 1 differential equations
Variables: x(t)
Harmonic ansatz: x(t) => ;
Differential(t)(Differential(t)(x(t))) - F*cos(t*ω) + x(t)*(ω0^2) ~ 0
julia> add_harmonic!(diff_eom, x, ω)
julia> get_harmonic_equations(diff_eom)
ERROR: MethodError: no method matching iterate(::SymbolicUtils.BasicSymbolic{Real})
Closest candidates are:
iterate(::Pkg.Resolve.NodePerm, Any...)
@ Pkg ~/.julia/juliaup/julia-1.10.5+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/Resolve/maxsum.jl:240
iterate(::ExponentialBackOff)
@ Base error.jl:260
iterate(::ExponentialBackOff, ::Any)
@ Base error.jl:260
...
Stacktrace:
[1] iterate
@ ./iterators.jl:1202 [inlined]
[2] iterate
@ ./iterators.jl:1196 [inlined]
[3] _collect
@ ./array.jl:770 [inlined]
[4] collect
@ ./array.jl:759 [inlined]
[5] flatten(a::Vector{SymbolicUtils.BasicSymbolic{Real}})
@ HarmonicBalance ~/.julia/packages/HarmonicBalance/7D2O8/src/utils.jl:4
[6] get_independent_variables(diff_eom::DifferentialEquation)
@ HarmonicBalance ~/.julia/packages/HarmonicBalance/7D2O8/src/DifferentialEquation.jl:137
[7] get_harmonic_equations(diff_eom::DifferentialEquation; fast_time::Nothing, slow_time::Nothing, degree::Int64)
@ HarmonicBalance ~/.julia/packages/HarmonicBalance/7D2O8/src/HarmonicEquation.jl:315
[8] get_harmonic_equations(diff_eom::DifferentialEquation)
@ HarmonicBalance ~/.julia/packages/HarmonicBalance/7D2O8/src/HarmonicEquation.jl:311
[9] top-level scope
@ REPL[54]:1