Skip to content

feat: throw error when differentiating registered function with no derivative in structural_simplify #3419

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

Merged
merged 3 commits into from
Mar 31, 2025

Conversation

AayushSabharwal
Copy link
Member

Requires JuliaSymbolics/Symbolics.jl#1448
Close #3370

This mostly works. The problem is this test, specifically these equations. y is defined as get_value(interpolator, t) and subsequently there are equations D(y) ~ dy and D(D(y)) ~ ddy. Since the derivative of get_value isn't defined, with the changes in this PR structural_simplify would error. However, those equations become observed and have no role in solving the system, so technically they can be ignored and the system solved. The question is whether we want to error or retain the somewhat broken behavior.

@ChrisRackauckas
Copy link
Member

That should error. For the test, let's just define the derivatives.

@AayushSabharwal AayushSabharwal force-pushed the as/throw-no-derivative branch from 4defc22 to 8c43ac5 Compare March 27, 2025 07:13
@AayushSabharwal
Copy link
Member Author

Rebased again to run Catalyst downstream

@ChrisRackauckas ChrisRackauckas merged commit e189861 into SciML:master Mar 31, 2025
41 of 45 checks passed
@AayushSabharwal AayushSabharwal deleted the as/throw-no-derivative branch March 31, 2025 12:10
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.

no method matching hasmetadata in tearing
2 participants