[sympy] Re: Function vs. Symbol

2009-05-27 Thread Fabian Pedregosa
Luke wrote: > I'm trying to better understand how Sympy is structured with regard to > Function and Symbol. > > In most problems I have encountered with ODE's (and PDE's, but I'll > limit my discussion to ODE's) of the form: > dx/dt = f(x, t) x \in R^n, f: R^n x R ---> R^n > there simply

[sympy] RETE algorithm - opensource example

2009-05-27 Thread Jurgis Pralgauskis
Hello, a while ago I was reading through sympy source and noticed You are trying to implement RETE algorithm... now I am in library computer, so can't find the right source file where it was mentioned but it was comment of Ondrej, that it is hard to implement it fully CLIPS expert system tool ha

[sympy] Re: RETE algorithm - opensource example

2009-05-27 Thread Robert Kern
On Wed, May 27, 2009 at 12:58, Jurgis Pralgauskis wrote: > > Hello, > > a while ago I was reading through sympy source > and noticed You are trying to implement RETE algorithm... > now I am in library computer, so can't find the right source file > where it was mentioned > but it was comment of O

[sympy] Re: Function vs. Symbol

2009-05-27 Thread Luke
Fabian, I think the example you gave is good, but I think it would be better if you could imply that x == x(t) upon instantiation, rather than anytime you need to take the derivative, so that you would have something like: In [1]: t = Symbol('t') In [2]: x = Symbol('x', args=[t]) In [3]: x.diff(

[sympy] Re: RETE algorithm - opensource example

2009-05-27 Thread Alan Bromborsky
Jurgis Pralgauskis wrote: > Hello, > > a while ago I was reading through sympy source > and noticed You are trying to implement RETE algorithm... > now I am in library computer, so can't find the right source file > where it was mentioned > but it was comment of Ondrej, that it is hard to implemen

[sympy] Re: Function vs. Symbol

2009-05-27 Thread Luke
Here is a concrete example of the behavior that I think would be very useful: (1) variables x{3}' (2) e = sin(x1 - x2) -> (3) e = SIN(x1-x2) (4) f = x3*e*tan(x2)*sin(e) -> (5) f = x3*TAN(x2)*e*SIN(e) (6) test = dt(f) -> (7) test = TAN(x2)*e*SIN(e)*x3' + x3*e*SIN(e)*x2'/COS(x2)^2 + x3

[sympy] Re: Function vs. Symbol

2009-05-27 Thread Ondrej Certik
On Wed, May 27, 2009 at 12:53 PM, Luke wrote: > > Fabian, >  I think the example you gave is good, but I think it would be better > if you could imply that x == x(t) upon instantiation, rather than > anytime you need to take the derivative, so that you would have > something like: > In [1]: t = S

[sympy] Re: Function vs. Symbol

2009-05-27 Thread Ondrej Certik
We discuss this on IRC with Luke and Fabian. Now I understand -- Luke wants the result of differentiating not to be instances of Derivative() class, but rather some other symbols, e.g it should substitute them for symbols at the end. One way to do it is to subclass the Symbol() class that does the

[sympy] Re: Function vs. Symbol

2009-05-27 Thread Luke
I like the first way for the fact that it just has 'x' instead of 'x (t)', but I like the second way because it is simpler and easier to implement. Is there a way to redefined how x = Symbol('x')(t) would print? I guess subclassing would be one option, take care of it there, and then use the sec

[sympy] Re: Function vs. Symbol

2009-05-27 Thread Ondrej Certik
On Wed, May 27, 2009 at 6:05 PM, Luke wrote: > > I like the first way for the fact that it just has 'x' instead of 'x > (t)', but I like the second way because it is simpler and easier to > implement. The first way needs patching sympy, exactly because it things that "x" is just "x" and thus if

[sympy] Substituting within Integral

2009-05-27 Thread Aaron S. Meurer
Is there a way to substitute the integration variable inside an Integral class. subs works on non integration variables, but not the integration variable. >>> print Integral(sin(x**2),x) Integral(sin(x**2), x) >>> print Integral(sin(x**2),x).subs(x,y) # I want Integral(sin(y**2),y) Integ