[sage-support] Re: Partial Fraction Expansion for Polynomials with complex factors

2013-08-01 Thread P Purkayastha
If the factors are complex conjugates then it is already in partial 
fraction form.

On Thursday, August 1, 2013 1:50:32 PM UTC+8, Rakhi Warriar wrote:
>
> I have the following function:
>
> f(x) = 1
>  
>  x^2 + 4*x + 13
>
> I need to find its partial fraction expansion. As the factors are complex 
> conjugates, I am not able to do using partial_fraction(). How can I find 
> this?
>
> Commands:
> x = CC['x'].0
> f = 1/(x^2 + 4*x+ 13)
> f.partial_fraction()
> this gives error:
> Traceback (click to the left of this block for traceback)
> ...
> AttributeError: 'FractionFieldElement_1poly_field' object has no
> attribute 'partial_fraction'
>
> System used: Ubuntu 12.04, 32 bit, Intel Core i5 procesor
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: Partial Fraction Expansion for Polynomials with complex factors

2013-08-01 Thread rickhg12hs
On Thursday, August 1, 2013 1:50:32 AM UTC-4, Rakhi Warriar wrote:

> I have the following function:
>
> f(x) = 1
>  
>  x^2 + 4*x + 13
>
> I need to find its partial fraction expansion. As the factors are complex 
> conjugates, I am not able to do using partial_fraction(). How can I find 
> this?
>
> Commands:
> x = CC['x'].0
> f = 1/(x^2 + 4*x+ 13)
> f.partial_fraction()
> this gives error:
> Traceback (click to the left of this block for traceback)
> ...
> AttributeError: 'FractionFieldElement_1poly_field' object has no
> attribute 'partial_fraction'
>
With Sage 5.10:

sage: P.=CC[]
sage: f=1/(x^2+4*x+13)
sage: f
1.00/(x^2 + 4.00*x + 13.0)
sage: f.partial_fraction_decomposition()
(0,
 [(-0.167*I)/(x + 2.00 - 3.00*I),
  0.167*I/(x + 2.00 + 3.00*I)])
sage: f.partial_fraction_decomposition()[1]
[(-0.167*I)/(x + 2.00 - 3.00*I),
 0.167*I/(x + 2.00 + 3.00*I)]
sage: sum(f.partial_fraction_decomposition()[1])
1.00/(x^2 + 4.00*x + 13.0)
sage: f == sum(f.partial_fraction_decomposition()[1])
True
sage: 
 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: Partial Fraction Expansion for Polynomials with complex factors

2013-08-01 Thread Rakhi Warriar
Thanks rickhg12hs. 

Rakhi

On Thursday, August 1, 2013 1:28:53 PM UTC+5:30, rickhg12hs wrote:
>
> On Thursday, August 1, 2013 1:50:32 AM UTC-4, Rakhi Warriar wrote:
>
>> I have the following function:
>>
>> f(x) = 1
>>  
>>  x^2 + 4*x + 13
>>
>> I need to find its partial fraction expansion. As the factors are complex 
>> conjugates, I am not able to do using partial_fraction(). How can I find 
>> this?
>>
>> Commands:
>> x = CC['x'].0
>> f = 1/(x^2 + 4*x+ 13)
>> f.partial_fraction()
>> this gives error:
>> Traceback (click to the left of this block for traceback)
>> ...
>> AttributeError: 'FractionFieldElement_1poly_field' object has no
>> attribute 'partial_fraction'
>>
> With Sage 5.10:
>
> sage: P.=CC[]
> sage: f=1/(x^2+4*x+13)
> sage: f
> 1.00/(x^2 + 4.00*x + 13.0)
> sage: f.partial_fraction_decomposition()
> (0,
>  [(-0.167*I)/(x + 2.00 - 3.00*I),
>   0.167*I/(x + 2.00 + 3.00*I)])
> sage: f.partial_fraction_decomposition()[1]
> [(-0.167*I)/(x + 2.00 - 3.00*I),
>  0.167*I/(x + 2.00 + 3.00*I)]
> sage: sum(f.partial_fraction_decomposition()[1])
> 1.00/(x^2 + 4.00*x + 13.0)
> sage: f == sum(f.partial_fraction_decomposition()[1])
> True
> sage: 
>  
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: Disturbing Equality (from askSAGE)

2013-08-01 Thread chris wuthrich


No - because sqrt is multivalued, the answer can be, and in this case is, 
> multivalued: sometimes true and sometimes false. This isn't desperately 
> helpful, or course, and can be cast in other ways in terms of the defect
>
> If a boolean is "sometimes true and sometimes false" it is false and that 
is what I want sage to give back. Sage does not have "multi-valued 
booleans" I believe.


-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] Re: Disturbing Equality (from askSAGE)

2013-08-01 Thread John Cremona
On 1 August 2013 11:10, chris wuthrich  wrote:
>
>
>> No - because sqrt is multivalued, the answer can be, and in this case is,
>> multivalued: sometimes true and sometimes false. This isn't desperately
>> helpful, or course, and can be cast in other ways in terms of the defect
>>
> If a boolean is "sometimes true and sometimes false" it is false and that is
> what I want sage to give back. Sage does not have "multi-valued booleans" I
> believe.

I mostly agree, but in the following:

sage: var('a b')
(a, b)
sage: bool(a==a)
True
sage: bool(a==a+1)
False
sage: bool(a==a*a)
False  # bad?  it is True for a=0,1
sage: bool(b*a==a*b)
True
sage: bool((a+b)^2==a^2+2*a*b+b^2)
True
sage: bool(sqrt(a)^2==a)
True #bad? is is False for all a<0

I don't like seeing True unless the expression is a tautology, i.e. an
identity, and I don't like seeing False unless it is always false (the
negation of a tautology.  This is a different questions from the one
about branches of sqrt.

