Skip to content

Commit

Permalink
Export LinearResponse module functions
Browse files Browse the repository at this point in the history
  • Loading branch information
oameye committed Jun 12, 2024
1 parent b6bf324 commit 377e59a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/HarmonicBalance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ using .HC_wrapper

include("modules/LinearResponse.jl")
using .LinearResponse
export plot_linear_response, plot_rotframe_jacobian_response
export plot_linear_response, plot_rotframe_jacobian_response, plot_eigenvalues

include("modules/LimitCycles.jl")
using .LimitCycles
Expand Down
3 changes: 3 additions & 0 deletions src/modules/LinearResponse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ module LinearResponse
include("LinearResponse/response.jl")
include("LinearResponse/plotting.jl")

export get_Jacobian
export plot_linear_response, plot_rotframe_jacobian_response, plot_eigenvalues

end
3 changes: 1 addition & 2 deletions src/modules/LinearResponse/jacobians.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import HarmonicBalance.compile_matrix
export get_Jacobian

"""
Here stability and linear response is treated with the slow-flow approximation (SFA), see Chapter 5 of JK's thesis.
Expand Down Expand Up @@ -84,4 +83,4 @@ function get_implicit_Jacobian(eom::HarmonicEquation; sym_order, rules=Dict())
m(s::OrderedDict) = m([s[var] for var in sym_order])
end

get_implicit_Jacobian(p::Problem, swept, fixed) = get_implicit_Jacobian(p.eom; sym_order=_free_symbols(p, swept), rules=fixed)
get_implicit_Jacobian(p::Problem, swept, fixed) = get_implicit_Jacobian(p.eom; sym_order=_free_symbols(p, swept), rules=fixed)
3 changes: 1 addition & 2 deletions src/modules/LinearResponse/plotting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ using Plots, Latexify, ProgressMeter
using Latexify.LaTeXStrings
using HarmonicBalance: _set_Plots_default
import ..HarmonicBalance: dim, _get_mask
export plot_linear_response, plot_rotframe_jacobian_response


function get_jacobian_response(res::Result, nat_var::Num, Ω_range, branch::Int; show_progress=true)
Expand Down Expand Up @@ -39,7 +38,7 @@ function get_jacobian_response(res::Result, nat_var::Num, Ω_range, followed_bra
end


function get_linear_response(res::Result, nat_var::Num, Ω_range, branch::Int; order, show_progress=true)
function get_linear_response(res::Result, nat_var::Num, Ω_range, branch::Int; show_progress=true)

stable = classify_branch(res, branch, "stable") # boolean array
!any(stable) && error("Cannot generate a spectrum - no stable solutions!")
Expand Down
2 changes: 0 additions & 2 deletions src/modules/LinearResponse/response.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export get_response

"""
get_response_matrix(diff_eq::DifferentialEquation, freq::Num; order=2)
Expand Down
4 changes: 0 additions & 4 deletions test/linear_response.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using HarmonicBalance

import HarmonicBalance.LinearResponse.plot_linear_response
import HarmonicBalance.LinearResponse.plot_rotframe_jacobian_response
import HarmonicBalance.LinearResponse.plot_eigenvalues

@variables α, ω, ω0, F, γ, t, x(t);

diff_eq = DifferentialEquation(d(x, t, 2) + ω0 * x + α * x^3 + γ * d(x, t) ~ F * cos* t), x)
Expand Down

0 comments on commit 377e59a

Please sign in to comment.