Skip to content
Open
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
7 changes: 4 additions & 3 deletions src/ForceFreeStates/FixedBoundaryStability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ end
compute_smallest_eigenvalue(u) -> crit, nonherm

Form the inverse plasma response matrix W⁻¹ using the solution matrix `u` and
returns its minimum eigenvalue by magnitude. Performs the same function as
returns its signed eigenvalue of smallest magnitude. Performs the same function as
`ode_output_get_crit` in the Fortran code, except we explicitly form W⁻¹ here
from U₁ * U₂⁻¹ using Julia's right division operator `/` instead of
adj(adj(U₂)⁻¹ * adj(U₁)) as done in Fortran. We have also added a check to
Expand Down Expand Up @@ -139,7 +139,8 @@ construction but may accumulate numerical noise during integration.
# Enforce that W is Hermitian
hermitianpart!(wp_inverse) # Overwrites W⁻¹ with (W⁻¹ + (W⁻¹)') / 2

# Compute eigenvalues and return the smallest
crit = findmin(abs, eigvals!(Hermitian(wp_inverse)))[1]
# Return the eigenvalue of smallest magnitude, keeping its sign so the caller can detect crossings
evals = eigvals!(Hermitian(wp_inverse))
crit = evals[findmin(abs, evals)[2]]
return crit, nonherm
end
Loading