On 08/24/2010 09:03 AM, kcrisman wrote:
> Dear sage-devel,
>
> I have two things I just want confirmation of before I file tickets -
> such as an alternate way/workaround to do these things which I have
> missed. Thanks for any replies.
>
> - kcrisman
>
> 1. There is no way to get a symbolic interpolated polynomial de novo
> without going through polynomial rings, e.g. all these steps:
>
> pts = [(1,2),(2,3),(3,2),(4,3),(5,2),(6,3)]
> R.<x>=QQ[]
> f = R.lagrange_polynomial(pts)
> SR(f)
>
Yes. You could define your own function :) (see
http://sage.cs.drake.edu/home/pub/2/, for example). Also, mpmath and
numpy/scipy can get numerical values for the coefficients, I believe.
Maxima also can construct a lagrange polynomial (load the 'interpol'
package)
sage: maxima.load('interpol')
"/home/jason/sage-4.4.2/local/share/maxima/5.20.1/share/numeric/interpol.mac"
sage: maxima.lagrange([[1,2],[3,4]])
-x+2*(x-1)+3
So, I guess there's no "nice" way that I could find.
> 2. If one has a non-symbolic polynomial currently, it won't plot with
> the new plotting syntax.
>
> plot(f,0,5) # works, old-school Sage
> plot(f,(x,0,5)) # doesn't work, new-school Sage
> plot(f,x,0,5) # doesn't work, though sort of makes sense it shouldn't
> since x isn't a symbolic variable now... ?
>
> If there was a direct interpolated polynomial for SR I wouldn't have
> noticed the second one.
>
This seems like a bug, if 'f' is a Sage polynomial and 'x' is the
corresponding variable.
Thanks,
Jason
--
Jason Grout
--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org