On Sun, Jun 28, 2009 at 4:14 PM, Priit Laes<[email protected]> wrote:
>
> I have updated the PDE-separation branch again, it is now in
> 'pde-separate-v2'.
>
> In case you have sympy's sources already checked out:
> $ git remote add plaes git://github.com/plaes/sympy.git
> $ git checkout -b pde origin/pde-separate-v2
The examples below look really cool:-) I teach this kind of stuff
every semester so it will be very useful when it gets in the main
distribution of Sympy.
I tried your commands and Ondrej's commands earlier in the thread (I also
had to do "sudo apt-get install git-core" and "sudo python setup.py install")
but got this:
w...@hera:~/pythonfiles/sympy-files/sympy$ git checkout -b pde
origin/pde-separate-v2
fatal: git checkout: branch pde already exists
Should I somehow try to get back to the main branch then do your checkout?
I know nothing about git:-(
>
> About API:
> I have two higher-level functions called: pde_separate_add and
> pde_separate_mul. Both functions return list with two separated
> expression on success, and None on failure.
>
> _add substitutes F(x, y) = X(x) + Y(y) into equation and _mul case does
> F(x, y) = X(x)*Y(y).
>
> The main variable separation algorithm is in the _separate() function.
> This algorithm is still WIP (so I added a failing testcase too, feel
> free to fix it :) )
>
> Two examples from doctest:
>
>>>> from sympy import *
>>>> x, t = symbols('xt')
>>>> u, X, T = map(Function, 'uXT')
>
>>>> eq = Eq(Derivative(u(x, t), x), E**(u(x, t))*Derivative(u(x, t), t))
>>>> pde_separate_add(eq, u(x, t), [X(x), T(t)])
> [D(X(x), x)*exp(-X(x)), D(T(t), t)*exp(T(t))]
>
>
>>>> from sympy import *
>>>> x, y = symbols('xy')
>>>> u, X, Y = map(Function, 'uXY')
>
>>>> eq = Eq(Derivative(u(x, y), x, 2), Derivative(u(x, y), y, 2))
>>>> pde_separate_mul(eq, u(x, y), [X(x), Y(y)])
> [D(X(x), x, x)/X(x), D(Y(y), y, y)/Y(y)]
>
>
> So, what do you think about API?
>
> Also, because both _add and _mul functions are fairly similar, would it
> make sense to add also, pde_separate(strategy='mul | add') ??
>
>
> Cheers,
> Priit :)
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---