| |
|
|
p.specht
| El Interpolation mittels Tschebyschow-Polynomen características se por una muy günstigen, gleichmäßigen Fehlerverlauf de. Dazu son como Interpolationsstellen el geeignet verschobenen Nullstellen uno Tschebyschow-Polynoms passenden Grades utilizarse. Das erste el beiden nachstehenden Programas erlaubt el Berechnung el Polynom-Koeffizienten geeignet a wählenden Grades.
"Fein-Tuning": Falls uno el Werte-Gültigkeitsbereich einschränken kann, genügen Tschebyschow-Polynome geringeren Grades, el auch más rápido a berechnen son. Das zweite el nachstehenden Programas erlaubt así una Grad-Reduktion.
Ventana de Estilo 24:Font 2:Conjunto("decimals",5)
Título de la ventana "ChebySer: Tschebyschowpolynomkoeffizienten para diferente Grade (Formeloptimierung)"
' Quelle: https://jean-pierre.moreau.pagesperso-orange.fr/Basic/chebyser_bas.txt
' Transponiert después de XProfan 11.2a (D) Demo by P.Pájaro carpintero, Vienna/Austria
' No warranty whatsoever! Keine sin embargo geartete Gewähr!
'****************************************************
'* Program to demonstrate Chebyser subroutine *
'* ------------------------------------------------ *
'* Reference: BASIC Scientific Subroutines, Vol. II *
'* by F.R. Ruckdeschel, BYTE/McGRAWW-HILL, 1981 [1].*
'* ------------------------------------------------ *
'* SAMPLE RUN: *
'* *
'* Chebyshev polynomial coefficients for degree 2 *
'* A( 0) = -1 *
'* A( 1) = 0 *
'* A( 2) = 2 *
'* *
'* Chebyshev polynomial coefficients for degree 3 *
'* A( 0) = 0 *
'* A( 1) = -3 *
'* A( 2) = 0 *
'* A( 3) = 4 *
'* *
'* Chebyshev polynomial coefficients for degree 4 *
'* A( 0) = 1 *
'* A( 1) = 0 *
'* A( 2) = -8 *
'* A( 3) = 0 *
'* A( 4) = 8 *
'* *
'* Chebyshev polynomial coefficients for degree 5 *
'* A( 0) = 0 *
'* A( 1) = 5 *
'* A( 2) = 0 *
'* A( 3) = -20 *
'* A( 4) = 0 *
'* A( 5) = 16 *
'* *
'* Chebyshev polynomial coefficients for degree 6 *
'* A( 0) = -1 *
'* A( 1) = 0 *
'* A( 2) = 18 *
'* A( 3) = 0 *
'* A( 4) = -48 *
'* A( 5) = 0 *
'* A( 6) = 32 *
'* *
'* Chebyshev polynomial coefficients for degree 7 *
'* A( 0) = 0 *
'* A( 1) = -7 *
'* A( 2) = 0 *
'* A( 3) = 56 *
'* A( 4) = 0 *
'* A( 5) = -112 *
'* A( 6) = 0 *
'* A( 7) = 64 *
'* *
'* Chebyshev polynomial coefficients for degree 8 *
'* A( 0) = 1 *
'* A( 1) = 0 *
'* A( 2) = -32 *
'* A( 3) = 0 *
'* A( 4) = 160 *
'* A( 5) = 0 *
'* A( 6) = -256 *
'* A( 7) = 0 *
'* A( 8) = 128 *
'* *
'* Chebyshev polynomial coefficients for degree 9 *
'* A( 0) = 0 *
'* A( 1) = 9 *
'* A( 2) = 0 *
'* A( 3) = -120 *
'* A( 4) = 0 *
'* A( 5) = 432 *
'* A( 6) = 0 *
'* A( 7) = -576 *
'* A( 8) = 0 *
'* A( 9) = 256 *
'* *
'* Chebyshev polynomial coefficients for degree 10 *
'* A( 0) = -1 *
'* A( 1) = 0 *
'* A( 2) = 50 *
'* A( 3) = 0 *
'* A( 4) = -400 *
'* A( 5) = 0 *
'* A( 6) = 1120 *
'* A( 7) = 0 *
'* A( 8) = -1280 *
'* A( 9) = 0 *
'* A( 10) = 512 *
'* *
'****************************************************
'DEFINT I-N
'DEFDBL A-H, O-Z
Declarar i&,n&,j&
CLS
PRINT
Declarar B![10,10]
WhileLoop 2,10:n&=&Loop
S1000' Proc-Aufruf
PRINT " Tschebyschowpolynom-Koeffizienten para Polynomgrad ";n&
Imprimir
WhileLoop 0,n&:i&=&Loop
PRINT " A(";i&; ") = ";B![n&,i&]
EndWhile
Imprimir : Case n&<10:WaitInput
EndWhile
PRINT
FIN
Proc S1000
'********************************************************
'* Chebyshev series coefficients evaluation subroutine *
'* ---------------------------------------------------- *
'* The order of the polynomial is n. The coefficients *
'* are returned en the array B(i,j), i is the degree of *
'* the polynomial, j is the coefficient order. *
'********************************************************
'Establish t0 and t1 coefficients
B![0,0]=1:B![1,0]=0:B![1,1]=1
'Volver if order is less than two
Case n&<2:Volver
WhileLoop 2,n&:i&=&Loop
WhileLoop i&:j&=&Loop
'Basic recursion relation
B![i&,j&]=2*B![i&-1,j&-1]-B![i&-2,j&]
EndWhile
B![i&,0]= -1*B![i&-2, 0]
EndWhile
ENDPROC
'End of file Chebyser.prf
Zweites Programa:
Ventana de Estilo 24:Font 2:Conjunto("decimals",17)
Título de la ventana "ChebeCon: Vereinfachung de Approximationspolynomen después de Tschebyschow"
' Quelle: https://jean-pierre.moreau.pagesperso-orange.fr/Basic/chebecon_bas.txt
' transponiert después de XProfan 11.2a (D) Demo 2016-12 by P.Pájaro carpintero, Vienna/Austria
' No warranty whatsoever! Ohne jegliche Gewähr!
'*****************************************************
'* Program to demonstrate Chebyshev economization *
'* ------------------------------------------------- *
'* Reference: BASIC Scientific Subroutines, Vol. II *
'* by F.R. Ruckdeschel, BYTE/McGRAWW-HILL, 1981 [1]. *
'* ------------------------------------------------- *
'* SAMPLE RUN: *
'* What is the degree of the input polynomial: ? 15 *
'* *
'* What is the degree of the desired economized *
'* polynomial: ? 9 *
'* *
'* What is the range of the input polynomial: ? 1.57 *
'* *
'* Entrada the coefficients: *
'* C( 0) = ? 0 *
'* C( 1) = ? 1 *
'* C( 2) = ? 0 *
'* C( 3) = ? -.166666666 *
'* C( 4) = ? 0 *
'* C( 5) = ? .00833333333 *
'* C( 6) = ? 0 *
'* C( 7) = ? -.0001984127 *
'* C( 8) = ? 0 *
'* C( 9) = ? .000002755732 *
'* C( 10) = ? 0 *
'* C( 11) = ? -.000000025052109 *
'* C( 12) = ? 0 *
'* C( 13) = ? .00000000016059045 *
'* C( 14) = ? 0 *
'* C( 15) = ? -.00000000000076471635 *
'* *
'* The Chebyshev series coefficients are: *
'* *
'* A( 0) = 0.0000000000 *
'* A( 1) = 1.1334708982 *
'* A( 2) = 0.0000000000 *
'* A( 3) = -0.1378841454 *
'* A( 4) = 0.0000000000 *
'* A( 5) = 0.0044798168 *
'* A( 6) = 0.0000000000 *
'* A( 7) = -0.0000674667 *
'* A( 8) = 0.0000000000 *
'* A( 9) = 0.0000005865 *
'* A(10) = 0.0000000000 *
'* A(11) = -0.0000000033 *
'* A(12) = 0.0000000000 *
'* A(13) = 0.0000000000 *
'* A(14) = 0.0000000000 *
'* A(15) = 0.0000000000 *
'* *
'* The economized polynomial coefficients are: *
'* *
'* C( 0) = 0.0000000000 *
'* C( 1) = 0.9999999767 *
'* C( 2) = 0.0000000000 *
'* C( 3) = -1.6666647620 *
'* C( 4) = 0.0000000000 *
'* C( 5) = 0.0083329009 *
'* C( 6) = 0.0000000000 *
'* C( 7) = -0.0001980098 *
'* C( 8) = 0.0000000000 *
'* C( 9) = 0.0000025907 *
'* *
'*****************************************************
'DEFINT I-N
'DEFDBL A-H, O-Z
DecLARE m&,m1&,x0!,i&,j&,cc$
Declarar b!,n&,L&
CLS
Imprimir
Imprimir " Bitte el Grad des Original-Polynoms eingeben: ", :Entrada m&
PRINT
Imprimir " Bitte el deseado Grad des vereinfachten Polynoms angeben: ",:Entrada m1&
PRINT
Imprimir " Bitte el deseado Zona (Range) angeben: ",:Entrada x0!
Declarar A![m&],B![m&,m&],C![m&]
Imprimir
Imprimir " Eingabe el Koeffizienten des Originalpolynoms:"
Imprimir
WhileLoop 0,m&:i&=&Loop
Imprimir " C(";i&; ") = ";:Entrada Cc$
C![i&]=Val(cc$)
EndWhile
Imprimir
S2000' Proc-Aufruf
PRINT " El Koeffizienten el Tschebyschow-Folge lauten: \n"
WhileLoop 0,m&:i&=&Loop
PRINT " A(";i&;") = ";+Formato$( "#0.##########",A![i&])
EndWhile
Imprimir:WaitInput 6000
Imprimir "\n El Koeffizienten des vereinfachten Polynoms lauten: \n"
WhileLoop 0,m1&:i&=&Loop
PRINT " C(";i&,") = ";Formato$("#0.##########",C![i&])
EndWhile
Beep:WaitInput
FIN
Proc S1000
'********************************************************
'* Chebyshev series coefficients evaluation subroutine *
'* The order of the polynomial is n. The coefficients *
'* are returned en the array B(i,j), i is the degree of *
'* the polynomial, j is the coefficient order. *
'********************************************************
'Establish t0 and t1 coefficients
B![0,0] = 1: B![1,0] = 0: B![1,1] = 1
'Volver if order is less than two:
Case n& < 2 : Volver
WhileLoop 2,n&:i&=&Loop
WhileLoop i&:j&=&Loop
'Basic recursion relation
B![i&,j&] = 2*B![i&-1,j&-1]-B![i&-2,j&]
EndWhile
B![i&,0]= -1*B![i&-2,0]
EndWhile
ENDPROC
Proc S2000
'************************************************************
'* Chebyshev economization subroutine. The program takes *
'* the input polynomial coefficients, C(i), and returns the *
'* Chebyshev series coefficients, A(i). The degree of the *
'* series passed to the routine is m. The degree of the *
'* series returned is m1. The maximum range of x is x0 used *
'* for scaling. Note that the input series coefficients are *
'* nulled during the process, and then set equal to the *
'* economized series coefficients. *
'************************************************************
'Start by scaling the input coefficients according to C(i)
B!=x0!
WhileLoop m&:i&=&Loop
C![i&]=C![i&]*B!
B!=B!*x0!
EndWhile
'Call Chebyshev series coefficients subroutine
WhileLoop m&,0,-1:n&=&Loop
S1000'proc-Aufruf
A![n&]=C![n&]/B![n&,n&]
WhileLoop 0,n&:l&=&Loop
'Chebyshev series of order l is substracted out of the polynomial
C![L&]=C![l&]-A![n&]*B![n&,l&]
EndWhile
EndWhile
'Perform truncation
WhileLoop 0,m1&:i&=&Loop
WhileLoop 0,i&:j&=&Loop
C![j&] = C![j&] + A![i&] * B![i&,j&]
EndWhile
EndWhile
'Convert back to the interval X0
B!=1/x0!
WhileLoop m1&:i&=&Loop
C![i&]=C![i&]*B!
B!=B!/x0!
EndWhile
ENDPROC
'End of file Chebecon.prf
|
|
|
| Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 22.05.2021 ▲ |
|
|
|