[sage-support] Taylor Polynomial possible "bug" in return

2013-01-10 Thread LFS
Hiya, Probably I am just doing something wrong ...
I have a cubic polynomial p(x) with "regular" coefficients and I wanted 
coefficients around e.g. (x-1). So I did p1=p.taylor(x,1,3).
I get: 

x |--> 0.085*(x - 1)^3 - 0.255*(x - 1)^2 + 0.34*x + 1.23
The polynomial is correct, but look at the last two terms.

The 1-degree term is in x not in (x-1) and the difference has been added to 
the 0-degree term.  

I think i should get:

x |--> 0.085*(x - 1)^3 - 0.255*(x - 1)^2 + 0.34*(x-1) + 1.57


See (scroll all the way to the bottom): 
http://sage.math.canterbury.ac.nz/home/pub/237/ 

Thanks for any help. Linda

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Taylor Polynomial possible "bug" in return

2013-01-10 Thread LFS

Little more: I see canterbury is using 4.8. Maybe this is fixed in version 
5? 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] Taylor Polynomial possible "bug" in return

2013-01-10 Thread Burcin Erocal
On Thu, 10 Jan 2013 03:09:05 -0800 (PST)
LFS  wrote:

> Hiya, Probably I am just doing something wrong ...
> I have a cubic polynomial p(x) with "regular" coefficients and I
> wanted coefficients around e.g. (x-1). So I did p1=p.taylor(x,1,3).
> I get: 
> 
> x |--> 0.085*(x - 1)^3 - 0.255*(x - 1)^2 + 0.34*x + 1.23
> The polynomial is correct, but look at the last two terms.
> 
> The 1-degree term is in x not in (x-1) and the difference has been
> added to the 0-degree term.  
> 
> I think i should get:
> 
> x |--> 0.085*(x - 1)^3 - 0.255*(x - 1)^2 + 0.34*(x-1) + 1.57

The taylor() method calls maxima. Maxima returns the expected result,
but while converting the expression back to Sage, we "normalize" it,
and expand the linear term.

sage: ps
2*x^3 - x^2 + 2*x + 1
sage: mps = maxima(ps)
sage: mps
2*x^3-x^2+2*x+1
sage: mps.taylor(x, 1, 3)
4+6*(x-1)+5*(x-1)^2+2*(x-1)^3
sage: ps.taylor(x, 1, 3)
2*(x - 1)^3 + 5*(x - 1)^2 + 6*x - 2


Note that series() does the right thing:

sage: ps.series(x==1, 3)
4 + 6*(x - 1) + 5*(x - 1)^2 + Order((x - 1)^3)


There is a ticket to deprecate taylor() or switch it to use series():

http://trac.sagemath.org/sage_trac/ticket/6119

This requires some work to identify differences in the behavior of
these two functions and figure out how to best remedy these. Any help
is much appreciated.


Cheers,
Burcin

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] Taylor Polynomial possible "bug" in return

2013-01-10 Thread LFS
Hiya Burcin, 
Thanks for reply! 
For my cubic polynomials p0 and p1, I did get the following to work: 
p0=p.series(x==xD[0],4)
p1=q.series(x==xD[1],4)
print p0; p1

x |--> 1.0601 + 0.59497*x +
(-0.08502)*x^3
x |--> 1.5698 + 0.34008*(x - 1) +
(-0.25506)*(x - 1)^2 + 0.08502*(x - 1)^3


(I am guessing that here (a) you must add one more degree than you want and 
(b) if the derivative is not zero, you get the Order thing indicating a 
remainder??)
 I did like the taylor command. It was easy to understand and the syntax 
was intuitive (good for people like me). I don't mind the Order thing so 
much, but the x==1, I don't like.
BTW: The wolframalpha command is: series[0.085*x^3 - 0.510*x^2 + 1.105*x + 
0.890,(x,1,3)]
I know next to nothing about programming so I hope someone else offers to 
help :)
Thanks again.
Linda

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Graph plotting problem. Everything looks small.

2013-01-10 Thread crushinator
Hi,

I have a problem getting a graph to plot on sage.  I have a graph called dg, a 
digraph on 100 vertices.  The graph is several components.  When I plot dg 
using the following:

dg.plot(layout='graphviz', vertex_labels=false, vertex_size = 10)

I get a graph where the vertices are extremely small and the arrows from the 
edges dominate the visualization.  I'm trying to make the graph have normal 
sized vertices and edges.
My question is what settings can i use to make the arrows on the edges smaller 
but visible?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Graph plotting problem. Everything looks small.

2013-01-10 Thread crushinator
Alternatively, is there a way I can make the graphics produced higher 
resolution?

On Thursday, January 10, 2013 3:27:53 PM UTC-6, crushinator wrote:
>
> Hi,
>
> I have a problem getting a graph to plot on sage.  I have a graph called 
> dg, a digraph on 100 vertices.  The graph is several components.  When I 
> plot dg using the following:
>
> dg.plot(layout='graphviz', vertex_labels=false, vertex_size = 10)
>
> I get a graph where the vertices are extremely small and the arrows from 
> the edges dominate the visualization.  I'm trying to make the graph have 
> normal sized vertices and edges.
> My question is what settings can i use to make the arrows on the edges 
> smaller but visible?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] Re: Graph plotting problem. Everything looks small.

2013-01-10 Thread David Joyner
On Thu, Jan 10, 2013 at 6:07 PM, crushinator  wrote:
> Alternatively, is there a way I can make the graphics produced higher
> resolution?
>

I don't understand what you tried and what you didn't.
Did you try the dpi option? (It's in th reference manual...
search "sagemath graph plot dpi option" then use find to get
the first line with dpi in it.)
If so, what was the problem?

>
> On Thursday, January 10, 2013 3:27:53 PM UTC-6, crushinator wrote:
>>
>> Hi,
>>
>> I have a problem getting a graph to plot on sage.  I have a graph called
>> dg, a digraph on 100 vertices.  The graph is several components.  When I
>> plot dg using the following:
>>
>> dg.plot(layout='graphviz', vertex_labels=false, vertex_size = 10)
>>
>> I get a graph where the vertices are extremely small and the arrows from
>> the edges dominate the visualization.  I'm trying to make the graph have
>> normal sized vertices and edges.
>> My question is what settings can i use to make the arrows on the edges
>> smaller but visible?
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> 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.
> Visit this group at http://groups.google.com/group/sage-support?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.