Skip to content

Conversation

@KeshavVenkatesh
Copy link
Contributor

In this PR, I have attempted to implement the butcher tableau approach for the Tsit5 algorithm for both solving and interpolation.

I have used the coefficient values from OrdinaryDiffEqExplicitRK. I am working on extending the benchmark tests for interpolation.

Please review my changes and provide feedback for the following:

  • On the implementation for solving and interpolation.
  • The logic for benchmark tests, results and suggestions on how I can improve them. Are the numerical differences in values between two approaches acceptable?
  • Suggestions for how I can extend the benchmark tests for interpolations as well.

@KeshavVenkatesh
Copy link
Contributor Author

@ChrisRackauckas : Request you to kindly review this PR and provide your feedback

Comment on lines 1 to 8
"""
Evaluate a polynomial at Θ, given coefficients for Θ¹, Θ², ..., Θ⁶.
Assumes coeffs = [a₁, a₂, ..., a₆] for Θ¹, Θ², ..., Θ⁶.
"""
function eval_poly_theta(Θ, coeffs)
# coeffs[1]*Θ + coeffs[2]*Θ^2 + ... + coeffs[6]*Θ^6
return sum(coeffs[i] * Θ^i for i in 1:length(coeffs))
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this just evalpoly?

[@evalpoly(Θ, tableau[i,:]...) for i in 1:num_stages]
else
# For derivative: d/dΘ [a₀ + a₁*Θ + a₂*Θ² + ...] = a₁ + 2*a₂*Θ + 3*a₃*Θ² + ...
[@evalpoly(Θ, [j * tableau[i, j+1] for j in 1:(num_coeffs-1)]...) for i in 1:num_stages]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oscardssmith : Thanks for the feedback and suggestion. Apologies I was not familiar with this. Could you please check if this change looks right?

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.

2 participants