[sympy] Re: Erroneous series expansion of tan(x)

2014-06-08 Thread Avichal Dayal
After shifting tan(x) by pi/2, it finds the series of tan(x - pi/2) at x0 = 0 And that is what we are getting:- http://www.wolframalpha.com/input/?i=tan%28x-pi%2F2%29+series+at+x%3D0 -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from

[sympy] Solving for undetermined coefficients

2014-06-08 Thread Avichal Dayal
How do I solve for undetermined coefficients in equations like:- >>> eq =a[0]*cos(x) + (a[1] - 1)*sin(x) >>> solve(eq, a[0], a[1]) [{a₀: (-a₁ + 1)⋅tan(x)}] I would like to get a[0] = 0 and a[1] = 1 as solutions. Solve works well when terms in 'x' are algebraic expressions however not for transce

[sympy] Re: Discussion regarding the series expansion project

2014-03-19 Thread Avichal Dayal
I think the best way to store the generating function is as wikipedia describes it: http://en.wikipedia.org/wiki/Formal_power_series#Power_series_in_several_variables Similar to lpoly1 PR by pernici it will have a structure. It will be of the form c*X**a where X**a is a monomial in serveral var

[sympy] Re: Discussion regarding the series expansion project

2014-03-16 Thread Avichal Dayal
> > I'm little surpised. Can you provide an example of this > from the Mathematica? I don't have the software. But I have seen examples in the references. Wolfram gives both the truncated series with the order term and using generating functions as shown below: In[1] := FormalSeries(exp(x), x

[sympy] Re: Don't forget to submit your GSoC proposals in Melange

2014-03-15 Thread Avichal Dayal
I submitted my proposal. Hope there are no issues except the formatting ones. Please review when you have time. Thank You! -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email

[sympy] Re: Discussion regarding the series expansion project

2014-03-11 Thread Avichal Dayal
orithm and I plan to add it to my proposal. Can you give some suggestions regarding my proposal? I plan to do formal power series, asymptotic series and hopefully limits. Here is the link:- https://github.com/sympy/sympy/wiki/GSoC-2014-Application-Avichal-Dayal-Series-Expansion -- You rec

[sympy] Re: Discussion regarding the series expansion project

2014-03-06 Thread Avichal Dayal
It would be great if you could look at my proposal (just an initial draft) and give suggestions:- https://github.com/sympy/sympy/wiki/GSoC-2014-Application-Avichal-Dayal-Series-Expansion Thank You! -- You received this message because you are subscribed to the Google Groups "sympy"

[sympy] Re: Discussion regarding the series expansion project

2014-03-05 Thread Avichal Dayal
Formal power series requires a sequence class. However it is already implemented here: https://github.com/goodok/sympy/tree/sequences/sympy/sequences It is not merged yet. Can I use the same for my project or should I re-implement it? -- You received this message because you are subscribed to t

[sympy] Re: asymptotic expansion of sin and cos at infinity

2014-03-01 Thread Avichal Dayal
> > Perhaps, something to indicate an error. But there are instances where series(sin(x), x, oo) is used by other methods For e.g.:- gruntz((sin(x) + cos(x)/x**2, x, oo) tries to find that series If we raise an error, then those limits won't work (which should) -- You received this message be

[sympy] Re: asymptotic expansion of sin and cos at infinity

2014-03-01 Thread Avichal Dayal
> > Typo? Perhaps, O(1, (x, oo)) Yes, I meant O(1, (x, oo)) Why you think, that that's > 1) an expansion > 2) the "right" one. > Yes, it's not an expansion and I'm not sure if it's right. But then what should be the output for series(sin(x), x, oo)? Currently it gives NotImplementedError. --

[sympy] Re: asymptotic expansion of sin and cos at infinity

2014-02-28 Thread Avichal Dayal
Currently the series method does not allow to return only the Order term. That is because by default n=6, and since it does not get enough terms it throws an error. So, how would it detect that series obtained is the actual one and not an error (since less terms are calculated)? -- You receive

[sympy] Re: Discussion regarding the series expansion project

2014-02-27 Thread Avichal Dayal
> > Yes, that's very *big* amount of work. > You mean enough for the summer or too much for the summer? Since this project involves several sub-projects as per your suggestion I should focus on: 1) formal power series 2) asymptotic expansion 3) some functions in polys module right? -- You rece

[sympy] Re: Discussion regarding the series expansion project

2014-02-26 Thread Avichal Dayal
Thank you for the references. Anyways what about this? I am more interested in implementing formal power series for SymPy. > Does it seem like something the SymPy community would want? I am asking this as I don't want to work on something that the community doesn't want. I am planning to wor

[sympy] Re: Discussion regarding the series expansion project

2014-02-26 Thread Avichal Dayal
Well, I'll search the archives and the issue page to look for the paper. Besides that, I am more interested in implementing formal power series for SymPy. Does it seem like something the SymPy community would want? Personally I'm very excited to implement it and I feel we must have it. Series o

[sympy] Re: [GSoC 2014] Cylindrical algebraic decomposition - Introduction

2014-02-26 Thread Avichal Dayal
SymPy is able to solve univariate polynomial inequalities but it might need more work on it. Project involving CAD algorithm in my opinion will require you to solve multivariate polynomial inequalities. -- You received this message because you are subscribed to the Google Groups "sympy" grou

[sympy] Discussion regarding the series expansion project

2014-02-24 Thread Avichal Dayal
There are only two weeks before student application portal opens and I would like to discuss my ideas regarding "Series expansion" project. Here is what SymPy currently does:- series:- 1) General expansion with O term appended 2) No separate functions for taylor, laurent, asymptotic etc. 3) Cannot

