Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
oameye committed Jun 14, 2024
1 parent b6552da commit b0698b5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion test/hysteresis_sweep.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ varied = ω => range(0.95, 1.1, 10) # range of parameter values
result = get_steady_states(harmonic_eq, varied, fixed; show_progress=false, seed=SEED)

followed_branches, _ = follow_branch(1, result)
followed_branches, _ = follow_branch(1, result, y="√(u1^2+v1^2)")
followed_branches, _ = follow_branch(1, result; y="√(u1^2+v1^2)")

@test first(followed_branches) last(followed_branches)

Expand Down
40 changes: 20 additions & 20 deletions test/limit_cycle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import HarmonicBalance.LinearResponse.plot_linear_response
harmonic_eq = get_harmonic_equations(dEOM)
HarmonicBalance.LimitCycles._choose_fixed(harmonic_eq, ω_lc)

fixed = ();
fixed = ()
varied = μ => range(2, 3, 2)

result = get_limit_cycles(
Expand All @@ -23,33 +23,33 @@ import HarmonicBalance.LinearResponse.plot_linear_response
@test sum(any.(classify_branch(result, "stable"))) == 4
@test sum(any.(classify_branch(result, "unique_cycle"))) == 1

plot(result, y="ω_lc")
plot_linear_response(result, x, branch=1, Ω_range=range(2.4, 2.6, 2), order=1)
plot(result; y="ω_lc")
plot_linear_response(result, x; branch=1, Ω_range=range(2.4, 2.6, 2), order=1)
end

# takes to long
# @testset "coupled modes" begin
# @variables F, ω, ω_lc, t, x(t), y(t)
# @variables F, ω, ω_lc, t, x(t), y(t)

# eqs = [d(x,t,2) + 1.0^2*x - x^3 - 0.006*y ~ F*cos(ω*t),
# d(y,t,2) + 1.005^2*y - y^3 - 0.006*x ~ 0]
# eqs = [d(x,t,2) + 1.0^2*x - x^3 - 0.006*y ~ F*cos(ω*t),
# d(y,t,2) + 1.005^2*y - y^3 - 0.006*x ~ 0]

# # differential equations
# diffeq = DifferentialEquation(eqs, [x,y])
# # differential equations
# diffeq = DifferentialEquation(eqs, [x,y])

# # specify the harmonic ansatz for x and y: x = u(T) cos(ωt) + v(T) sin(ωt)
# add_harmonic!(diffeq, x, ω)
# add_harmonic!(diffeq, y, ω)
# add_harmonic!(diffeq, x, ω + ω_lc)
# add_harmonic!(diffeq, y, ω + ω_lc)
# add_harmonic!(diffeq, x, ω - ω_lc)
# add_harmonic!(diffeq, y, ω - ω_lc)
# # specify the harmonic ansatz for x and y: x = u(T) cos(ωt) + v(T) sin(ωt)
# add_harmonic!(diffeq, x, ω)
# add_harmonic!(diffeq, y, ω)
# add_harmonic!(diffeq, x, ω + ω_lc)
# add_harmonic!(diffeq, y, ω + ω_lc)
# add_harmonic!(diffeq, x, ω - ω_lc)
# add_harmonic!(diffeq, y, ω - ω_lc)

# harmonic_eq = get_harmonic_equations(diffeq);
# harmonic_eq = get_harmonic_equations(diffeq);

# fixed = (F => 0.0015)
# varied = (ω => range(0.992, 0.995, 2))
# fixed = (F => 0.0015)
# varied = (ω => range(0.992, 0.995, 2))

# # results
# result = get_limit_cycles(harmonic_eq, varied, fixed, ω_lc; threading=true)
# # results
# result = get_limit_cycles(harmonic_eq, varied, fixed, ω_lc; threading=true)
# end

0 comments on commit b0698b5

Please sign in to comment.