Opened 11 years ago

Last modified 7 years ago

#9794 new enhancement

Make easy wrapper for symbolic lagrange interpolation

Reported by: kcrisman Owned by: burcin
Priority: major Milestone: sage-6.4
Component: symbolics Keywords:
Cc: jason Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

Currently, one has to do something like one of these.

 > 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.ma c" 
sage: maxima.lagrange([[1,2],[3,4]]) 
-x+2*(x-1)+3 

That's too bad; we need to wrap this to make it very easy to get the interpolation from a list of points with one command from SR.

One thing to discuss would be whether one would want an approximate one if the coefficients were floats/RR, or always to try for an exact one.

Change History (4)

comment:1 Changed 8 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:2 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:3 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:4 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4
Note: See TracTickets for help on using tickets.