. , , ,

,,,

 

 

 
:


. - Mat LAB . . .


1.  .

( = +U(t) )

. Xm, tm, :

, Xm+1, , (I ). , .

: - "" . (- 1- ) :

 

Xm+1 = Xm+hmF(Xm+1, tm+1)

, Xm+1 . Xm, hm, tm+1- Xm+1. m.

( = +U(t) )

. Xm, tm, :

, Xm+1, , (I ). , .

.

1.. , :

 

iam = -0.5h2mX..(t-)

hm<= t-<= tm+1

 

2. 

F(X,t) Xm, hm, tm+1 ym+1

 

Ym+1 = ym+hym+1

r-hlr-1=0 "" r=1/(1-hl).

1.  (Re(hl)<0): |1/(1-hl)|<1

|1-hl|>1. :

 

[1-Re(h)]2 + Im((h)]2>1


, , Re(hl)<0, , [1-Re(h)]2 + Im((h)]2>1 - .

2.

(Re(hl)>0): |1/(1-hl)|>1.

:

|1/(1-hl)|<|ehl|

, |hl|1 . , ,

|1/(1-hl)|<|ehl| .

 

3. 

4.  . . .

, , . , , eam i , . , , . :

 

ea gon i <=0.001| X i | max, i=1,n

:

1. 

 

