|
DataMuseum.dkPresents historical artifacts from the history of: RegneCentralen GIER Computer |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RegneCentralen GIER Computer Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 3437 (0xd6d) Description: Bits:30000630 Kt. nr.: 44 Type: A Program: Romberg special med _f_i_n_i_s og … Types: 8-hole paper tape Notes: Gier Text
edit,ofree< _[ s t o p ] boolean procedure Romberg special(f,n,a,b,delta,max ord,rom); _______ _________value n,a,b,delta ; _____real a,b,delta ; ____integer n, max ord ; _______array rom ; _____procedure f ; _________comment Romberg special integrates simultaneously n functions _______(f) depending upon a real variable from a to b. The parameters are: Inputf: A procedure which computes the values of the n _________functions. It must have the form: f(variable,result),with real variable and array result [1:n]. ____ _____n: Number of functions integrated simultaneously. a: Lower limit. b: Upper limit. delta: A relative tolerance. Input/Output max ord: On entry the maximum number of iterations. On exit the number of iterations performed. Outputrom: An array containing the n integration results. _____Romberg special: is true when the desired accuracy is ____obtained, otherwise it is false; _____begin _____real step,x; ____integer i,j,k,p; _______array I1,I2,sum,error,f0[1:n],trapez[1:n,1:max ord+1]; _____step:=b-a; f(a,I1); f(b,I2);for i:=1 step 1 until n do ___ ____ _____ __begin _____trapez[i,1]:=(I1[i]+I2[i])⨯step/2; I1[i]:=0end; ___for k:=1 step 1 until max ord do ___ ____ _____ __begin _____for i:=1 step 1 until n do sum[i]:=error[i]:=0; ___ ____ _____ __step:=step/2;p:=2∧k; |for j:=p-1 step -2 until 1 do ___ ____ _____ __begin _____x:=j/p; x:=x⨯a+(1-x)⨯b; f(x,f0);for i:=1 step 1 until n do ___ ____ _____ __begin _____I2[i]:=sum[i]+f0[i]; error[i]:=error[i]+(f0[i]-(I2[i]-sum[i])); sum[i]:=I2[i]end for i ___end summation of function values and errors; ___for i:=1 step 1 until n do ___ ____ _____ __I2[i]:=trapez[i,k+1]:=trapez[i,k]/2+(I2[i]+error[i])⨯step;comment this was a trapezoidal integration with 2∧k _______ |subintervals; p:=1;for j:=k step -1 until 1 do ___ ____ _____ __begin _____p:=4⨯p;for i:=1 step 1 until n do ___ ____ _____ __I2[i]:=trapez[i,j]:=(I2[i]⨯p-trapez[i,j])/(p-1)end the extrapolation from the k first approximants; ___for i:=1 step 1 until n do ___ ____ _____ __begin _____if abs(I2[i]-I1[i])>delta⨯abs(I2[i]) then goto continue __ ____ ____end; ___goto finis; ____continue:for i:=1 step 1 until n do I1[i]:=I2[i] ___ ____ _____ __end for k, i.e. a whole iteration; ___finis:Romberg special:=k_max ord; <max ord:=k;for i:=1 step 1 until n do rom[i]:=I2[i] ___ ____ _____ __end Romberg special; ___finis _____[ e n d ] [ s t o p ] res,romberg< t<