> That's a very nice application. And that's an interesting problem - this 
> works:
>
> In [1]: f = 0.16666 - x + 2*x**2
>
> In [2]: integrate(f, (x, 0, 1))
> Out[2]: 0.3333266666666666692512658678
>
>
> But your script, which does the same, doesn't. I am investigating it
> at the moment.


OK, so I found where the problem was - you redefine "x" at the line:

x = Ainv*b

and obviously you cannot integrate with respect to a Matrix. So you
need to do for example:

intff = integrate(intf, (Symbol("x"), 0, 1))

at the end of your script and this works. Or just use a different
variable for Ainv*b.

BTW, this is the end of the script that I used:

print "-"*40
f = basis[0]
print f
intf = integrate(f, (y, 0, 1))
Basic.set_repr_level(0)
print repr(intf)
#print x
intff = integrate(intf, (Symbol("x"), 0, 1))
print intff

The set_repr_level(0) allows you to easily see what kind of expression
you have and what types.

Ondrej

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to