Time evolution

Generally, solving the ODE of oscillatory systems in time requires numerically tracking the oscillations. This is a computationally expensive process; however, using the harmonic ansatz removes the oscillatory time-dependence. Simulating instead the harmonic variables of a HarmonicEquation is vastly more efficient - a steady state of the system appears as a fixed point in multidimensional space rather than an oscillatory function.

The module TimeEvolution is used to interface HarmonicEquation with the powerful solvers contained in DifferentialEquations.jl. Time-dependent parameter sweeps are defined using the object ParameterSweep.

HarmonicBalance.TimeEvolution.ODEProblemFunction
ODEProblem(
        eom::HarmonicEquation;
        fixed_parameters,
        x0::Vector,
        steady_solution::Dict
        sweep::ParameterSweep,
        timespan::Tuple
        )

Creates an ODEProblem object used by DifferentialEquations.jl from the equations in eom to simulate time-evolution within timespan. To manually input parameter values and initial conditions, use the keywords fixed_parameters and x0. To start the evolution from a steady-state solution, use steady_solution.

source
HarmonicBalance.TimeEvolution.ParameterSweepType

Represents a sweep of one or more parameters of a HarmonicEquation. During a sweep, the selected parameters vary linearly over some timespan and are constant elsewhere.

Sweeps of different variables can be combined using +.

Fields

  • functions::Dict{Symbolics.Num, Function}

    Maps each swept parameter to a function.

Examples

# create a sweep of parameter a from 0 to 1 over time 0 -> 100
julia> @variables a,b;
julia> sweep = ParameterSweep(a => [0., 1.], (0, 100));
julia> sweep[a](50)
0.5
julia> sweep[a](200)
1.0

# do the same, varying two parameters simultaneously
julia> sweep = ParameterSweep([a => [0.,1.], b => [0., 1.]], (0,100))
source

Using a time-dependent simulation can verify solution stability in cases where the Jacobian is too expensive to compute.

HarmonicBalance.TimeEvolution.is_stableFunction
is_stable(soln::Dict{Symbolics.Num, ComplexF64}, eom::HarmonicEquation; timespan, tol, perturb_initial)

Numerically investigate the stability of a solution soln of eom within timespan. The initial condition is displaced by perturb_initial.

Return true the solution evolves within tol of the initial value (interpreted as stable).

source