From ec0680ceb492388f39af8a593c0ef3933533b669 Mon Sep 17 00:00:00 2001 From: Orjan Ameye Date: Fri, 14 Jun 2024 10:00:56 +0200 Subject: [PATCH] Export LinearResponse module functions (#193) --- src/HarmonicBalance.jl | 2 +- src/modules/LinearResponse.jl | 3 +++ src/modules/LinearResponse/jacobians.jl | 3 +-- src/modules/LinearResponse/plotting.jl | 3 +-- src/modules/LinearResponse/response.jl | 2 -- test/linear_response.jl | 4 ---- 6 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/HarmonicBalance.jl b/src/HarmonicBalance.jl index 4f626de0..261209d4 100644 --- a/src/HarmonicBalance.jl +++ b/src/HarmonicBalance.jl @@ -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 diff --git a/src/modules/LinearResponse.jl b/src/modules/LinearResponse.jl index c54e8e51..ac9f9ef9 100644 --- a/src/modules/LinearResponse.jl +++ b/src/modules/LinearResponse.jl @@ -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 diff --git a/src/modules/LinearResponse/jacobians.jl b/src/modules/LinearResponse/jacobians.jl index 8ba61a6a..b85bad3f 100644 --- a/src/modules/LinearResponse/jacobians.jl +++ b/src/modules/LinearResponse/jacobians.jl @@ -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. @@ -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) \ No newline at end of file +get_implicit_Jacobian(p::Problem, swept, fixed) = get_implicit_Jacobian(p.eom; sym_order=_free_symbols(p, swept), rules=fixed) diff --git a/src/modules/LinearResponse/plotting.jl b/src/modules/LinearResponse/plotting.jl index 9c98d0f4..7d99d357 100644 --- a/src/modules/LinearResponse/plotting.jl +++ b/src/modules/LinearResponse/plotting.jl @@ -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) @@ -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!") diff --git a/src/modules/LinearResponse/response.jl b/src/modules/LinearResponse/response.jl index affce16e..51d09b0c 100644 --- a/src/modules/LinearResponse/response.jl +++ b/src/modules/LinearResponse/response.jl @@ -1,5 +1,3 @@ -export get_response - """ get_response_matrix(diff_eq::DifferentialEquation, freq::Num; order=2) diff --git a/test/linear_response.jl b/test/linear_response.jl index 4250e971..5ef84d91 100644 --- a/test/linear_response.jl +++ b/test/linear_response.jl @@ -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)