On Aug 19, 2010, at 1:05 PM, David Joyner wrote:

> On Sun, Jul 18, 2010 at 10:00 PM, Aaron S. Meurer <asmeu...@gmail.com> wrote:
>> Yes!  Version 0.6.5 is what introduced the new module!  So what you are 
>> seeing is old behavior from the old module.  You are lucky that you even 
>> chose an equation simple enough that it could be solved by the old module, 
>> and I'm hardly surprised that it gives the wrong solution with symbolic 
>> coefficients.  I don't know how you even got that hint argument to dsolve() 
>> from the earlier email, since that is all from the new module too.
>> 
>> So you should use at least 0.6.5, if not 0.6.7.  Actually, for the best ode 
>> experience, you should use the git master, which contains several fixes to 
>> dsolve() and related code that I made relating to issue 1843.
>> 
>> I know nothing about how sage packages sympy.  How often do they update it, 
>> or do we have to submit a patch to them?
> 
> 
> When will 0.6.8 be released? I will ask on sage-devel that Sage's
> sympy package be updated then. Moreover, I'll
> create the trac ticket and patched spkg myself, if I can't convince
> someone else too:-) In answer to your question, please
> see http://www.sagemath.org/doc/developer/patching_spkgs.html

The next version will be 0.7.0.  As to the release date, your guess is as good 
as mine.  Others have said that they want it to be soon, but we'll have to see 
what really happens. It's going to be a pretty major release (new polys, new 
assumptions, (hopefully) new integrator).

By the way, did you know that you replied to me personally, and not the mailing 
list at some point in the discussion?  It's all reproduced below if anyone is 
interested in what they missed.  

Aaron Meurer

