fgasdia / LongwaveModePropagator.jl

Model the propagation of VLF radio waves in the Earth-ionosphere waveguide.
https://fgasdia.github.io/LongwaveModePropagator.jl/dev
MIT License
15 stars 5 forks source link

Replace `TableInput` LinearInterpolation with a smooth interpolator #34

Closed fgasdia closed 3 years ago

fgasdia commented 3 years ago

When using LinearInterpolation for numberdensity and collisionfrequency fields of Species, the total runtime for a "Wait profile" is approximately twice the runtime for the same discretely sampled Wait profile with a CubicSplineInterpolation. This is likely because the DifferentialEquations solver is trying to resolve the "knees" between each piecewise linear segment.

Cubic splines may overshoot the local true density, so PCHIP interpolation is preferred, but there is no up-to-date Julia package for PCHIP right now. I have a private GitHub repo with three PCHIP algorithms but they can't be released under MIT license, so I'd rather not register them.

fgasdia commented 3 years ago

See the monotonic splines in Interpolations.jl. In particular, the FC method may be very close to Matlab's PCHIP.