• 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 






..




43
:


-2136
򠠠 _______________________

1998


( 2 u/ t2) = c 2 * ( 2u/ x2) (1). u(x,t)
0 < x < a, 0 < t £ T,
u(x,0) = f(x), u(x,0)/ t = g(x) , 0 £ x £ a
u(0,t) = u(1,t)=0.

t ct (1)
( 2 u/ t2)
= (
2u/ x2), = 1.

D = (x,t) xi = ih,
i=0,1 ... n , a = h * n, tj = j* ttt , j = 0,1 ... , m, t m = T (1)
. t T j+1 j j-1 0 i-1 i i+1

,
(1) . ui,j+1 - 2uij + ui,j-1 ui+1,,j - 2uij + ui-1, j t 2 h2
(4)
uij
- u(x,t) (xi,tj).
,
l = t / h ,
ui,j+1
= 2(1- l 2 )ui,j + l 2 (ui+1,j- ui-1,j) - ui,j-1
, i = 1,2 ... n. (5)

, .. m 1(t)
º 0, m 2(t) º 0. , (5) u0,j= 0, unj=0
j. (5)
j-1, j , j+1. (5) , .. ui,j
u .

ui,j
u(x,t) (xi,tj) i =1, ... n, j=1,2, ... ,m .
, ( j = 2,3,4, ...
n) ( j=0,1,2, ... ,
n-1) (5). (j=0)
ui0 = f(xi).

(j=1)
, , u(x,0)/ t ( u( x, t )
- u(x,0) )/ t (6) , ui1=ui0+ + t (xi),
i=1,2, ... n.
(5).
(5).

( t +h2).
t
(6).
,
t < h.
, , , ,
,
.
, .. h 0

.

, h x ,

t t .
T ,
t.
.

.

(5)
, Subroutine GIP3 Begn ... End .

.

:
hx - h
;
ht - 蠠 t t;
k -
x, a = hn;
u1 - k
, ( j - 1 ) ,
j = 1, 2, ... ;
u2 - n
, j - , j =
1, 2, ... ;
u3 -
k .

:
u1 - n
, j - , j =
1, 2, ... ;
u2 - n
, ( j +1) -
, j = 1, 2, ... .

, Subroutine GIP3 Begin ... End
,
u2 , u1 -
, (6).
GIP3 u2 ,
u1 - .

:
1)
u1, u2, u3;
2)
n, hx, ht, ;
3)
(6)
;
4)
GIP3 k-1 , k- ( k ³ 2 ).
: 1 0.5 0.5

,
. .
h x, 0.1,
t t, 0.05,
16 . ,

( 2 u/ t2) = ( 2 u/ x 2) , x Î [ 0 , 1 ] , t Î [ 0 , T ] ,
u ( x , 0 ) = f
(x) , x Î [ 0 , a ], u(x,0)/ t =
g(x) , x Î [ 0 , a ],
u ( 0 , t ) =
0, u ( 1 , t ) = 0, t Î [ 0 , 0.8 ],

æ 2x , x Î [ 0 , 0.5 ] ,
f(x) = í g( x ) = 0
î 2 - 2x , x Î [ 0.5 , 1 ] ,

