On Fri, Apr 17, 2009 at 12:22 AM, Ondrej Certik wrote:
>
> On Thu, Apr 16, 2009 at 9:55 PM, Luke wrote:
>>
>> I'm working on equality comparisons for a class I call 'Vector'.
>> Really this class is to represent Vectors in R^3, but in a way that
>> allows for both symbolic and numeric evaluation
Hello,
I am very new to Sympy, and I was attempting to use it in place of
Mathematica. It seems that when I try to integrate
integrate(exp(-x)*x**n,(x,0,10)).evalf()
where n is a general constant.
Sympy unfortunately fails. (The above integral is important for
integrating modified Gamma dist
On Fri, Apr 17, 2009 at 4:02 PM, Minjae wrote:
>
> Hello,
>
> I am very new to Sympy, and I was attempting to use it in place of
> Mathematica. It seems that when I try to integrate
>
> integrate(exp(-x)*x**n,(x,0,10)).evalf()
is "n" a number? If so, it works for me:
In [5]: integrate(exp(-x)*
Hello,
n is a symbol, so I was expecting a function of n as the result.
(By the way, changing '10' to 'oo' would have been more relevant: a mistake
on my part)
integrate(exp(-x)*x**n, (x,0,oo))
Which still fails.
Thanks for your point about evalf().
Best,
Minjae
On Fri, Apr 17, 2009 at 8:07 PM
You could try doing this :
>>> x,k=symbols('xk')
>>> f= lambda n : Integral(x**k*exp(-x),(x,0,oo)).subs(k,n)
>>> f(2)
Integral(x**2*exp(-x), (x, 0, oo))
>>> f(2).doit()
2
This works only for integers, for real n, try making use of quad in
scipy - and libmpf (?).
On Apr 18, 5:53 am, Minjae Kim w
I am working with some sympy Functions that are dependent upon a sympy
Symbol 't'. For example:
t = Symbol('t')
q1 = Function('q1')(t)
When q1 is printed I get:
q1(t)
Similarly, when q1.diff(t) is printed I get:
D(q1(t), t)
I would instead like the following behavior:
In: print q1
Out: q1
In: