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

Add extrapolation types periodic and reflective #363

Merged

Conversation

SouthEndMusic
Copy link
Member

Fixes #360.

Follow-up of #356.

using DataInterpolations
using Plots
using Random
Random.seed!(1)
u = rand(5)
t = cumsum(rand(5))
A = QuadraticSpline(u,t; extrapolation_left = ExtrapolationType.reflective, extrapolation_right = ExtrapolationType.periodic)
T = last(A.t) - first(A.t)
t_eval_left = range(first(t) - 2T, first(t), length = 250)
t_eval_right = range(last(t), last(t) + 2T, length = 250)
plot(A)
plot!(t_eval_left, A.(t_eval_left); label = "reflective")
plot!(t_eval_right, A.(t_eval_right); label = "periodic")

figure

@SouthEndMusic SouthEndMusic changed the title Add extrapolation types periodic and reflection Add extrapolation types periodic and reflective Nov 22, 2024
@SouthEndMusic
Copy link
Member Author

Note: in this PR I add tests for integrating with cached integral data (which is cached when cache_parameters = true). I found that this had a bug which I fixed. The bug was possibly introduced by #359. So I suggest not to make a new release until this PR is merged.

@ChrisRackauckas
Copy link
Member

This is amazing!

@ChrisRackauckas ChrisRackauckas merged commit 6f7a38a into SciML:master Dec 1, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add extrapolation types periodic and reflection
2 participants