Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
Activity
• Aug 20 2016 17:55

shubhamtibra on fixing_bugs

added uses in integration and l… (compare)

• Aug 20 2016 17:52

shubhamtibra on fixing_bugs

added uses in integration and l… (compare)

• Aug 15 2016 14:48

shubhamtibra on fixing_bugs

trying to fix build errors (compare)

• Aug 14 2016 16:14

shubhamtibra on fixing_bugs

made changes as per the suggest… uncomment statements in examples (compare)

• Aug 14 2016 08:40

shubhamtibra on fixing_bugs

changed to documentation to sup… (compare)

• Aug 14 2016 07:03

shubhamtibra on fixing_bugs

• Aug 13 2016 13:28

shubhamtibra on fixing_bugs

better explanation of holonomic… (compare)

• Aug 13 2016 13:25

shubhamtibra on fixing_bugs

better explanation of holonomic… (compare)

• Aug 13 2016 13:03

shubhamtibra on fixing_bugs

better explanation of holonomic… (compare)

• Aug 13 2016 10:32

shubhamtibra on fixing_bugs

changed the structure of docume… (compare)

• Aug 13 2016 10:17

shubhamtibra on fixing_bugs

changed the structure of docume… (compare)

• Aug 12 2016 17:06

shubhamtibra on fixing_bugs

• Aug 12 2016 09:28

shubhamtibra on test_doc

added a very basic sphinx docum… (compare)

• Aug 10 2016 12:42

shubhamtibra on fixing_bugs

Added tests for KanesMethod.rhs… Changed KanesMethod.rhs() such … Merge pull request #1 from krit… and 100 more (compare)

• Aug 09 2016 08:06

shubhamtibra on fixing_bugs

Fix #11490 and Fix #11491 (compare)

• Aug 08 2016 14:04

shubhamtibra on fixing_bugs

fixed a bug in computing initia… (compare)

• Aug 06 2016 16:03

shubhamtibra on fixing_bugs

change printing of holonomic fu… (compare)

• Aug 04 2016 06:02

shubhamtibra on singular_ics

change a to int(a) (compare)

• Aug 03 2016 09:25

shubhamtibra on singular_ics

fixed a bug and added tests computing singular initial cond… (compare)

• Aug 01 2016 12:17

shubhamtibra on singular_ics

fixed a bug in unify and added … (compare)

Subham Tibra
@shubhamtibra
Good Evening Kalevi! I wanted to discuss a question regarding conditions at singular point in integration.
For instance we want to integrate $cos(x)^{2}/x$ with singular_ics = [(-1, [1, 0, -1])], i.e. the series is of the form $x^{-1}(1 + 0 - x^{2} ....)$ or $1/x - x + ...$. If we integrate the initial terms of the series to compute singular_ics of the result, the term 1/x will become log(x). In cases where there is no term of x with power -1 we can compute the singular_ics directly by integration of initial terms of the series. What should be the singular_ics for this case?
Kalevi Suominen
@jksuom
General holonomic functions also have these logarithmic terms. They appear at regular singular points when some roots of the indicial equation differ by an integer (or there is a multiple root). Such expressions may become quite complicated in general if several roots are involved. In case of two roots the situation might be controllable. See e.g. the series expansions of the Bessel functions of the second kind. But it may be too ambitious to include them in this gsoc project. I am not sure of how the initial conditions should be defined. Probably something like this: log(x) multiplied by an initial condition of the more general type (i.e. x**s multiplied by a constant and optionally some low order terms), in addition of the usual initial conditions at a regular singular point.
Kalevi Suominen
@jksuom
Look at http://dlmf.nist.gov/10.8, Power Series, to see how the logarithm enters.
Subham Tibra
@shubhamtibra
This looks complicated. Should we implement it later?
Kalevi Suominen
@jksuom
I think it would be too complicated for this project.
So we should probably stop with NotImplementedError when something like this will appear.
Subham Tibra
@shubhamtibra
Hi Kalevi! I can't figure out any algorithm to compute singular_ics after multiplication of two holonomic functions. Do you have any thoughts on that?
Kalevi Suominen
@jksuom
It would seem that if you have two (partial) representations of the type $x^{s_1} f_1(x)$ and $x^{s_2} f_2 (x)$ the product would contain $x^{s_1+s_2}f_1(x)f_2(x)$ with fairly obvious initial conditions. But maybe this is not what you wanted to ask?
Subham Tibra
@shubhamtibra
Subham Tibra
@shubhamtibra
I got it now. :)
Kalevi Suominen
@jksuom
Hi. If the tests passed in Travis even with the typos, that would probably mean that those lines were not tested. Or could there be another explanation?
Subham Tibra
@shubhamtibra
Those lines should have been executed on travis because they did when I ran the tests locally. The lines were returning the final answer after multiplication. I am also stumped.
Kalevi Suominen
@jksuom
In any case, sol must have been available in a dictionary, if not in the local dictionary, then in the dictionary of one of the calling routines. Its value may have been correct by chance.
Subham Tibra
@shubhamtibra
I think you are right.
Subham Tibra
@shubhamtibra
Hi Kalevi. I've added things I could think of in sympy/sympy#11422. You can also give your thoughts now.
Kalevi Suominen
@jksuom
Hi. I just saw it and wrote some comments.
Kalevi Suominen
@jksuom
I wonder if some additional initial conditions should be added to the result of expr_to_holonomic.
Subham Tibra
@shubhamtibra
Do you mean the method should return this new initial condition for more types of functions? It currently computes this initial condition only for the algebraic functions.
Kalevi Suominen
@jksuom
It seems that the condition may not suffice to define the function. For example, all constant multiples of x have value 0 at the origin. The coefficient of the first nonzero power is needed.
Ondřej Čertík
@certik
@shubhamtibra what's the problem regarding sympy/sympy#11323 ?
Did I do something wrong when using symbolic variables as coefficients?
Subham Tibra
@shubhamtibra
No. Of course not. What you used should be the ideal way of doing it while using symbolic variables. At present there are additional keyword arguments like specifying the domain, and the number of initial conditions to fix the problem. :)
Kalevi Suominen
@jksuom
I think it is otherwise ok now, but we have to use singular initial conditions since the equation is singular at 0.
Subham Tibra
@shubhamtibra
Yes. We should have an algorithm for computing singular_ics for more functions.
Subham Tibra
@shubhamtibra
I changed the title of the PR to a more descriptive one.
Subham Tibra
@shubhamtibra
Hi Kalevi! I was thinking next to add functionality in expr_to_holonomic so it can calculate singular_ics for more types of functions. Do you have any other thing in mind to do first?
Kalevi Suominen
@jksuom
No. I think that could be the next task.
Ondřej Čertík
@certik
@shubhamtibra can you post to that issue showing how it can be used right now? I just want to play with it. I understand that we can improve the API and so on, but right now I just want to play with it.
Subham Tibra
@shubhamtibra
I posted it. #issuecomment
Subham Tibra
@shubhamtibra
Hi Kalevi! I added singular initial conditions to the result of expr_to_holonomic while converting polynomials if the differential equation is singular. Do you have other types of functions in mind where we can calculate the singular initial conditions?
Kalevi Suominen
@jksuom
I think it would be proper to use singular initial conditions whenever the point in question is a regular singular point of the equation.
Subham Tibra
@shubhamtibra

