English
Source / code snippets

Interpolation through Kettenbruch-development: The Thiele-Algorithmus

 

p.specht

Interpolation supply always exakte values on whom Stützstellen. the distinguish tappt im dunkeln from the Approximation, The attempts, so-called Ausgleichskurven between many Messdaten with geringstem Error einzupassen.

an Interpolation through konvergente Kettenbruch-development has following strength: Rationale functions can already on Base of few Stützstellen so develops go, that good Näherungen existieren; a excellently Variant the undertow. Thiele'sche Kettenbruch. The here found (in the wahrsten senses the Wortes) "Bruchstücke" go outputted, subsequently can x-values association go, circa Zwischenwerte between whom Stützstellen abzufragen.
as demonstration watts on File-I/O waived. without each Gewähr:
Window Title "Interpolation through konvergente Kettenbruchentwicklung"
Window Style 24:randomize:font 2:set("decimals",17)
'{ Interpolation through Kettenbruchentwicklung
'*************************************************************
'*    Interpolate a function F(x) by continuous fractions    *
'* --------------------------------------------------------- *
'* SAMPLE RUN:                                               *
'* (Interpolate function e(x) between x=0 and x=2)           *
'*                                                           *
'* Number of points: 3                                       *
'* X, Y: 0,1                                                 *
'* X, Y: 1,2.71828                                           *
'* X, Y: 2,7.38906                                           *
'*                                                           *
'* Coefficients D(k):                                        *
'* D(0) =      1.000000                                      *
'* D(1) =      0.581977                                      *
'* D(2) =     -3.718271                                      *
'*                                                           *
'* X = 1.5                                                   *
'*                                                           *
'* For X = 1.5    Y =    4.351909                            *
'*                                                           *
'* --------------------------------------------------------- *
'* Ref.: "Methodes de calcul numerique, Tome 2 By Claude     *
'*        Nowakowski, PSI Edition, 1984" [BIBLI 04].         *
'*                                                           *
'*                       Basic Release By J-P Moreau, Paris. *
'*                                (www.jpmoreau.fr)          *
'*************************************************************
'*                                                           *
'*       XProfan-Version by 2014-10 by P.woodpecker, Wien        *
'*                                                           *
'}************************************************************
CLS rnd(8^8)
Declare n1&,n&,m&,K&,L&,xxx!,yyy!,DD!,DL!,XX!,s!
PRINT "\n amount Stützwerte: ";:INPUT  n1& :print
N&=n1&-1
Declare X![N&],Y![N&],D![N&]
'Read data from screen

whileloop 0,n&:k&=&Loop

    print "  X("+st$(k&)+") = ";
    input xxx!
    X![K&]=xxx!
    print tab(20);" Y("+st$(k&)+") = ";
    input yyy!
    Y![K&]=yyy!

endwhile

'Calculate coefficients D(k)

whileloop 0,n&:k&=&Loop

    D![K&] = Y![K&]

endwhile

M&=N&

whileloop m&:L&=&Loop

    whileloop L&,N&:K&=&Loop

        DD! = (X![K&]-X![L&-1])/(D![K&]-D![L&-1])

        IF K&<>L&

            D![K&]=DD!

        ELSE

            DL!=DD!

        ENDIF

    endwhile

    D![L&]=DL!

endwhile

'print coefficients
PRINT
PRINT " Koeffizienten D(k):"

whileloop 0,n&:k&=&Loop

    PRINT " D[";K&; "] = ";
    PRINT stature$("%g",D![K&])

endwhile

REPEAT

    'Interpolate for X=XX
    PRINT
    print " X = ",:Input XX!
    'Evaluate continuous fraction
    s!=(XX!-X![N&-1])/D![N&]

    whileloop n&-1,1,-1:k&=&Loop

        s!=(XX!-X![K&-1])/(D![K&]+s!)

    endwhile

    s!=s!+D![0]
    case %csrlin>23:cls rnd(8^8)
    PRINT
    PRINT " for the inputted X=";stature$("%g",XX!);" is (your Stützwerte zugrunde- "
    print " laid) the interpolation Funktionswert Y =";stature$("%g",s!)
    print "---------------------------------------------------------------------"
    waitinput

UNTIL 0

 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/16/21  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.447 Views

Untitledvor 0 min.
Erhard Wirth06/14/24
p.specht11/21/21
R.Schneider11/20/21
Uwe Lang11/20/21
More...

Themeninformationen

this Topic has 1 subscriber:

p.specht (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie