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

Why does an expression get constants like C1? #11488

Open
certik opened this issue Aug 8, 2016 · 0 comments
Open

Why does an expression get constants like C1? #11488

certik opened this issue Aug 8, 2016 · 0 comments

Comments

@certik
Copy link
Member

certik commented Aug 8, 2016

An example is here, the output [9] has a constant C₁:

In [4]: p = expr_to_holonomic(sqrt(x))

In [5]: q = expr_to_holonomic(sqrt(x**2-x))

In [6]: p
Out[6]: HolonomicFunction((-1/2) + (x)Dx, x), {1/2: [1]}

In [7]: q
Out[7]: HolonomicFunction((-x + 1/2) + (x**2 - x)Dx, x), {1/2: [I]}

In [8]: p+q
Out[8]: HolonomicFunction((x/2 - 3/4) + (-x**2/2 + x)Dx + (x**3 - x**2)Dx**2, x), {1/2: [1 + I]}

In [9]: (p+q).to_expr()
Out[9]: 
   ⎛       ⎛  ________    ⎞        ⎞
√x⋅⎝- 2⋅C₁⋅⎝╲╱ -x + 1  - 1⎠ + 1 + ⅈ⎠

In [10]: p.to_expr()
Out[10]: √x

In [11]: q.to_expr()
Out[11]: 
       ________
ⅈ⋅√x⋅╲╱ -x + 1 

I thought that both p and q is uniquely given here, aren't they?

Also, if the C₁ constant is needed, the user should have a way to specify a generator for these, similarly how the ODE solvers work.

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

No branches or pull requests

1 participant