Решение обратной задачи вихретокового контроля
H : real; {generalized lift-off of probe}
Kr : real; {parameter of probe}
eps : real; {error of integration}
xMax : real; {upper bound of integration}
steps : integer; {current number of integration steps}
maxsteps: integer; {max number of integration steps}
Nlay : integer; {number of layers in slab}
sigma : Parameters; {conductivity of layers}
m : Parameters; {relative permeability of layers}
b : Parameters; {thickness of layers}
zCentre : Parameters; {centre of layer}
end;
procFunc = procedure( x:real; var result:complex);
Var
siB, siC, siD : Parameters; {support for Spline approx.}
cInfo : commonInfo; {one-way access low level info}
function siSpline( x:real ) : real;{Spline approximation}
begin
if( appCount = 1 )then
siSpline := appSigma[ 1 ]
else
siSpline:=Seval( appCount, x, appSigma, siB, siC, siD);
end;
function siExp( x:real ) : real;{Exponential approximation}
begin
siExp:=(appSigma[2]-appSigma[1])*EXP( -appSigma[3]*(1-x) ) + appSigma[1];
end;
function siPWConst( x:real ) : real;{Piecewise constant approximation}
var
dx, dh : real; i : byte;
begin
if( appCount = 1 )then siPWConst := appSigma[ 1 ]
else
begin
dh:=1/( appCount-1 );
dx:=dh/2;
i:=1;
while( x > dx ) do
begin
i:=i + 1;
dx:=dx + dh;
end;
siPWConst:=appSigma[ i ];
end;
end;
function siPWLinear( x:real ) : real;{Piecewise linear approximation}
var
dx, dh : real;
i : byte;
begin
if( appCount = 1 )then siPWLinear := appSigma[ 1 ]
else
begin
dh:=1/( appCount-1 );
dx:=0;
i:=1;
repeat
i:=i + 1;
dx:=dx + dh;
until( x <= dx );
siPWLinear:=appSigma[i-1]+( appSigma[i]-appSigma[i-1] )*( x/dh+2-i);
end;
end;
function siHyperTg( x:real ) : real;{Hyperbolic tangent approximation}
begin
siHyperTg:=appSigma[2]+(appSigma[1]-appSigma[2])*(1+th((appSigma[3]-x)/appSigma[4]))/2;
end;
procedure setApproximationType( approx : byte );
begin
appType := approx;
write('* conductivity approximation type : ');
case approx of
apSpline : begin
writeln('SPLINE');
getSiFunction := siSpline;
end;
apExp : begin
writeln('EXP');
getSiFunction := siExp;
end;
apPWCon : begin
writeln('PIECEWISE CONST');
getSiFunction := siPWConst;
end;
apPWLin : begin
writeln('PIECEWISE LINEAR');
getSiFunction := siPWLinear;
end;
apHypTg : begin
writeln('HYPERBOLIC TANGENT');
getSiFunction := siHyperTg;
end;
end;
end;
procedure setApproximationData( var SIG ; nVal : byte );
var
Sigma : Parameters absolute SIG; i:byte;
begin
appCount := nVal;
for i:=1 to nVal do appSigma[ i ]:=Sigma[ i ];
if( appType = apSpline )then Spline( appCount, appSigma, siB, siC, siD);
end;
procedure getApproximationData( var SIG ; var N : byte );
var
Sigma : Parameters absolute SIG; i:byte;
begin
N := appCount;
for i:=1 to appCount do Sigma[ i ]:=appSigma[ i ];
end;
procedure setApproximationItem( SIG:real ; N : byte );
begin
appSigma[ N ] := SIG;
if( appType = apSpline )then Spline( appCount, appSigma, siB, siC, siD);
end;
procedure functionFi( x:real ; var result:complex );{get boundary conditions function value}
var
beta : array[ 1..maxPAR ]of real;
q : array[ 1..maxPAR ]of complex;
fi : array[ 0..maxPAR ]of complex;
th , z1 , z2 , z3 , z4 , z5 , z6 , z7 : complex;
i : byte;
begin
mkComp( 0, 0, fi[0] );
with cInfo do
for i:=1 to Nlay do
begin
beta[i]:=R*sqrt( w*mu0*sigma[i] ); {calculation of beta}
mkComp( sqr(x), sqr(beta[i])*m[i], z7 ); {calculation of q, z7=q^2}
SqrtC( z7, q[i] );
mulComp( q[i], b[i], z6 ); {calculation of th,z6=q*b}
tanH( z6, th ); {th=tanH(q*b)}
mkComp( sqr(m[i])*sqr(x), 0, z6 ); {z6=m2x2}
SubC( z6, z7, z5); {z5=m2x2-q2}
AddC( z6, z7, z4); {z4=m2x2+q2}
MulC( z5, th, z1); {z1=z5*th}
MulC( z4, th, z2); {z2=z4*th}
mulComp( q[i], 2*x*m[i], z3 ); {z3=2xmq}
SubC( z2, z3, z4 );
MulC( z4, fi[i-1], z5 );