Re: [sympy] Why does slicing a vector matrix return a builtins.list?

2012-12-13 Thread smichr
On Friday, December 14, 2012 3:20:26 AM UTC+5:45, Aaron Meurer wrote: > > First off, what you are doing would not work, because Matrix slices to > not provide "views" to the Matrix, like numpy arrays. So assigning to > a slice would not work. > > If you mean that modifying a slice doesn't mod

Re: [sympy] Why does slicing a vector matrix return a builtins.list?

2012-12-13 Thread Matthew Rocklin
Something like a view will soon be necessary for my work. This will probably be in MatrixExprs in a few months. On Thu, Dec 13, 2012 at 3:35 PM, Aaron Meurer wrote: > First off, what you are doing would not work, because Matrix slices to > not provide "views" to the Matrix, like numpy arrays.

Re: [sympy] Why does slicing a vector matrix return a builtins.list?

2012-12-13 Thread Aaron Meurer
First off, what you are doing would not work, because Matrix slices to not provide "views" to the Matrix, like numpy arrays. So assigning to a slice would not work. I agree that a slice should return a Matrix, though, to be consistant. In the future, we may implement a view model. This would hel

Re: [sympy] how to define a function on a interval?????

2012-12-13 Thread Stefan Krastanov
Just use parametric plots (what chebfun is actually doing in your example) plot_parametric(x, y, (v, 3, 5)) In sympy you are not forced to specify an interval for a symbol as in `v=chebfun('c',[3,5])`. All symbols are considered belonging to the complex numbers. -- You received this message bec

Re: [sympy] Why does slicing a vector matrix return a builtins.list?

2012-12-13 Thread Chris Smith
On Thu, Dec 13, 2012 at 8:55 PM, Shriramana Sharma wrote: > Hello. > > In my program I am having to do this: > > PartDerivs [ - ( n + 1 ) : ] = PartDerivs [ - ( n + 1 ) : ] . subs ( { > Ep ( 0 ) : 0, De ( n ) : 0 } ) > > but this fails saying: > > AttributeError: 'list' object has no attribute 'su

[sympy] how to define a function on a interval?????

2012-12-13 Thread Renxian
hi, in Matlab i can define a function on a interval(use chebfun) the code like this : v=chebfun('c',[3,5]) x=sin(v)+cos(v) y=sin(v)-cos(v) plot(x,y) then got a figure of x against y when v is on interval [3,5]. how to do this in sympy?? -- You received this message because you are sub

[sympy] how to define a function on a interval??

2012-12-13 Thread Renxian
hi, in Matlab i can define a function on a interval(use chebfun) the code like this : v=chebfun('c',[3,5]) x=sin(v)+cos(v) y=sin(v)-cos(v) plot(x,y) then got a figure of x against y when v is in interval [3,5]. how to do this in sympy?? -- You received this message because you are sub

[sympy] Why does slicing a vector matrix return a builtins.list?

2012-12-13 Thread Shriramana Sharma
Hello. In my program I am having to do this: PartDerivs [ - ( n + 1 ) : ] = PartDerivs [ - ( n + 1 ) : ] . subs ( { Ep ( 0 ) : 0, De ( n ) : 0 } ) but this fails saying: AttributeError: 'list' object has no attribute 'subs' There is a curious behaviour of Matrix w.r.t slicing: In [1]: from sy

Re: [sympy] Digest for sympy@googlegroups.com - 2 Messages in 1 Topic

2012-12-13 Thread Chris Smith
On Thu, Dec 13, 2012 at 6:17 PM, Bernardo Rocha < bernardomartinsro...@gmail.com> wrote: > c1 + r*(c2-c >>> var('a1 a2 c c1 c2 r theta phi x y z', real=True) (a1, a2, c, c1, c2, r, theta, phi, x, y, z) >>> eqs=(Eq(x,(a1 + r*(-a1 + a2))*cos(phi)*cos(theta)),Eq(y,(a1 + r*(-a1 + a2))*sin(phi)*cos(t

Re: [sympy] Digest for sympy@googlegroups.com - 2 Messages in 1 Topic

2012-12-13 Thread Bernardo Rocha
Hi, I'm trying to create a simple script to given the (x,y,z) coordinates compute the (r, theta, phi) coordinates. The structure of the equations is x = a(r) cos(theta) cos(phi) y = a(r) cos(theta) sin(phi) z = c(r) sin(theta) where a(r) = a1 + r*(a2-a1) c(r) = c1 + r*(c2-c1) If I instead use