Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correcting small issues #95

Merged
merged 2 commits into from
Jan 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/sorting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Returns a list of Tuples of the form (1, i1), (2, i2), ... such that
reference[1] and to_sort[i1] belong to the same branch
"""
function align_pair(reference, to_sort::Vector{SteadyState})

distances = get_distance_matrix(reference, to_sort)
n = length(to_sort)
sorted_cartesians = CartesianIndices(distances)[sortperm(vec(distances))]
Expand Down Expand Up @@ -116,7 +116,7 @@ function sort_1D(solns::Vector{Vector{SteadyState}}; show_progress=true)
if show_progress
bar = Progress(length(solns), dt=1, desc="Ordering solutions into branches ...", output=stdout)
end
for (i, soln) in enumerate(solns[1:end-1])
for i in eachindex(solns[1:end-1])
show_progress ? next!(bar) : nothing
matched_indices = align_pair(sorted_solns[i], solns[i+1]) # pairs of matching indices
next_indices = getindex.(matched_indices, 2) # indices of the next solution
Expand Down
4 changes: 2 additions & 2 deletions test/parametron.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ p = HarmonicBalance.Problem(harmonic_eq);

fixed = (Ω => 1.0,γ => 1E-2, λ => 5E-2, F => 1E-3, α => 1., η=>0.3, θ => 0, ψ => 0)
varied = ω => LinRange(0.9, 1.1, 100)
res = get_steady_states(p, varied, fixed, show_progress=false)
res = get_steady_states(p, varied, fixed, show_progress=false);

# save the result, try and load in the next step
#current_path = @__DIR__
Expand All @@ -24,7 +24,7 @@ res = get_steady_states(p, varied, fixed, show_progress=false)
# try to run a 2D calculation
fixed = (Ω => 1.0,γ => 1E-2, F => 1E-3, α => 1., η=>0.3, θ => 0, ψ => 0)
varied = (ω => LinRange(0.9, 1.1, 10), λ => LinRange(0.01, 0.05, 10))
res = get_steady_states(p, varied, fixed, show_progress=false)
res = get_steady_states(p, varied, fixed, show_progress=false);


###
Expand Down