On Monday, 7 April 2014 19:25:59 UTC+2, Björn Dahlgren wrote:
>
> h is Symbol('h') (and given how sympy cache works - yes it is global).
> I was unsure whether I should use this or force the user to pass at least
> one parameter.
> Maybe I should let it default to 1 instead of Symbol('h')? I'm starting to
> lean towards that
> the more I think of it..
>
> On Monday, 7 April 2014 19:04:38 UTC+2, [email protected] wrote:
>>
>>
>> On 07.04.2014 19:34, Björn Dahlgren wrote:
>> > After reading Aaron's recommendation about looking for unanswered sympy
>> > questions at stackoverflow I stumbled upon:
>> >
>> >
>> http://stackoverflow.com/questions/18701290/derivatives-discretization-with-sympy
>>
>> >
>> > I implemented a solution for this and it is available as a WIP PR over
>> here:
>> > https://github.com/sympy/sympy/pull/7382
>> >
>> > I would love to hear your feedback on this.
>> >
>>
>> Hi,
>> From the stackoverflow question here is your example:
>>
>> > Here is an example:
>> >>> from sympy import symbols, Function
>> >>> x, h = symbols('x h')
>> >>> f = Function('f')
>> >>> print(f(x).diff(x).as_finite_diff())
>> -f(-h + x)/(2*h) + f(h + x)/(2*h)
>>
>>
>> Is it means that you use "h" symbol from the global namespace?
>>
>
Giving this another minute of thought you are right that this is no good. I
added a new commit and updated my answer at Stack Overflow.
Thank you for your input!
>
>>
>>
>>
>> --
>> Alexey Gudchenko
>>
>>
>> > Best regards
>> > /Björn
>> >
>>
>>
>>
>>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/60f4d6d4-a8ae-46de-97cd-975df49fe990%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.