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

Incorrect derivatives when one of the variables is a function of the differential variable #156

Closed
mgreminger opened this issue Feb 17, 2023 · 2 comments · Fixed by #245
Closed
Labels
bug Something isn't working

Comments

@mgreminger
Copy link
Owner

See this example sheet that reproduces the issue.

image

@mgreminger
Copy link
Owner Author

Reopening as unresolved, seems to only happen if the differential variable is combined with another parameter. Works fine for d/dx(y)=20
https://engineeringpaper.xyz/rcyUDavPWn6qDuB9zQqcRt

@mgreminger mgreminger reopened this Sep 12, 2023
@mgreminger
Copy link
Owner Author

Seems to be a side effect of Sympy's sub behavior with derivatives:

In [1]: import sympy as sp

In [2]: sp.__version__
Out[2]: '1.11.1'

In [3]: x,y,z = sp.symbols('x,y,z')

In [4]: sp.Derivative(x*y, x)
Out[4]: Derivative(x*y, x)

In [5]: test = sp.Derivative(x*y, x)

In [6]: test.subs(y, 20*x)
Out[6]: Subs(Derivative(x*y, x), y, 20*x)

In [7]: test2 = sp.Derivative(y, x)

In [8]: test2.subs(y, 20*x)
Out[8]: Derivative(20*x, x)

@mgreminger mgreminger added the bug Something isn't working label Mar 4, 2024
@mgreminger mgreminger linked a pull request Mar 24, 2024 that will close this issue
mgreminger added a commit that referenced this issue Mar 24, 2024
WIP fix calculus substitution bugs #156 and #244
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant