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

dsolve: `get_numbered_constants` should consider Functions #15056

Closed
cbm755 opened this Issue Aug 8, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@cbm755
Contributor

cbm755 commented Aug 8, 2018

Consider:

from sympy.solves.ode import get_numbered_constants
get_numbered_constants(Symbol('C1')*Function('C2')(t))

This should probably give Symbol('C3'). Instead if gives Symbol('C2') which is technically ok but could lead to confusion (see test_C1_function_9239).

test_C1_function_9239 in test_ode.py should be updated. Also, a new test added, something like:

t = Symbol('t')
C1 = Function('C1')(t)
C2 = Symbol('C2')
dsolve(Eq(C1.diff(t), C2*C1))
sol = C3*exp(C2*t)

Easy to fix: you need some background in ODEs, know the difference between Symbol and Function, and have attention to detail.

skirpichev added a commit to skirpichev/diofant that referenced this issue Aug 8, 2018

@asmeurer

This comment has been minimized.

Member

asmeurer commented Aug 13, 2018

This also makes sense because dsolve should at some point get the ability to return constants as functions instead of symbols. For instance some PDEs can be solved by treating them as an ODE in one variable, but in that case the arbitrary constants need to be arbitrary functions in the remaining variables.

@avishrivastava11

This comment has been minimized.

Contributor

avishrivastava11 commented Nov 18, 2018

@cbm755 @asmeurer I've made a correction now. Please take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment