Skip to content

Commit

Permalink
Add extra tests for hysteris_sweep
Browse files Browse the repository at this point in the history
  • Loading branch information
oameye committed Aug 1, 2023
1 parent 963d035 commit ddd58df
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/modules/TimeEvolution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module TimeEvolution

using ..HarmonicBalance
using Symbolics
using Plots
using OrdinaryDiffEq
using DSP
using FFTW
Expand Down
4 changes: 2 additions & 2 deletions src/modules/TimeEvolution/hysteresis_sweep.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ function plot_1D_solutions_branch(starting_branch::Int64, res::Result;

followed_branch, Ys = follow_branch(starting_branch, res, y=y, sweep=sweep, tf=tf, ϵ=ϵ)
Y_followed = [Ys[param_idx][branch] for (param_idx,branch) in enumerate(followed_branch)]
X = res.swept_parameters[_parse_expression(x)]
X = real.(res.swept_parameters[HarmonicBalance._parse_expression(x)])

plot!(p, X, real.(Y_followed); linestyle=:dash, c=:gray, label = sweep*" sweep", _set_Plots_default..., kwargs...)
Plots.plot!(p, X, real.(Y_followed); linestyle=:dash, c=:gray, label = sweep*" sweep", HarmonicBalance._set_Plots_default..., kwargs...)
return p
end
2 changes: 2 additions & 0 deletions test/hysteresis_sweep.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ result = get_steady_states(harmonic_eq, varied, fixed, show_progress=false)
followed_branch, _ = follow_branch(1, result)

@test first(followed_branch) last(followed_branch)

plot_1D_solutions_branch(1, result, x="ω", y="√(u1^2+v1^2)", show=false);

0 comments on commit ddd58df

Please sign in to comment.