I try to avoid using symbolic expressions at all costs because of
things like this.  After setting x = a==a+1   os that x has type
sage.symbolic.expression.Expression we have bool(x) is False, but I
don't know how bool(x) is evaluated.  The documentation says that
bool(x) returns False because x is not always True, but
bool(x.negation()) is True even though x.negation() is 'a != a^2'
which is *not* always True.  So that is surely a bug, anyway.

John

>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] Re: Disturbing Equality (from askSAGE)

2013-08-01 Thread Georgi Guninski
probably this is the same:
(rhs - lhs).full_simplify()
returns zero for wrong stuff.


On Thu, Aug 01, 2013 at 12:11:06PM +0100, John Cremona wrote:
> On 1 August 2013 11:10, chris wuthrich  wrote:
> >
> >
> >> No - because sqrt is multivalued, the answer can be, and in this case is,
> >> multivalued: sometimes true and sometimes false. This isn't desperately
> >> helpful, or course, and can be cast in other ways in terms of the defect
> >>
> > If a boolean is "sometimes true and sometimes false" it is false and that is
> > what I want sage to give back. Sage does not have "multi-valued booleans" I
> > believe.
> 
> I mostly agree, but in the following:
> 
> sage: var('a b')
> (a, b)
> sage: bool(a==a)
> True
> sage: bool(a==a+1)
> False
> sage: bool(a==a*a)
> False  # bad?  it is True for a=0,1
> sage: bool(b*a==a*b)
> True
> sage: bool((a+b)^2==a^2+2*a*b+b^2)
> True
> sage: bool(sqrt(a)^2==a)
> True #bad? is is False for all a<0
> 
> I don't like seeing True unless the expression is a tautology, i.e. an
> identity, and I don't like seeing False unless it is always false (the
> negation of a tautology.  This is a different questions from the one
> about branches of sqrt.
> 
> I try to avoid using symbolic expressions at all costs because of
> things like this.  After setting x = a==a+1   os that x has type
> sage.symbolic.expression.Expression we have bool(x) is False, but I
> don't know how bool(x) is evaluated.  The documentation says that
> bool(x) returns False because x is not always True, but
> bool(x.negation()) is True even though x.negation() is 'a != a^2'
> which is *not* always True.  So that is surely a bug, anyway.
> 
> John
> 
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "sage-support" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to sage-support+unsubscr...@googlegroups.com.
> > To post to this group, send email to sage-support@googlegroups.com.
> > Visit this group at http://groups.google.com/group/sage-support.
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] Re: Disturbing Equality (from askSAGE)

2013-08-01 Thread Georgi Guninski
On Thu, Aug 01, 2013 at 05:32:29PM +0300, Georgi Guninski wrote:
> probably this is the same:
> (rhs - lhs).full_simplify()
> returns zero for wrong stuff.
> 
>

.full_simplify() appears better than bool:
sage: ex=a*a-a
sage: ex.full_simplify()
a^2 - a
sage: (sqrt(a)^2-a).full_simplify()
0

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: Sage Notebook, Chrome Browser, & SELinux Alert

2013-08-01 Thread Dima Pasechnik
On 2013-07-30, Jason Grout  wrote:
> On 7/29/13 8:11 PM, rickhg12hs wrote:
>> Sage 5.10 Notebook, Fedora 17 with SELinux set to Enforcing.
>>
>>  SELinux is preventing /opt/google/chrome/chrome from 'write'
>> accesses on the directory /home/MyHomeDir/.sage.
>>
>> Is this expected?  Should I allow write access by creating a local
>> exception for SELinux?
>>
>
> I can't imagine why Chrome needs access to ~/.sage.

isn't it where the Sage notebook files are kept?

Dima
>
> Jason
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: Sage Notebook, Chrome Browser, & SELinux Alert

2013-08-01 Thread Jason Grout

On 8/1/13 1:22 PM, Dima Pasechnik wrote:

On 2013-07-30, Jason Grout  wrote:

On 7/29/13 8:11 PM, rickhg12hs wrote:

Sage 5.10 Notebook, Fedora 17 with SELinux set to Enforcing.

  SELinux is preventing /opt/google/chrome/chrome from 'write'
accesses on the directory /home/MyHomeDir/.sage.

Is this expected?  Should I allow write access by creating a local
exception for SELinux?



I can't imagine why Chrome needs access to ~/.sage.


isn't it where the Sage notebook files are kept?


Yes, but the browser shouldn't be changing those.  All changes should be 
shuttled through the backend webserver.


Jason


--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: configuring tachyon's camera center

2013-08-01 Thread Nils Bruin
On Wednesday, July 31, 2013 4:09:45 PM UTC-7, Oscar Lazo wrote:
>
> Hello dear sage users! 
>
> I would like to view a 3d plot from a specific viewpoint using tachyon.
>

It requires a bit of surgery. Presently, viewpoint and direction are not 
part of the configurable scenery parameters (and they clearly should be). 
The just get hard-wired into the input to tachyon. You can intercept the 
scenery string, however, and edit it to your liking before sending it to 
the raytracer:

var('s')
spiral=parametric_plot3d((cos(s),sin(s),s/8),
(s,-16*pi,16*pi),aspect_ratio=1,plot_points=200)
S=spiral.tachyon()
S=S.replace('center  2.3 2.4 2.0','center 0.0 0.0 0.0')
S=S.replace('viewdir  -2.3 -2.4 -2.0','viewdir  0.0 1.0 1.0')
tachyon_rt(S)

in the notebook, this now just displays. From the command line, you'd have 
to view the just produced `sage.png`.

Be careful. for non-standard viewing directions, you may have to add some 
backdrop planes to avoid looking into a big black abyss.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.