[sympy] Re: asymptotic expansion of sin and cos at infinity

2014-02-23 Thread Avichal Dayal
> > It sounds correct to me. Do things work if you make that change? No, I face some problems. 1) Series throws an error as the number of terms is not 6. 2) Even if I removed the above error, Gruntz hangs when calculating the following limit:- gruntz(sin(x)/x**2, x, oo) If this is the correct

[sympy] asymptotic expansion of sin and cos at infinity

2014-02-23 Thread Avichal Dayal
Gruntz uses the series code extensively and I've encountered the following error quite a few times:- PoleError: Asymptotic expansion of cos around [oo] is not implemented. If you use limit, answer is evaluated correctly to 0. However there might be cases where we might need expansion of sin an

[sympy] Re: Limit - Bug

2014-02-18 Thread Avichal Dayal
ok = lambda w: (z in w.free_symbols and any(a.is_polynomial(z) or any(z in m.free_symbols and m.is_polynomial(z) for m in Mul.make_args(a)) for a in Add.make_args(w))) This is the ok function which checks whether it should apply t

[sympy] Re: Limit - Bug

2014-02-17 Thread Avichal Dayal
However gruntz gives the correct result:- gruntz((x*exp(x)) / (exp(x)-1), x, -oo) gives 0 The part of code that is going wrong is already labeled as XXX: todo More specifically the following:- if abs(z0) is S.Infinity: # XXX todo: this should probably be stated in the # neg

[sympy] Re: Limit - Bug

2014-02-17 Thread Avichal Dayal
A bug. Answer should be 0 Check wolfram's result: http://www.wolframalpha.com/input/?i=limit%28%28x*exp%28x%29%29%2F%28exp%28x%29-1%29%2C+x%2C+-oo%29 On Monday, 17 February 2014 22:45:38 UTC+5:30, Christophe Bal wrote: > > Hello. > > limit((x*exp(x))/(exp(x)-1), x, -oo) > > gives > > -oo > > Is

[sympy] Re: AttributeError: 'Or' object has no attribute 'as_independent'

2014-02-13 Thread Avichal Dayal
By x^2 did you mean x to the power 2? SymPy follows python convention so ^ is the xor operator. ** is used for power. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to s

[sympy] Re: Bugs because sympy not sure of sign of a variable

2014-02-09 Thread Avichal Dayal
For piecewise, it'll have to try out all possibilities i.e. substitute -1 and 1 for every sign(var) instance. It would be better if we could modify the _contains method and make it smarter to include such cases(?) -- You received this message because you are subscribed to the Google Groups "sym

[sympy] Re: Bugs because sympy not sure of sign of a variable

2014-02-08 Thread Avichal Dayal
How about this:- We can replace sign(var) with {-1, 1} in the _contains method Any operation on the Set will be done on both -1 and 1. Final expression we get will be a set. Then check if it is in [-oo, oo] E.g.:- a*sign(x) + b => {-a, a} + b => {-a+b, a+b} I tried to implement but I'm having som

[sympy] Re: Bugs because sympy not sure of sign of a variable