> 
> 
>> 
>> Aaron Meurer
>> 
>> On Jul 18, 2010, at 7:44 PM, David Joyner wrote:
>> 
>>> Sage uses 0.6.4.
>>> 
>>> Maybe it is just the old version?
>>> 
>>> On Sun, Jul 18, 2010 at 7:00 PM, Aaron S. Meurer <asmeu...@gmail.com> wrote:
>>>> I can't duplicate exactly the solution you got (do you know what version 
>>>> of sympy sage is using?), but on my machine, it is necessary to set real 
>>>> assumptions on k.
>>>> 
>>>> In [6]: k = Symbol('k', real=True)
>>>> 
>>>> In [7]: dsolve(Derivative(f(x),x,x)-k**2*f(x), f(x))
>>>> Out[7]:
>>>>           x⋅│k│       -x⋅│k│
>>>> f(x) = C₁⋅ℯ      + C₂⋅ℯ
>>>> 
>>>> In [8]: k = Symbol('k', positive=True)
>>>> 
>>>> In [9]: dsolve(Derivative(f(x),x,x)-k**2*f(x), f(x))
>>>> Out[9]:
>>>>           k⋅x       -k⋅x
>>>> f(x) = C₁⋅ℯ    + C₂⋅ℯ
>>>> 
>>>> Aaron Meurer
>>>> 
>>>> On Jul 18, 2010, at 4:53 PM, David Joyner wrote:
>>>> 
>>>>> Hi Aaron:
>>>>> 
>>>>> Your sympy ODE stuff is great but what do you think about this output?
>>>>> 
>>>>> 
>>>>> sage: from sympy import Function, Derivative, dsolve, symbols
>>>>> sage: from sympy.abc import x
>>>>> sage: f = Function("f")
>>>>> sage: k = symbols('k')
>>>>> sage: dsolve(Derivative(f(x),x,x)-k**2*f(x), f(x))
>>>>> C1*sin(x*(-k**2)**(1/2)) + C2*cos(x*(-k**2)**(1/2))
>>>>> 
>>>>> 
>>>>> Is there a way to get exp's in the soln?
>>>>> 
>>>>> - David
>>>>> 
>>>>> 
>>>>> 
>>>>> On Sun, Jul 18, 2010 at 5:55 PM, Aaron S. Meurer <asmeu...@gmail.com> 
>>>>> wrote:
>>>>>> When you do
>>>>>> 
>>>>>> f = Function("f")(x)
>>>>>> 
>>>>>> you are already making f(x).  You need to either just declare
>>>>>> 
>>>>>> f = Function("f")
>>>>>> 
>>>>>> or use what you have with
>>>>>> 
>>>>>> dsolve(Derivative(f, x, x) - k**2*f, f, 
>>>>>> hint='nth_linear_constant_coeff_homogeneous')
>>>>>> 
>>>>>> Doing __call__ on f(x), i.e., f(x)(x), assumes that you are trying to 
>>>>>> use subs.  So for example, this is the syntax is uses:
>>>>>> 
>>>>>> In [18]: f(x)({x:y})
>>>>>> Out[18]: f(y)
>>>>>> 
>>>>>> This has come up a few times before.  I think I am going to add it to 
>>>>>> the gotchas file.
>>>>>> 
>>>>>> If you do this, it works:
>>>>>> 
>>>>>> In [13]: from sympy import Function, Derivative, dsolve, symbols
>>>>>> 
>>>>>> In [14]: from sympy.abc import x
>>>>>> 
>>>>>> In [15]: f = Function("f")
>>>>>> 
>>>>>> In [16]: dsolve(Derivative(f(x),x,x)-k**2*f(x), f(x),
>>>>>> hint='nth_linear_constant_coeff_homogeneous')
>>>>>> Out[17]:
>>>>>>         x⋅│k│       -x⋅│k│
>>>>>> f(x) = C₁⋅ℯ      + C₂⋅ℯ
>>>>>> 
>>>>>> 
>>>>>> I am assuming that sage handles the ^ properly.  Otherwise, that will 
>>>>>> need to be changed to ** too.
>>>>>> 
>>>>>> Aaron Meurer
>>>>>> 
>>>>>> p.s., Good to see that people are using my ODE module :)
>>>>>> 
>>>>>> On Jul 18, 2010, at 2:52 PM, David Joyner wrote:
>>>>>> 
>>>>>>> Hi:
>>>>>>> 
>>>>>>> Does anyone know if there is a workaround for this error I get
>>>>>>> (from running sympy in Sage)?It seems to be a known issue
>>>>>>> http://code.google.com/p/sympy/issues/detail?id=1211
>>>>>>> 
>>>>>>> - David
>>>>>>> 
>>>>>>> 
>>>>>>> sage: from sympy import Function, Derivative, dsolve, symbols
>>>>>>> sage: from sympy.abc import x
>>>>>>> sage: f = Function("f")(x)
>>>>>>> sage: k = symbols('k')
>>>>>>> sage: dsolve(Derivative(f(x),x,x)-k^2*f(x), f(x),
>>>>>>> hint='nth_linear_constant_coeff_homogeneous')
>>>>>>> ---------------------------------------------------------------------------
>>>>>>> TypeError                                 Traceback (most recent call 
>>>>>>> last)
>>>>>>> 
>>>>>>> /Users/wdj/sagefiles/sage-4.5.alpha3/<ipython console> in <module>()
>>>>>>> 
>>>>>>> /Users/wdj/sagefiles/sage-4.5.alpha3/local/lib/python2.6/site-packages/sympy/core/basic.pyc
>>>>>>> in __call__(self, subsdict)
>>>>>>> 1944         """Use call as a shortcut for subs, but only support
>>>>>>> the dictionary version"""
>>>>>>> 1945         if not isinstance(subsdict, dict):
>>>>>>> -> 1946             raise TypeError("argument must be a dictionary")
>>>>>>> 1947         return self.subs(subsdict)
>>>>>>> 1948
>>>>>>> 
>>>>>>> TypeError: argument must be a dictionary
>>>>>>> sage: dsolve(Derivative(f(x),x,x)-k**2*f(x), f(x),
>>>>>>> hint='nth_linear_constant_coeff_homogeneous')
>>>>>>> ---------------------------------------------------------------------------
>>>>>>> TypeError                                 Traceback (most recent call 
>>>>>>> last)
>>>>>>> 
>>>>>>> /Users/wdj/sagefiles/sage-4.5.alpha3/<ipython console> in <module>()
>>>>>>> 
>>>>>>> /Users/wdj/sagefiles/sage-4.5.alpha3/local/lib/python2.6/site-packages/sympy/core/basic.pyc
>>>>>>> in __call__(self, subsdict)
>>>>>>> 1944         """Use call as a shortcut for subs, but only support
>>>>>>> the dictionary version"""
>>>>>>> 1945         if not isinstance(subsdict, dict):
>>>>>>> -> 1946             raise TypeError("argument must be a dictionary")
>>>>>>> 1947         return self.subs(subsdict)
>>>>>>> 1948
>>>>>>> 
>>>>>>> TypeError: argument must be a dictionary
>>>> 
>>>> 
>> 
>> 

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to