Thanks a lot for your explanations! I know that the denominator has degree eight and the degree of the numerator is lower or equal 8. However, if I try to solve the exact interpolation problem by
solve([f_1*b.subs(w=0.5)-a.subs(w=0.5)==0, f_2*b.subs(w=1)-a.subs(w=1)==0,f_3*b.subs(w=5)-a.subs(w=5)==0,f_4*b.subs(w=10)-a.subs(w=10)==0,f_5*b.subs(w=50)-a.subs(w=50)==0, f_6*b.subs(w=100)-a.subs(w=100)==0, f_7*b.subs(w=500)-a.subs(w=500)==0,f_8*b.subs(w=1000)-a.subs(w=1000)==0,f_9*b.subs(w=5000)-a.subs(w=5000)==0, f_10*b.subs(w=10000)-a.subs(w=10000)==0, f_11*b.subs(w=5*10^4)-a.subs(w=5*10^4)==0, f_12*b.subs(w=10^5)-a.subs(w=10^5)==0, f_13*b.subs(w=5*10^5)-a.subs(w=5*10^5)==0, f_14*b.subs(w=10^6)-a.subs(w=10^6)==0, f_15*b.subs(w=5*10^6)-a.subs(w=5*10^6)==0, f_16*b.subs(w=10^7)-a.subs(w=10^7)==0, f_17*b.subs(w=5*10^7)-a.subs(w=10^7)==0, f_18*b.subs(w=10^8)-a.subs(w=10^8)==0, b_8>0], a_0, a_1, a_2, a_3, a_4, a_5, a_6, a_7, a_8, b_0, b_1, b_2, b_3, b_4, b_5, b_6, b_7, b_8) sage don't find any solution. What have I to modify to receive a least squares solution? Thanks a lot in advance! Urs Hackstein 2011/10/31 Nils Bruin <[email protected]> > On Oct 18, 7:37 am, Urs Hackstein <[email protected]> > wrote: > > Let f be an element of the quotient field of the polynomial ring (in > > one variable) over the complex numbers. > > Our goal is to find representatives a and b in the polynomial ring > > over the complex numbers such that f=a/b. Can sage do this for me? > > (Simple commands like simplify or expand don' t work.) > > If you know bounds on the degrees of a,b it becomes a simple > interpolation/linear algebra problem. If a,b are guaranteed to exist > of degree <= d then just choose n=2*d+2 evaluation points > z_1,z_2,...,z_n and consider the equations > > a(z_i)-f(z_i)*b(z_i) = 0 (for i=1,...,n) > > That gives you n equations that are linear homogeneous in the > coefficients of a,b. Just solve for those [you can write down a matrix > representation of that system with about as much effort as introducing > sufficient variables and letting sage figure out what system to > solve]. > > You get a high degree of confidence that your candidate function is > correct when you ensure your system is overdetermined (i.e., pick n > larger). If you use floats you may have to settle for a least squares > solution and verify that the match is very good. > > Once you have a candidate function, you can try and see if sage can > simplify b(z)*f(z)-a(z) to 0. However, if you're working with floats > that is virtually guaranteed to not work or produce garbage. > > -- > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
