Re: [sage-support] Dependence set of a symbolic expression

2011-12-03 Thread Santanu Sarkar
Thankx a lot.

On 2 December 2011 02:18, Laurent  wrote:
>> sage: x0,x1,x2,x3,x4,x5,x6,x7,x8,x9 = var('x0,x1,x2,x3,x4,x5,x6,x7,x8,x9')
>> sage: S = 1*x1 + 2*x3 + 3*x4 + 4*x5 + 5*x7 + 6*x9
>> sage: S.variables()
>> (x1, x3, x4, x5, x7, x9)
>
>
> By the way :
>
> sage: x=var('x')
> sage: S=sin(x)**2+cos(x)**2
> sage: S.variables()
> (x,)
> sage: S.simplify_trig().variables()
> ()
>
> thus one has to be somewhat careful.
>
> Laurent
>
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Dependence set of a symbolic expression

2011-12-01 Thread Laurent

sage: x0,x1,x2,x3,x4,x5,x6,x7,x8,x9 = var('x0,x1,x2,x3,x4,x5,x6,x7,x8,x9')
sage: S = 1*x1 + 2*x3 + 3*x4 + 4*x5 + 5*x7 + 6*x9
sage: S.variables()
(x1, x3, x4, x5, x7, x9)


By the way :

sage: x=var('x')
sage: S=sin(x)**2+cos(x)**2
sage: S.variables()
(x,)
sage: S.simplify_trig().variables()
()

thus one has to be somewhat careful.

Laurent

--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Dependence set of a symbolic expression

2011-12-01 Thread Michael Orlitzky
On 12/01/2011 10:46 AM, Santanu Sarkar wrote:
> Hello,
> Let S be a symbolic expression of a certain number of variables taken
> from a particular set of variables. How do I find out the list of the
> distinct variables that S depends on?
> Suppose {x0,x1,x2,x3,x4,x5,x6,x7,x8,x9} is a set of unknowns and S =
> x1 + x3*x4 + x5*x7*x9. I need to find the subset {x1,x3,x4,x5,x7,x9}
> on which S depends. How to do this in sage?
> 

sage: x0,x1,x2,x3,x4,x5,x6,x7,x8,x9 = var('x0,x1,x2,x3,x4,x5,x6,x7,x8,x9')
sage: S = 1*x1 + 2*x3 + 3*x4 + 4*x5 + 5*x7 + 6*x9
sage: S.variables()
(x1, x3, x4, x5, x7, x9)

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Dependence set of a symbolic expression

2011-12-01 Thread Santanu Sarkar
Hello,
Let S be a symbolic expression of a certain number of variables taken
from a particular set of variables. How do I find out the list of the
distinct variables that S depends on?
Suppose {x0,x1,x2,x3,x4,x5,x6,x7,x8,x9} is a set of unknowns and S =
x1 + x3*x4 + x5*x7*x9. I need to find the subset {x1,x3,x4,x5,x7,x9}
on which S depends. How to do this in sage?

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org