> > Could you be more specific what issues GiNaC has? The only problem
> > with ginac that I know of is that it is very difficult to create new
> > functions,
> > but as far as I know, SyFi just needs polynomials.
>
> There are at least two issues, the license (it could be a problem for
> the institute
> I work at in the long run).
>
> The more serious issue (now) is that GiNaC expands everything.
> For instance, I'd like the derivative with respect to x of a function
> f(x)
> to be stored as an object Derivative(f,x), much like GiNaCs integrals
> before eval_integ.

http://code.google.com/p/sympy/issues/detail?id=476

Thanks for noticing. This used to work, but it isn't apparently now in
SymPy. We'll fix that.

> Or when doing G(x) = N(x)*M(x), G is not the expanded product of N and
> M, but keeps
> N and M.

Is this the issue:

http://code.google.com/p/sympycore/issues/detail?id=18

?

So you want:

In [4]: f = x+y

In [5]: g = x+z

In [6]: f*g
Out[6]: (x + y)*(x + z)

In [7]: f+g
Out[7]: y + z + 2*x


So [6] is ok, but you want [7] to be "x+y+x+z" instead? Is it because
of memory requirements (see that issue for more details)?

>
> I guess SymPy and GiNaC behave similarly in these matters, but I guess
> it is easier to implement
> such features in SymPy.


In theory yes. There is the speed issue though with SymPy, it depends
if we can cope with that.


> > float x;
> > float y;
> > e = pow(sin(x), 4)*pow(y,2);
> >
> > is that correct? If you could give me more info what exactly you need,
> > I'll implement that.
> >
>
> This is what I need, although I'd like double instead of float.

I created an issue for that:

http://code.google.com/p/sympy/issues/detail?id=475

feel free to discuss it in there.

> >
> > So indeed I sped things up by a factor of 10x. See:
> >
> > http://code.google.com/p/sympy/issues/detail?id=470
>
> How do I download this ?

you follow the link in the issue to this page:

http://groups.google.com/group/sympy-patches/browse_thread/thread/c51231bb0fd91c71

and download the integration.patch. Then

$ hg clone http://hg.sympy.org/sympy/
$ cd sympy/
$ hg import ~/Desktop/Downloads/integration.patch
applying /home/ondra/Desktop/Downloads/integration.patch
$ time python examples/fem_test.py
1/60 0 -1/360 0 -1/90 -1/360
0 4/45 0 2/45 2/45 -1/90
-1/360 0 1/60 -1/90 0 -1/360
0 2/45 -1/90 4/45 2/45 0
-1/90 2/45 0 2/45 4/45 0
-1/360 -1/90 -1/360 0 0 1/60

real    0m2.486s
user    0m2.460s
sys     0m0.024s

And that's it. BTW, we are still reviewing the patch, so for example
it errorneously modifies your example by doing .expand() in there,
which is not necessary, etc.

So still 8x slower than ginac, but I consider it a very successful
result. Maybe it can still be improved, for example we are converting
to a polynomial and back, many times, this slows things down. The
problem is, I don't know a clear cut way to over come that, see:

http://code.google.com/p/sympy/issues/detail?id=477

If you (and anyone) could give us your thoughts on that issue, it'd be cool.

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