正在加载图片...
8 2 Orthogonal Polynomials L-S approximation Algorithm: Orthogonal Polynomials Approximation To approximate a given function by a polynomial with error bounded by a given tolerance. Input: number of data m; x m: y m weight wm; tolerance Tol; maximum degree of polynomial Mar n. Output: coefficients of the approximating polynomial. Step 1 set po(x)=l; 0=(o,y) /(o, o); P(x)=0 Po(r); err=v,y)-ao (o,y); Step 2 Set a(xo, o)/(o, o);,()=(x-a1polx) a1=(q1,y)/(q1,g1);P(x)+=a1q1(x);err-=a1(q1,y); Step 3 Set k=1 Step 4 While((k< Max n)&&errrOr)) do steps 5-7 Step 5 k++; Se6a=(x1,1(q1,91);Bk-1=(91,g1/(qo,90); g2(x)=(x-ap1(x)-Bk-19(x);ak=(q2,y)(q292); P(x)+=ak P2(x); err -=k(2, v); Step 7 Set po(x)=p(x); p,x)=2() Step 8 Output ( STOP. 注:c=‖P-y=(P-y,P-y)=∑a9-y,∑a1-y) k=0 ∑以9-2(9,)+(,y=(,y)-∑a1(9,y k=0 k=0§2 Orthogonal Polynomials & L-S Approximation Algorithm: Orthogonal Polynomials Approximation To approximate a given function by a polynomial with error bounded by a given tolerance. Input: number of data m; x[m]; y[m]; weight w[m]; tolerance TOL; maximum degree of polynomial Max_n. Output: coefficients of the approximating polynomial. Step 1 Set 0 (x)  1; a0 = (0 , y)/(0 , 0 ); P(x) = a0 0 (x); err = (y, y) − a0 (0 , y); Step 2 Set 1= (x0 , 0 )/(0 , 0 ); 1 (x) = (x − 1 ) 0 (x); a1 = (1 , y)/(1 , 1 ); P(x) += a1 1 (x); err −= a1 (1 , y); Step 3 Set k = 1; Step 4 While (( k < Max_n)&&(|err|TOL)) do steps 5-7 Step 5 k ++; Step 6 k= (x1 , 1 )/(1 , 1 );  k−1 = (1 , 1 )/(0 , 0 ); 2 (x) = (x − k ) 1 (x) −  k−1 0 (x); ak= (2 , y)/(2 , 2 ); P(x) += ak 2 (x); err −= ak (2 , y); Step 7 Set 0 (x) = 1 (x); 1 (x) = 2 (x); Step 8 Output ( ); STOP. 注: 2 err = || P − y ||   = = = − − = − − n k n i k k i i P y P y a y a y 0 0 ( , ) (  ,  )   = = = − + n k k k n k k k k a a y y y 0 0 2 ( , ) 2 ( , ) ( , ) = = − n k k k y y a y 0 ( , ) ( , )
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有