11 x 16 t. ,
.
{
************************************************************* }
{
3 (
. 12) }
{
------------ }
{
- }
{ . }
{ . -2136 .. }
{
************************************************************* }
Program
Laboratornaya_rabota_43_variant_12;
Const
hx = 0.1 ; { x - hx }
ht = 0.05 ; { t - ht }
n =
11 ; { }
Function
f(x : Real) : Real; { }
{
t=0 }
Begin
f := sin(pi * x) * cos(x);
End;
Function
g(x : Real) : Real; { }
{
t=0 }
Begin
g := 0;
End;
Var
xp : Array[1..n] of Real;
i,j,n1 : Word;
x,t,a1,b1 : Real;
u1,u2,u3 : Array[1..n] of Real;
Begin
n1 := n;
WriteLn(' 4');
WriteLn('------------');
WriteLn(',
:');
WriteLn;
xp[1] := 0;
xp[n] := 1;
For i := 2 to ( n - 1 ) do
Begin
x := (i-1) * hx;
xp[i] := x;
u1[i] := f(x); { u(x,0) 0 }
u2[i] := u1[i] + ht * g(x); { u(x,ht) 1 }
End;
{
///
\\\ }
u1[1] := 0 ; { u(0,0) }
u1[n] := 0 ; { u(1,0) }
u2[1] := 0 ; { u(0,ht) }
u2[n] := 0 ; { u(1,ht) }
u3[1] := 0 ; { u(0,2ht) }
u3[n] := 0 ; { u(1,2ht) }
{
/// ࠠ \\\
}
Write(' ');
For i := 1 to n do Write(' x=', xp[i]:1:1);
WriteLn;
t := 0;
{
///
堠 \\\ }
Write('t=',t:2:2,' ');
For i := 1 to n do
If u1[i] >= 0 then Write(' ',u1[i]:3:3)
else Write(u1[i]:3:3) ;
t := t + ht;
{
///
堠 \\\ }
WriteLn;
Write('t=',t:2:2,' ');
For i := 1 to n do
If u2[i] >= 0 then Write(' ',u2[i]:3:3)
else Write(u2[i]:3:3);
For j := 1 to 15 do
Begin
{Subroutine GIP3 Begin}
n1 := n1-1;
{
}
a1 := ht/hx;
if a1 > 1 then WriteLn('
') else
Begin
b1 := a1 * a1;
a1 := 2 * ( 1 - b1);
{
}
For i := 2 to n do u3[i] := a1*u2[i]
+ b1 * (u2[i+1] +
u2[i-1]) - u1[i];
For i := 2 to n do
Begin
u1[i] := u2[i];
u2[i] := u3[i]
End;
End;
u1[n] := 0;
u2[n] := 0;
u3[n] := 0;
{Subroutine GIP3 End}
t := t + ht;
WriteLn;
Write('t=',t:2:2,' ');
For i := 1 to n do
{ }
If u2[i] >= 0 then Write('
',u2[i]:3:3) else Write(u2[i]:3:3);
End;
WriteLn;
WriteLn;
End.
{
************************************************************* }
{
3 (
. 13) }
{
------------ }
{
- }
{ . }
{ . -2136 .. }
{
************************************************************* }
Program
Laboratornaya_rabota_43_variant_13;
Const
hx = 0.1 ; { x - hx }
ht = 0.05 ; { t - ht }
n =
11 ; { }
Function
f(x : Real) : Real; { }
{
t=0 }
Begin
f := sin(pi * x * x);
End;
Function
g(x : Real) : Real; { }
{
t=0 }
Begin
g := 0;
End;
Var
xp : Array[1..n] of Real;
i,j,n1 : Word;
x,t,a1,b1 : Real;
u1,u2,u3 : Array[1..n] of Real;
Begin
n1 := n;
WriteLn(' 4');
WriteLn('------------');
WriteLn(',
:');
WriteLn;
xp[1] := 0;
xp[n] := 1;
For i := 2 to ( n - 1 ) do
Begin
x := (i-1) * hx;
xp[i] := x;
u1[i] := f(x); { u(x,0) 0 }
u2[i] := u1[i] + ht * g(x); { u(x,ht) 1 }
End;
{
///
\\\ }
u1[1] := 0 ; { u(0,0) }
u1[n] := 0 ; { u(1,0) }
u2[1] := 0 ; { u(0,ht) }
u2[n] := 0 ; { u(1,ht) }
u3[1] := 0 ; { u(0,2ht) }
u3[n] := 0 ; { u(1,2ht) }
{
/// ࠠ \\\
}
Write(' ');
For i := 1 to n do Write(' x=', xp[i]:1:1);
WriteLn;
t := 0;
{
///
堠 \\\ }
Write('t=',t:2:2,' ');
For i := 1 to n do
If u1[i] >= 0 then Write(' ',u1[i]:3:3)
else Write(u1[i]:3:3) ;
t := t + ht;
{
///
堠 \\\ }
WriteLn;
Write('t=',t:2:2,' ');
For i := 1 to n do
If u2[i] >= 0 then Write(' ',u2[i]:3:3)
else Write(u2[i]:3:3);
For j := 1 to 15 do
Begin
{Subroutine GIP3 Begin}
n1 := n1-1;
{
}
a1 := ht/hx;
if a1 > 1 then WriteLn('
') else
Begin
b1 := a1 * a1;
a1 := 2 * ( 1 - b1);
{
}
For i := 2 to n do u3[i] := a1*u2[i]
+ b1 * (u2[i+1] +
u2[i-1]) - u1[i];
For i := 2 to n do
Begin
u1[i] := u2[i];

u2[i] := u3[i]
End;
End;
u1[n] := 0;
u2[n] := 0;
u3[n] := 0;
{Subroutine GIP3 End}
t := t + ht;
WriteLn;
Write('t=',t:2:2,' ');
For i := 1 to n do
{ }
If u2[i] >= 0 then Write('
',u2[i]:3:3) else Write(u2[i]:3:3);
End;
WriteLn;
WriteLn;
End.
{
************************************************************* }
{
3 (
. 14) }
{
------------ }
{
- }
{ . }
{ . -2136 .. }
{
************************************************************* }
Program
Laboratornaya_rabota_43_variant_14;
Const
hx = 0.1 ; { x - hx }
ht = 0.05 ; { t - ht }
n =
11 ; { }
Function
f(x : Real) : Real; { }
{
t=0 }
Begin
f := x * sin( 2 * (x - 1) );
End;
Function
g(x : Real) : Real; { }
{
t=0 }
Begin
g := 0;
End;
Var
xp : Array[1..n] of Real;
i,j,n1 : Word;
x,t,a1,b1 : Real;
u1,u2,u3 : Array[1..n] of Real;
Begin
n1 := n;
WriteLn(' 4');
WriteLn('------------');
WriteLn(',
:');
WriteLn;
xp[1] := 0;
xp[n] := 1;
For i := 2 to ( n - 1 ) do
Begin
x := (i-1) * hx;
xp[i] := x;
u1[i] := f(x); { u(x,0) 0 }
u2[i] := u1[i] + ht * g(x); { u(x,ht) 1 }
End;
{
///
\\\ }
u1[1] := 0 ; { u(0,0) }
u1[n] := 0 ; { u(1,0) }
u2[1] := 0 ; { u(0,ht) }
u2[n] := 0 ; { u(1,ht) }
u3[1] := 0 ; { u(0,2ht) }
u3[n] := 0 ; { u(1,2ht) }
{
/// ࠠ \\\
}
Write(' ');
For i := 1 to n do Write(' x=', xp[i]:1:1);
WriteLn;
t := 0;
{
///
堠 \\\ }
Write('t=',t:2:2,' ');
For i := 1 to n do
If u1[i] >= 0 then Write(' ',u1[i]:3:3)
else Write(u1[i]:3:3) ;
t := t + ht;
{
///
堠 \\\ }
WriteLn;
Write('t=',t:2:2,' ');
For i := 1 to n do
If u2[i] >= 0 then Write(' ',u2[i]:3:3)
else Write(u2[i]:3:3);
For j := 1 to 15 do
Begin
{Subroutine GIP3 Begin}
n1 := n1-1;
{
}
a1 := ht/hx;
if a1 > 1 then WriteLn('
') else
Begin
b1 := a1 * a1;
a1 := 2 * ( 1 - b1);
{
}
For i := 2 to n do u3[i] := a1*u2[i]
+ b1 * (u2[i+1] +
u2[i-1]) - u1[i];
For i := 2 to n do
Begin
u1[i] := u2[i];
u2[i] := u3[i]
End;
End;
u1[n] := 0;
u2[n] := 0;
u3[n] := 0;
{Subroutine GIP3 End}
t := t + ht;
WriteLn;
Write('t=',t:2:2,' ');
For i := 1 to n do
{ }
If u2[i] >= 0 then Write('
',u2[i]:3:3) else Write(u2[i]:3:3);
End;
WriteLn;
WriteLn;
End.
{
************************************************************* }
{
3 (
. 20) }
{
------------ }
{
- }
{ . }
{ . -2136 .. }
{
************************************************************* }
Program
Laboratornaya_rabota_43_variant_20;
Const
hx = 0.1 ; { x - hx }
ht = 0.05 ; { t - ht }
n =
11 ; { }
Function
f(x : Real) : Real; { }
{
t=0 }
Begin
f := 10 * x * ( x * x * x - 1 );
End;
Function
g(x : Real) : Real; { }
{
t=0 }
Begin
g := 0;
End;
Var
xp : Array[1..n] of Real;
i,j,n1 : Word;
x,t,a1,b1 : Real;
u1,u2,u3 : Array[1..n] of Real;
Begin
n1 := n;
WriteLn(' 4');
WriteLn('------------');
WriteLn(',
:');
WriteLn;
xp[1] := 0;
xp[n] := 1;
For i := 2 to ( n - 1 ) do
Begin
x := (i-1) * hx;
xp[i] := x;
u1[i] := f(x); { u(x,0) 0 }
u2[i] := u1[i] + ht * g(x); { u(x,ht) 1 }
End;
{
///
\\\ }
u1[1] := 0 ; { u(0,0) }
u1[n] := 0 ; { u(1,0) }
u2[1] := 0 ; { u(0,ht) }
u2[n] := 0 ; { u(1,ht) }
u3[1] := 0 ; { u(0,2ht) }
u3[n] := 0 ; { u(1,2ht) }
{
/// ࠠ \\\
}
Write(' ');
For i := 1 to n do Write(' x=', xp[i]:1:1);
WriteLn;
t := 0;
{
///
堠 \\\ }
Write('t=',t:2:2,' ');
For i := 1 to n do
If u1[i] >= 0 then Write(' ',u1[i]:3:3)
else Write(u1[i]:3:3) ;
t := t + ht;
{
///
堠 \\\ }
WriteLn;
Write('t=',t:2:2,' ');
For i := 1 to n do
If u2[i] >= 0 then Write(' ',u2[i]:3:3)
else Write(u2[i]:3:3);
For j := 1 to 15 do
Begin
{Subroutine GIP3 Begin}
n1 := n1-1;
{
}
a1 := ht/hx;
if a1 > 1 then WriteLn('
') else
Begin
b1 := a1 * a1;
a1 := 2 * ( 1 - b1);
{
}
For i := 2 to n do u3[i] := a1*u2[i]
+ b1 * (u2[i+1] +
u2[i-1]) - u1[i];
For i := 2 to n do
Begin
u1[i] := u2[i];
u2[i] := u3[i]
End;
End;
u1[n] := 0;
u2[n] := 0;
u3[n] := 0;
{Subroutine GIP3 End}
t := t + ht;
WriteLn;
Write('t=',t:2:2,' ');
For i := 1 to n do
{ }
If u2[i] >= 0 then Write('
',u2[i]:3:3) else Write(u2[i]:3:3);
End;
WriteLn;
WriteLn;
End.
{
************************************************************* }
{
1 (
) }
{
------------ }
{
- }
{ . }
{ . -2136 .. }
{
.. }
{
.. }
{
.. }
{
.. }
{
************************************************************* }
Program
Laboratornaya_rabota_43;
Const
hx = 0.1 ; { x - hx }
ht = 0.05 ; { t - ht }
n =
11 ; { }
Function
f(x : Real) : Real; { }
{
t=0 }
Begin
If x <= 0.5 then
f := 2 * x
else
f := 2 - 2 * x;
End;
Function
g(x : Real) : Real; { }
{
t=0 }
Begin
g := 0;
End;
Var
xp : Array[1..n] of Real;
i,j,n1 : Word;
x,t,a1,b1 : Real;
u1,u2,u3 : Array[1..n] of Real;
Begin
n1 := n;
WriteLn(' 2');
WriteLn('------------');
WriteLn(',
:');
WriteLn;
xp[1] := 0;
xp[n] := 1;
For i := 2 to ( n - 1 ) do
Begin
x := (i-1) * hx;
xp[i] := x;
u1[i] := f(x); { u(x,0) 0 }
u2[i] := u1[i] + ht * g(x); { u(x,ht) 1 }
End;
{
///
\\\ }
u1[1] := 0 ; { u(0,0) }
u1[n] := 0 ; { u(1,0) }
u2[1] := 0 ; { u(0,ht) }
u2[n] := 0 ; { u(1,ht) }
u3[1] := 0 ; { u(0,2ht) }
u3[n] := 0 ; { u(1,2ht) }
{
/// ࠠ \\\
}
Write(' ');
For i := 1 to n do Write(' x=', xp[i]:1:1);
WriteLn;
t := 0;
{
///
堠 \\\ }
Write('t=',t:2:2,' ');
For i
:= 1 to n do
If u1[i] >= 0 then Write(' ',u1[i]:3:3)
else Write(u1[i]:3:3) ;
t := t + ht;
{
///
堠 \\\ }
WriteLn;
Write('t=',t:2:2,' ');
For i := 1 to n do
If u2[i] >= 0 then Write(' ',u2[i]:3:3)
else Write(u2[i]:3:3);
For j := 1 to 15 do
Begin
{Subroutine GIP3 Begin}
n1 := n1-1;
{
}
a1 := ht/hx;
if a1 > 1 then WriteLn('
') else
Begin
b1 := a1 * a1;
a1 := 2 * ( 1 - b1);
{
}
For i := 2 to n do u3[i] := a1*u2[i]
+ b1 * (u2[i+1] +
u2[i-1]) - u1[i];
For i := 2 to n do
Begin
u1[i] := u2[i];
u2[i] := u3[i]
End;
End;
u1[n] := 0;
u2[n] := 0;
u3[n] := 0;
{Subroutine GIP3 End}
t := t + ht;
WriteLn;
Write('t=',t:2:2,' ');
For i := 1 to n do
{ }
If u2[i] >= 0 then Write('
',u2[i]:3:3) else Write(u2[i]:3:3);
End;
WriteLn;
WriteLn;
End.
{
************************************************************* }
{
3 (
. 11) }
{
------------ }
{
- }
{ . }
{ . -2136 .. }
{
************************************************************* }
Program
Laboratornaya_rabota_43_variant_11;
Const
hx = 0.1 ; { x - hx }
ht = 0.05 ; { t - ht }
n =
11 ; { }
Function
f(x : Real) : Real; { }
{
t=0 }
Begin
f := x * ( x * x - 1 );
End;
Function
g(x : Real) : Real; { }
{
t=0 }
Begin
g := 0;
End;
Var
xp : Array[1..n] of Real;
i,j,n1 : Word;
x,t,a1,b1 : Real;
u1,u2,u3 : Array[1..n] of Real;
Begin
n1 := n;
WriteLn(' 4');
WriteLn('------------');
WriteLn(',
:');
WriteLn;
xp[1] := 0;
xp[n] := 1;
For i := 2 to ( n - 1 ) do
Begin
x := (i-1) * hx;
xp[i] := x;
u1[i] := f(x); { u(x,0) 0 }
u2[i] := u1[i] + ht * g(x); { u(x,ht) 1 }
End;
{
///
\\\ }
u1[1] := 0 ; { u(0,0) }
u1[n] := 0 ; { u(1,0) }
u2[1] := 0 ; { u(0,ht) }
u2[n] := 0 ; { u(1,ht) }
u3[1] := 0 ; { u(0,2ht) }
u3[n] := 0 ; { u(1,2ht) }
{
/// \\\
}
Write(' ');
For i := 1 to n do Write(' x=', xp[i]:1:1);
WriteLn;
t := 0;
{
///
堠 \\\ }
Write('t=',t:2:2,' ');
For i := 1 to n do
If u1[i] >= 0 then Write(' ',u1[i]:3:3)
else Write(u1[i]:3:3) ;
t := t + ht;
{
///
堠 \\\ }
WriteLn;
Write('t=',t:2:2,' ');
For i := 1 to n do
If u2[i] >= 0 then Write(' ',u2[i]:3:3)
else Write(u2[i]:3:3);
For j := 1 to 15 do
Begin
{Subroutine GIP3 Begin}
n1 := n1-1;
{
}
a1 := ht/hx;
if a1 > 1 then WriteLn('
') else
Begin
b1 := a1 * a1;
a1 := 2 * ( 1 - b1);
{
}
For i := 2 to n do u3[i] := a1*u2[i]
+ b1 * (u2[i+1] +
u2[i-1]) - u1[i];
For i := 2 to n do
Begin
u1[i] := u2[i];
u2[i] := u3[i]
End;
End;
u1[n] := 0;
u2[n] := 0;
u3[n] := 0;
{Subroutine GIP3 End}
t := t + ht;
WriteLn;
Write('t=',t:2:2,' ');
For i := 1 to n do
{ }
If u2[i] >= 0 then Write('
',u2[i]:3:3) else Write(u2[i]:3:3);
End;
WriteLn;
WriteLn;
End.
. . . . . . . . . . . . . . .

      ©2010