,,,
.
.
.
2003
.
1) . . =1.25.
xi | 1 | 1.5 | 2 | 2.5 | 3 | 3.5 |
yi | 0.5 | 2.2 | 2 | 1.8 | 0.5 | 2.25 |
2) . . =1.2.
xi | 0 | 0.25 | 1.25 | 2.125 | 3.25 |
yi | 5.0 | 4.6 | 5.7 | 5.017 | 4.333 |
3) . .
xi | 7 | 9 | 13 |
yi | 2 | -2 | 3 |
.
:
x0 | x1 | x2 | ... | Xn-1 | xn |
y0 | y1 | y2 | ... | yn-1 | yn |
f x,
[x0..xn] xi. f(x), .
F(x), f(x) x0, x1, x2,... xn. , x0,x1,x2,...xn - . n :
Pn(x)=a0xn+a1xn-1+a2xn-2+...+an-1x+an
, n. . .
, , .
Ln(x) n, Ln(xi)=yi . :
Ln(x)=l0(x)+ l1(x)+ l2(x)+...+ ln(x), (1)
lk(xi)= yi, i=k, lk(xi)= 0, i≠k;
lk(x) :
lk(x)= (2)
(2) (1) Ln(x) :
f(x), , n+1 , :
0<θ<1 (3)
.
xi+1-xi=h x=0..n-1.
k- :
Δyi=yi+1-yi
Δ2yi= Δyi+1- Δyi=yi+2-2yi+1+yi
Δkyi=yi+k-kyi+1-k+k(k-1)/2!*yi+k-2+...+(-1)kyi
:
Pn(x)=a0+a1(x-x0)+a2(x-x0)(x-x1)+...+an(x-x0)(x-x1)...(x-xn-1)
a0, a1, a2, ...,an:
x=x0, a0=P(x0)=y0;
x1, x2, ...,xn :
a1=Δy0/h
a2=Δ2y0/2!h2
a3=Δ3y0/3!h3
....................
an=Δny0/n!hn
:
Pn(x)=y0+ Δy0/h*(x-x0)+ Δ2y0/2!h2*(x-x0)(x-x1)+...+ Δny0/n!hn*(x-x0)(x-x1)...(x-xn-1) (1)
(1) :
: t=(x-x0)/h, x=x0+th (1) :
Pn(x)=y0+tΔy0+t(t-1)/2! Δ2y0+...+t(t-1)...(t-n+1)/n!Δny0 (2)
(2) .
:
(3)
, .
, , . . [xi, xi+1], i=0..n-1 . , , -, .
[xi, xi+1] :
, ai,bi,ci,di .
Si(xi)=yi :
, ..:
,i=0..n-1; (1)
:
,i=0..n-2; (2)
,i=0..n-2; (3)
(1) n 3n
,i=0..n-1; (1*)
(2) (3) 2(n-1) :
,i=0..n-1; (2*)
,i=1..n-1; (3*)
. , 0 n . 3*n 3*n . , [xi, xi+1] Si.
procedure TForm1.Button1Click(Sender: TObject);
type tip=array of real;
var x,y:tip;
i,j,n:byte;
p,s,xx:real;
begin
n:=edt.Count;
setlength(x,n);
setlength(y,n);
for i:=0 to n-1 do x[i]:=edt.massiv[i];edt.Lines.Delete(0);
for i:=0 to n-1 do y[i]:=edt.massiv[i];edt.Lines.Delete(0);
xx:=strtofloat(edt.Text);
edt.Lines.Delete(0);
s:=0;
for i:=0 to n-1 do
begin
p:=1;
for j:=0 to n-1 do if i<>j then p:=p*(xx-x[j])/(x[i]-x[j]);
p:=p*y[i];
s:=s+p;
end;
edt.writer('',1);
edt.writer('',s,1);
end;
( , ).
procedure TForm1.Button1Click(Sender: TObject);
var b,c,d,x,y:array of real;
urm:array of array of real;
i,j,k,n :byte;
begin
n:=edt.Count;
setlength(x,n);setlength(y,n);
for i:=0 to n-1 do x[i]:=edt.massiv[i];edt.Lines.Delete(0);
for i:=0 to n-1 do y[i]:=edt.massiv[i];edt.Lines.Delete(0);
setlength(b,n-1);setlength(c,n-1);setlength(d,n-1);
setlength(urm,3*(n-1),3*(n-1)+1);
for i:=0 to 3*(n-1)-1 do
for j:=0 to 3*(n-1) do urm[i,j]:=0;
for i:=0 to n-1 do edt.writer(' ',y[i],0);
for i:=0 to n-2 do
begin
urm[i,3*i+0]:=x[i+1]-x[i];
urm[i,3*i+1]:=(x[i+1]-x[i])*(x[i+1]-x[i]);
urm[i,3*i+2]:=(x[i+1]-x[i])*(x[i+1]-x[i])*(x[i+1]-x[i]);
urm[i,3*(n-1)]:=y[i+1]-y[i];
end;
for i:=0 to n-3 do
begin
urm[i+n-1,3*i+0]:=1;
urm[i+n-1,3*i+1]:=2*(x[i+1]-x[i]);
urm[i+n-1,3*i+2]:=3*(x[i+1]-x[i])*(x[i+1]-x[i]);
urm[i+n-1,3*i+3]:=-1;
end;
for i:=0 to n-3 do
begin
urm[i+2*n-3,3*i+1]:=1;
urm[i+2*n-3,3*i+2]:=3*(x[i+1]-x[i]);
urm[i+2*n-3,3*i+4]:=-1;
end;
urm[3*n-5,0]:=1; urm[3*n-5,3*(n-1)]:=0;
urm[3*n-4,3*(n-1)-3]:=1;urm[i+2*n-3,3*(n-1)-2]:=2*(y[n-1]-y[n-2])]
urm[3*n-4,3*(n-1)-1]:=3*(y[n-1]-y[n-2]) *(y[n-1]-y[n-2]);
urm[i+2*n-3,3*(n-1)]:=0
for i:=0 to 3*(n-1)-1 do
begin
edt.writer('',1);
for j:=0 to 3*(n-1) do edt.writer(' ',urm[i,j],0);
end;
end;
. .
xi | 7 | 9 | 13 |
yi | 2 | -2 | 3 |
.
[xi, xi+1], i=0..2 :
, ai,bi,ci,di .
Si(xi)=yi :
, , :
.
[b1,c1,d1,b2,c2,d2]:
b1,c1,d1, [7..9]:
:
b2,c2,d2, [9..13]:
:
procedure TForm1.Button1Click(Sender: TObject);
type tip=array of real;
var x,y:tip;
i,j,n:byte;
p,s,xx,t,h:real;
kp:array of array of real;
begin
n:=edt.Count;
setlength(x,n);
setlength(y,n);
for i:=0 to n-1 do x[i]:=edt.massiv[i];edt.Lines.Delete(0);
for i:=0 to n-1 do y[i]:=edt.massiv[i];edt.Lines.Delete(0);
xx:=strtofloat(edt.Text);
edt.Lines.Delete(0);
setlength(kp,n,n);
for i:=0 to n-1 do for j:=0 to n-1 do kp[i,j]:=0;
for i:=0 to n-1 do kp[0,i]:=y[i];
for i:= 1 to n-1 do
for j:=0 to n-i-1 do
kp[i,j]:=kp[i-1,j+1]-kp[i-1,j];
for i:= 0 to n-1 do
begin
for j:=0 to n-1 do edt.writer(' ',kp[i,j],0);
edt.writer('',1);
end;
edt.writer('',1);
h:=0.5;
t:=(xx-x[0])/h;
s:=y[0];
for i:=1 to n-1 do
begin
p:=1;
for j:=0 to i-1 do p:=p*(t-j)/(j+1);
s:=s+p*kp[i,0];
end;
edt.writer('',s,1);;
end;
. . =1.25.
xi | 1 | 1.5 | 2 | 2.5 | 3 | 3.5 |
yi | 0.5 | 2.2 | 2 | 1.8 | 0.5 | 2.25 |
.
:
:
Pn(x)=y0+tΔy0+t(t-1)/2! Δ2y0+...+t(t-1)...(t-n+1)/n!Δny0
, :
P5(x)=2.2x5-24x4+101.783x3-20.2x2+211.417x-80.7
x=1.25; P(1.25)=2.0488;
:
. . =1.2.
xi | 0 | 0.25 | 1.25 | 2.125 | 3.25 |
yi | 5.0 | 4.6 | 5.7 | 5.017 | 4.333 |
.
L4(x), :
=1.2:
L4(1.2)=5.657;
. :
:
Copyright (c) 2024 Stud-Baza.ru , , , .