Does there exist a general algorithm to compute singular initial condition for functions? I actually was adding code to compute it one by one for specific families of functions like polynomials and algebraic functions.

It'd be possible to compute it easily for any function if the indicial equation have only one root r. We can then use g(x) = f(x)/x**r. So the singular initial condition should be {r:[g(x0), g'(x0), g''(x0)/2! ...]}.

Kalevi Suominen
@jksuom
Multiple roots are not good. They lead to solutions with logarithmic terms. The best situation is the one where the roots are different modulo 1.
Subham Tibra
@shubhamtibra
Hi! I have made the change as you suggested here in PR sympy/sympy#11451.
Kalevi Suominen
@jksuom
That is good. It is also necessary for range(a).
Subham Tibra
@shubhamtibra
The statement a = int(a) is defined here before using range(a). So I guess a would be an integer while calling range().
Kalevi Suominen
@jksuom
Yes, that is what I meant.
Subham Tibra
@shubhamtibra
Do you have any thoughts on what we can work on next?
Kalevi Suominen
@jksuom
Perhaps the issues raised by Ondřej should be checked.
Subham Tibra
@shubhamtibra
You are right. I will be working on them. :)
Subham Tibra
@shubhamtibra
Should I add HolonomicFunction in srepr for a valid python output or change the default one to use f = Function('f')?
According to issue the str should be valid python.
Subham Tibra
@shubhamtibra

I think the better way to do this can be:

str will use f = Function('f') in printing so that one can use .subs(). So it should return HolonomicFunction(f(x) + Derivative(f(x), x, x), x), f(0) = 0, f'(0) = 1 for our example.

And calling srepr on the example should return HolonomicFunction(1 + Dx**2, x, 0, [0, 1]) which is valid python.

Subham Tibra
@shubhamtibra
However the str representation seems to be too lengthy this way so may be we can wait until we have an implementation of the derivative operator as suggested in sympy/sympy#4719?
Kalevi Suominen
@jksuom
Printing in SymPy differs from the Python standard in a way that is sometimes hard to understand. The Python manual says about str: This differs from __repr__() in that it does not have to be a valid Python expression: a more convenient or concise representation may be used instead. On the other hand, srepr in SymPy does represent e.g 1 + Dx**2 in the following form Add(Pow(Symbol('Dx'), Integer(2)), Integer(1)), which is not very convenient here.
Subham Tibra
@shubhamtibra
So we should keep the Dx representation in __str__() for now then?
Kalevi Suominen
@jksuom
I cannot think of a better solution now. But maybe something could be done to the initial conditions. Maybe they could be included as arguments to the call of HolonomicFunction (in list form), so that SymPy could read the result.
The list (or maybe dictionary) form is not as readable as the current representation, but it seems that some kind of compromise is necessary.
Subham Tibra
@shubhamtibra
Like this HolonomicFunction(1 + Dx**2, x, 0, [0, 1]) with keeping the suggestions you posted on the issue in mind, right?
Subham Tibra
@shubhamtibra
We won't be benefited much by using this representation I think because we still won't be able to use .subs() directly and our current representation is also more readable. Should we wait for the implementation of the derivative operator?