Xm+1 = Xm+hmF(Xm+1, tm+1

 

Xm+1 hm,

Xo=F(X,t).

 

2. :

 

eam i = |hm/(hm+hm+1)[(Xim+1 Xim) hm/hm-1(Xmi Xm-1i]|

3. 

 

eam i <ea gon i , i=1,n..

4.  i , hm , . . . .1.

5.  i, :

 

him+1 = ( ea gon i / |eam i |)*hm, i=1,n

6. :

hm+1=min hm+1i.

6. 

7.  tm+2=tm+1+hm+1 .1.

 

: , :

, . , . . . , - 4- .


4.

 

: 3- , Mat LAB - rkpost1.m ( ), rkper1.m ( ) (test.m).

: MatLAB (- 1- ).

:

Ø  rkper1.m

function [tout, yout, eout]=rkper1(funA, funB, funU, t0, tfinal, y0, ep, trace)

if nargin<7, ep=0.001; end

if nargin<8, trace=1; end

t=t0; y=y0;

tout=t; yout=y.';

h1=(tfinal-t)/20000;

h=h1*200;

if trace

clc, t, h, y

end

A=feval(funA);

B=feval(funB);

n=ones(max(size(y0)),1);

I=diag(n,0);

ym1=y0; yp1=y0;

while (t<tfinal)

U=feval(funU, t+h);

if (t+h)>tfinal, h=tfinal-t; end

yp1=(I-A*h)\(y+h*B*U);

eam=abs(h*((yp1-y)-h*(y-ym1)/h1)/(h+h1));

if eam<=ep

yt=(I-A*h/2)\((I-A*h/2)\(y+h/2*B*U)+h/2*B*U);

h1=h;

ym1=y;

y=yp1;

eout=[eout;abs(y-yt).'];

tout=[tout;t]; yout=[yout;y.'];

h=min(sqrt((n*ep)./eam)*h);

t=t+h;

else h=h/2;

end

if trace

home, t, h, y

end

end

Ø  rkpost1.m

function [tout, yout, eout]=rkpost1(funA, funB, funU, t0, tfinal, y0, h, trace)

if nargin<7, h=(tfinal-t0)/5; end

if nargin<8, trace=1; end

t=t0; y=y0;

tout=t; yout=y.';

if trace

clc, t, h, y

end

A=feval(funA);

B=feval(funB);

I=diag(ones(1,max(size(y0))),0);

while (t<tfinal)

U=feval(funU, t);

if (t+h)>tfinal, h=tfinal-t; end

yt=(I-A*h/2)\((I-A*h/2)\(y+h/2*B*U)+h/2*B*U);

t=t+h;

eout=[eout;abs(y-yt).'];

tout=[tout;t]; yout=[yout;y.'];

if trace

home, t, h, y

end

end

Ø  test.m

disp(' :')

pause

disp(' :')

pause

%

[t1,y1,e1]= rkper1 ('a','b','u',0,3.5,[0.1;0.1],0.01);

[t2,y2,e2]= rkper1 ('a','b','u',0,3.5,[0.5;0.5],0.01);

[t3,y3,e3]= rkper1 ('a','b','u',0,3.5,[1;1],0.01);

plot(t1,y1,t2,y2,t3,y3)

pause

t1e=t1(1:max(size(t1))-1);

t2e=t2(1:max(size(t2))-1);

t3e=t3(1:max(size(t3))-1);

plot(t1e,e1,t2e,e2,t3e,e3)

pause

disp(' :')

pause;

%

[tc1,yc1,ec1]=nrk1('a','b','u',0,3.5,[0.2;0.2],0.1);

[tc2,yc2,ec2]=nrk1('a','b','u',0,3.5,[0.2;0.2],0.01);

[tc3,yc3,ec3]=nrk1('a','b','u',0,3.5,[0.2;0.2],0.005);

plot(tc1,yc1,tc2,yc2,tc3,yc3)

pause

t1ec=tc1(1:max(size(tc1))-1);

t2ec=tc2(1:max(size(tc2))-1);

t3ec=tc3(1:max(size(tc3))-1);

plot(t1ec,ec1,t2ec,ec2,t3ec,ec3)

pause

[tc1,yc1,ec1]= rkpost1 ('a','b','u',0,3.5,[0.1;0.1],0.1);

[tc2,yc2,ec2]= rkpost1 ('a','b','u',0,3.5,[0.5;0.5],0.1);

[tc3,yc3,ec3]= rkpost1 ('a','b','u',0,3.5,[1;1],0.1);

plot(tc1,yc1,tc2,yc2,tc3,yc3)

pause

t1ec=tc1(1:max(size(tc1))-1);

t2ec=tc2(1:max(size(tc2))-1);

t3ec=tc3(1:max(size(tc3))-1);

plot(t1ec,ec1,t2ec,ec2,t3ec,ec3)

pause

disp(' :')

pause

disp(' :')

pause

%

[t1,y1,e1]=nrk1var('a1','b','u',0,3.5,[0.1;0.1],0.01);

[t2,y2,e2]=nrk1var('a1','b','u',0,3.5,[0.5;0.5],0.01);

[t3,y3,e3]=nrk1var('a1','b','u',0,3.5,[1;1],0.01);

plot(t1,y1,t2,y2,t3,y3)

pause

t1e=t1(1:max(size(t1))-1);

t2e=t2(1:max(size(t2))-1);

t3e=t3(1:max(size(t3))-1);

plot(t1e,e1,t2e,e2,t3e,e3)

pause

disp(' :')

pause;

%

[tc1,yc1,ec1]=nrk1('a1','b','u',0,3.5,[0.2;0.2],0.1);

[tc2,yc2,ec2]=nrk1('a1','b','u',0,3.5,[0.2;0.2],0.01);

[tc3,yc3,ec3]=nrk1('a1','b','u',0,3.5,[0.2;0.2],0.005);

plot(tc1,yc1,tc2,yc2,tc3,yc3)

pause

t1ec=tc1(1:max(size(tc1))-1);

t2ec=tc2(1:max(size(tc2))-1);

t3ec=tc3(1:max(size(tc3))-1);

plot(t1ec,ec1,t2ec,ec2,t3ec,ec3)

pause

[tc1,yc1,ec1]=nrk1('a1','b','u',0,3.5,[0.1;0.1],0.1);

[tc2,yc2,ec2]=nrk1('a1','b','u',0,3.5,[0.5;0.5],0.1);

[tc3,yc3,ec3]=nrk1('a1','b','u',0,3.5,[1;1],0.1);

plot(tc1,yc1,tc2,yc2,tc3,yc3)

pause

t1ec=tc1(1:max(size(tc1))-1);

t2ec=tc2(1:max(size(tc2))-1);

t3ec=tc3(1:max(size(tc3))-1);

plot(t1ec,ec1,t2ec,ec2,t3ec,ec3)

pause

Ø  :

function A=a();

A=[-5/6 1/3;

1/3 -1/3];

:

function A=a();

A=[-50 50;

50 -50.1];

:

function B=b();

B=[5/2; 0];

U:

function U=u(t);

U=[1];

Ø  :

tout ;

yout ( );

eout ( ).

Ø  :

A, B, U () = +U(t).

t ;

y ;

ym1 ;

yp1 ;

yt , ( );

h ;

h1 ;

n y;

I ;

eam , ;

Ø  :

funA, funB, funU A, B U;

t0, tfinal ;

y0 ( );

ep ;

trace ;

h .

: . . . . . . , , . , . "" 1 , "" ( ).

5.

y, : . . y . . , , .


1:

 

2.

3.


4.

 

5.

6.

 

7.


8.

 

9.

10.


11.

 

12.

6. .

:

1:

Var, X X0=[0.1;0.1] X0=[0.5;0.5] X0=[1;1]

 

2:

Var, E X0=[0.1;0.1] X0=[0.5;0.5] X0=[1;1]


3:

Const, X h=0.1, X0=[0.2;0.2] h=0.01, X0=[0.2;0.2] h=0.005, X0=[0.2;0.2]

 

4:

Const, E h=0.1, X0=[0.2;0.2] h=0.01, X0=[0.2;0.2] h=0.005, X0=[0.2;0.2]

 

5:

Const, X h=0.1, X0=[0.1;0.1] h=0.1, X0=[0.5;0.5] h=0.1, X0=[1;1]

 

6:

Const, E h=0.1, X0=[0.1;0.1] h=0.1, X0=[0.5;0.5] h=0.1, X0=[1;1]

 

:

Var ;

Const .

X0=[0.1;0.1], X0=[0.5;0.5], X0=[1;1] .

X ;

E .

h , X0 X.

7 -12 1-6 () .


, , ( ), . , X , t . , . , . , . , , . X . X , .


. . , .


1. .. . , 1995. 65.

2. .. . 1.- : , 1975. 632., .

3. .., .. . : , 1972. - 368

:

 

 

 

! , , , .
. , :