2014-02-08 Thread Avichal Dayal
> Hmm, a good example: > arg0 in [-oo, oo] > should be smarter in this case Only way I can see to fix this is to try and substitute -1 or 1 for every sign(var) instance and see if it belongs to [-oo, oo] in every case. But what if it is -oo/oo sometimes and sometimes not. What output should w

[sympy] Bugs because sympy not sure of sign of a variable

2014-02-08 Thread Avichal Dayal
I noticed some bugs that are caused because SymPy is not sure of sign of some variable. Look at this issue for example:- http://code.google.com/p/sympy/issues/detail?id=4030&q=label%3ASeries&colspec=ID%20Type%20Status%20Priority%20Milestone%20Reporter%20Summary%20Stars When I try series(x**y, x)

[sympy] Re: GSOC 2014: Series expansion

2014-02-07 Thread Avichal Dayal
Also I wanted to ask about 'The Lpoly2 Distributed polynomials in series'. It is the work of Mario Pernici which is upon review process now. https://github.com/sympy/sympy/pull/609 How will it affect the series code? I'm also a bit unclear of what the aim of this project. Apart from formal power

[sympy] GSOC 2014: Series expansion

2014-01-22 Thread Avichal Dayal
iews on this project. Thank You, Avichal Dayal -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to t

[sympy] Re: Limits with floating-point numbers

2014-01-10 Thread Avichal Dayal
> There should be some canonical way to remove floating point > numbers that are smaller than their given precision (i.e., almost > equal to 0). evalf(chop=True) does this, but there should be some way > to do it without calling evalf on the expression. But I'm not sure > what it is if there

[sympy] Limits with floating-point numbers

2014-01-03 Thread Avichal Dayal
Floating point numbers are causing wrong answers with limits. See issue 2284: http://code.google.com/p/sympy/issues/detail?can=2&q=2284&colspec=ID%20Type%20Status%20Priority%20Milestone%20Reporter%20Summary%20Stars&id=2284 I was trying to solve it but I'm not able to find a good solution. Take th

[sympy] Multiple output in solvers

2013-12-14 Thread Avichal Dayal
The following equation produces multiple output:- solve(4**(2*(x**2) + 2*x) - 8, x) answer is [-3/2, 1/2] while it produces [-3/2, -3/2, -3/2, -3/2, 1/2, 1/2, 1/2, 1/2] Upon checking the solve() function it turns out that this equation is solved in the following way:- 1) lhs = 2**(4*(x**2) +

[sympy] Re: Issue #1284: Adding tests in test_solvers

2013-12-10 Thread Avichal Dayal
> 1) looks like a bug > 2) yes. And if you actually try simplify: (log(25)/log(5)).simplify() == 2 > 3) if it's says, then it's true. Would you like to implement this? 1) I'll open an issue on the issue tracker if it is. 2) Yes, it does but shouldn't it simplify it automatically? Anyways, tha

[sympy] Issue #1284: Adding tests in test_solvers

2013-12-10 Thread Avichal Dayal
I took up the issue #1284 and I am having some trouble regarding it. http://code.google.com/p/sympy/issues/detail?id=1284&q=easytofix&colspec=ID%20Type%20Status%20Priority%20Milestone%20Reporter%20Summary%20Stars The way assert is done is as follows:- assert solve(some equation) == [{x: x1}, {x: x

[sympy] Issue 3384 - reverse sol and func in checkodesol

2013-11-18 Thread Avichal Dayal
I was looking through some bugs when I stumbled upon the following issue: - http://code.google.com/p/sympy/issues/detail?id=3384&colspec=ID%20Type%20Status%20Priority%20Milestone%20Reporter%20Summary%20Stars It says that the required function is checkodesol(ode, sol, func) instead of checkodesol(

[sympy] Re: new to SymPy - GSOC 2014

2013-11-08 Thread Avichal Dayal
Oh, thank you for the link. I found some ideas that really interest me like solving Diophantine equations. SymPy doesn't solve it yet so it will be very exciting to contribute something new to the organization. I'm not sure how to proceed though. Should I first solve some bugs to get familiar

[sympy] new to SymPy - GSOC 2014

2013-11-07 Thread Avichal Dayal
Hello, I'm new to SymPy and would like to contribute. Reading other conversations, it seems as if you need to have a specific field of math or science in mind to work on. At the moment, I don't have a particular area in mind but I'm excited to work in various interesting topics. So how should I