Skip to content

Commit

Permalink
update examples, switch to using
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-petersen committed Mar 5, 2024
1 parent e368271 commit e8d95fe
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 21 deletions.
Binary file modified examples/PlummerE/ROIdeterminant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 12 additions & 7 deletions examples/PlummerE/runExamplePlummer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Kw = 20 # number of allocations is insensitive to this (also time, largely)?

# Define the helper for the Finite Hilbert Transform
FHT = FiniteHilbertTransform.LegendreFHT(Ku)
#FHT = FiniteHilbertTransform.ChebyshevFHT(Ku)

lharmonic = lmax
n1max = 1 # the Fiducial value is 10, but in the interest of a quick calculation, we limit ourselves to 1.
Expand Down Expand Up @@ -113,10 +114,14 @@ startingomg = 0.0 + 0.05im
@time bestomg,detval = LinearResponse.FindPole(startingomg,FHT,Parameters)
println("The zero-crossing frequency is $bestomg.")

# for the minimum, go back and compute the mode shape
EV,EM = LinearResponse.ComputeModeTables(bestomg,FHT,Parameters)

modeRmin = 0.01
modeRmax = 15.0
nmode = 100
ModeRadius,ModePotentialShape,ModeDensityShape = LinearResponse.GetModeShape(basis,modeRmin,modeRmax,nmode,EM,Parameters)
if isfinite(bestomg)
# for the minimum, go back and compute the mode shape
EV,EM = LinearResponse.ComputeModeTables(bestomg,FHT,Parameters)

modeRmin = 0.01
modeRmax = 15.0
nmode = 100
ModeRadius,ModePotentialShape,ModeDensityShape = LinearResponse.GetModeShape(basis,modeRmin,modeRmax,nmode,EM,Parameters)
else
println("runExamplePlummer.jl: no mode found.")
end
11 changes: 4 additions & 7 deletions src/LinearResponse.jl
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
module LinearResponse

# bring in the external dependencies
import OrbitalElements
import AstroBasis
import FiniteHilbertTransform
using AstroBasis
using FiniteHilbertTransform
using HDF5
using LinearAlgebra # Access to Symmetric
using OrbitalElements

# Default values
const defaultΩ₀ = 1.
const defaultrmin = 1.0e-6
const defaultrmax = 1.0e4

# Access to Symmetric
using LinearAlgebra


# structure to hold all parameters
include("Utils/ParameterStructure.jl")

Expand Down
1 change: 0 additions & 1 deletion src/ResponseMatrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ computes the response matrix M(ω) for a given COMPLEX frequency ω in physical
@IMPROVE: The shape of the array could maybe be improved
See LinearTheory.jl for a similar version
"""
function tabM!::ComplexF64,
tabM::AbstractMatrix{ComplexF64},
Expand Down
2 changes: 1 addition & 1 deletion src/Xi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function RunAXi(FHT::FiniteHilbertTransform.AbstractFHT,
for np = 1:nradial
for nq = np:nradial
# get the contribution
FiniteHilbertTransform.GetaXi!(FHT,view(tabGXi,nq,np,:),restab,warntab)
restab,warn = FiniteHilbertTransform.GetaXi!(FHT,view(tabGXi,nq,np,:),restab,warntab)

for k=1:Ku
# Warning if to many Inf or Nan values
Expand Down
10 changes: 5 additions & 5 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ for the radially-biased Plummer model: compute linear response theory
TEST against known values
"""

using OrbitalElements
import AstroBasis
import FiniteHilbertTransform
import LinearResponse
using AstroBasis
using FiniteHilbertTransform
using HDF5

using LinearResponse
using Test
using OrbitalElements


# Basis
G = 1.
Expand Down

0 comments on commit e8d95fe

Please sign in to comment.