M
Y ' = F( X, Y ) , Y = ( y1, ..., yM ) , F = ( f1 ( X, y1, ..., yM ), ..., fM ( X, y1, ..., yM ) )
.
YX Xn Xn + H. , . P ( ), , - . H , .
.., .. A - . . : "", 1975.
. . . .. .: "", 1979.
int de94r_c(real *f, S_fp fj, S_fp fx, integer *m, integer *jstart, real *hmin, real *eps, real *p, real *yx, real *x, real *h, logical *bul, real *xp, real *yp, real *a, real *a1, real *a2, real *rab, real *r1, real *r2, real *r3, real *r4, real *yd, integer *ierr)
f - |
.
: int f (float *x, float *y, float *dy, int *m). x, y - , . dy; , .. m ≠ 1, y dy m ( x, y dy: ); |
fj - |
∂f / ∂y
. : int fj (float *x, float *y, float *z, int *m). x, y - , . , .. m ≠ 1, y m, z - m * m. ∂f / ∂y z, i - j - y ( j ) z ( i, j )( x, y z: ); |
fx - |
x
∂f / ∂x.
: int fx (float *x, float *y, float *z1, int *m). : x, y - , . , .. m ≠ 1, y z1 m. x ∂f / ∂x z1; i - z1 ( i ) ( x, y z1: ); |
m - | (: ); |
jstart - | , : |
0,+1 - | , x, yx h, ; |
-1 - | h / hmin; |
jstart + 1; | |
hmin - | , (: ); |
eps - | , (: ); |
p - | , (: ); |
yx, x - | ; x , yx - ; , .. m ≠ 1, yx m; |
h - | , ; , , , eps; h , ; |
bul - | , TRUE_, h , FALSE_ ; bul FALSE_, ; , .. h , bul ; |
xp, yp - | m, ; xp, yp , x, yx (.. ); |
a - a1, a2 | m * m; |
rab - | 5 * m; m , ; |
r1, r2 - r3, r4 yd | m; |
ierr - | , 65, - eps; h, hmin jstart = - 1. |
de96r_c - |
. de96r_c
de94r_c ,
de96r_c
x .
de96r_c .
de96r_c :
int de96r_c (real *f, integer *m, integer *jstart, real *hmin, real *eps, real *p, real *yx, real *x, real *h, logical *bul, real *xp, real *yp, real *a, real *a1, real *a2, real *rab, real *r1, real *r2, real *r3, real *r4, real *yd, integer *ierr)de96r_c de94r_c fj fx. de96r_c , de94r_c; |
de90r_c - |
.
,
x ,
.. y' = f (y) .
de90r_c :
int de90r_c (real *f, S_fp fj, integer *m, integer *jstart, real *hmin, real *eps, real *p, real *yx, real *x, real *h, logical *bul, real *xp, real *yp, real *a, real *a1, real *a2, real *rab, real *r1, real *r2, real *yd, integer *ierr)de90r_c de94r_c fx, r3, r4. de90r_c , de94r_c, rab. de90r_c rab 4 * m; |
de92r_c - |
.
,
x, ..
y' = f (y) .
de92r_c
de94r_c ,
de92r_c
∂f / ∂y
∂f / ∂x .
de92r_c :
int de92r_c (real *f, integer *m, integer *jstart, real *hmin, real *eps, real *p, real *yx, real *x, real *h, logical *bul, real *xp, real *yp, real *a, real *a1, real *a2, real *rab, real *r1, real *r2, real *yd, integer *ierr)de92r_c de94r_c fj, fx, r3, r4. , de94r_c, rab. de92r_c rab 4 * m; |
de94d_c - | . , de94r_c; hmin, eps, p, yx, x, h, xp, yp, a, a1, a2, rab, r1, r2, r3, r4, yd x, y, dy, z, z1 f, fj, fx double; |
de96d_c - | . , de96r_c; hmin, eps, p, yx, x, h, xp, yp, a, a1, a2, rab, r1, r2, r3, r4, yd x, y, dy f double; |
de90d_c - | . , de90r_c; hmin, eps, p, yx, x, h, xp, yp, a, a1, a2, rab, r1, r2, yd x, y, dy, z f, fj double; |
de92d_c - | . , de92r_c; hmin, eps, p, yx, x, h, xp, yp, a, a1, a2, rab, r1, r2, yd x, y, dy f double. |
aig2r_c - | . de90r_c, de92r_c, de94r_c, de96r_c; |
aig2d_c - | , , . de90d_c, de92d_c, de94d_c, de96d_c; |
utde20_c - | de90r_c, de92r_c, de94r_c, de96r_c; |
utde21_c - | de90d_c, de92d_c, de94d_c, de96d_c. |
, de90r_c de92rs_c, de92rk_c; de92r_c de92rs_c, de92rk_c, de84rj_c; de94r_c de96rs_c, de92rk_c; de96r_c de96rs_c, de92rk_c, de84rj_c, de96rx_c; de90d_c de92ds_c, de92dk_c; de92d_c de92ds_c, de92dk_c, de84dj_c; de94d_c de94ds_c, de92dk_c; de96d_c de96ds_c, de92dk_c, de84dj_c, de96dx_c. |
. m, hmin, eps, p . f, fj, fx m, x, y . xn h de94r_c . , x, xn - h. xn xn h > 0 xn h < 0. f . x < xn (h > 0) x < xn (h < 0), x .fj fx x (.. de92r_c, de96r_c, de92d_c, de96d_c), y x . , , fj fx. (, , ), , , . , eps. de92r_c, de96r_c, , , .. de92d_c, de96d_c. x (.. de96r_c, de96d_c), , , f x, xn, , xn - Δ, xn + Δ Δ - , eps. x < xn x > xn , x . |
y1' = - 100y1 y2' = - 100y1 - 2y2 + 20e - 100x + 2e - x cos x y3' = - 100y1 + 9998y2 - 9990y3 - 10y4 + 20e - 100x + 2e - x cos x y4' = - 100y1 + 9988y2 + 20y3 - 10010y4 + 20e - 100x + 2e - x cos x x = 0 , y1(0) = 10 , y2(0) = 11 , y3(0) = 111 , y4(0) = 111 . : y1 = 10e - 100x y2 = 10e - 100x + e - x cos x + e - x sin x y3 = y2 + 100e - 10000x cos 10x y4 = y3 + 100e - 10000x sin 10x : - 100 0 0 0 - 100 - 2 0 0 - 100 9998 - 9990 - 10 - 100 9988 20 - 10010 x : 0 - 2000e - 100x - 2e - x (cos x + sin x) - 2000e - 100x - 2e - x (cos x + sin x) - 2000e - 100x - 2e - x (cos x + sin x)
de94r_c, f, fj, fx , de94r_c.
int main(void) { /* Builtin functions */ double exp(double), cos(double), sin(double); /* Local variables */ extern int de94r_c(U_fp, U_fp, U_fp, int *, int *, float *, float *, float *, float *, float *, float *, logical *, float *, float *, float *, float *, float *, float *, float *, float *, float *, float *, float *, int *); static float hmin; static int ierr; static float a[16] /* was [4][4] */; extern int f_c(); static float h__; static int m; static float p, x, a1[16] /* was [4][4] */, a2[16] /* was [4][4] */, r1[4], r2[4], r3[4], r4[4], y1, y2, y3, y4; extern int fj_c(); static int ih; static float yd[4]; extern int fx_c(); static float xp, yp[4], yx[4]; static int jstart; static float rab[20]; static logical bul; static float eps; m = 4; x = 0.f; yx[0] = 10.f; yx[1] = 11.f; yx[2] = 111.f; yx[3] = 111.f; hmin = 1e-10f; eps = 1e-4f; p = 1e3f; jstart = 0; h__ = .01f; ih = 0; L100: ++ih; de94r_c((U_fp)f_c, (U_fp)fj_c, (U_fp)fx_c, &m, &jstart, &hmin, &eps, &p, yx, &x, &h__, &bul, &xp, yp, a, a1, a2, rab, r1, r2, r3, r4, yd, &ierr); /* BCEHE TOHOO PEEH CCTEM: */ y1 = (float)exp(x * -100.f) * 10.f; y2 = y1 + (float)exp(-x) * ((float)cos(x) + (float)sin(x)); y3 = y2 + (float)exp(x * -1e4f) * 100.f * (float)cos(x * 10.f); y4 = y3 + (float)exp(x * -1e4f) * 100.f * (float)sin(x * 10.f); printf("\n %16.7e %16.7e ", y1, y2); printf("\n %16.7e %16.7e \n", y3, y4); printf("\n %16.7e %16.7e ", yx[0], yx[1]); printf("\n %16.7e %16.7e \n", yx[2], yx[3]); printf("\n %16.7e \n", x); printf("\n %16.7e \n", h__); /* PACEATKA OPEHOCT PEHHOO PEEH */ printf("\n %16.7e %16.7e ", rab[0], rab[1]); printf("\n %16.7e %16.7e \n\n", rab[2], rab[3]); switch (ih) { case 1: goto L101; case 2: goto L102; case 3: goto L103; case 4: goto L104; case 5: goto L105; case 6: goto L106; } L101: h__ = 1e-8f; goto L100; L102: h__ = -1e-8f; goto L100; L103: jstart = -1; goto L100; L104: jstart = -1; h__ = -1e-8f; goto L100; L105: h__ = .01f; goto L100; L106: return 0; } /* main */ int f_c(float *x, float *y, float *dy, int *m) { /* Builtin functions */ double exp(double), cos(double); /* Local variables */ static float t1; /* Parameter adjustments */ --dy; --y; /* Function Body */ dy[1] = y[1] * -100.f; t1 = (float)exp(*x * -100.f) * 20.f + (float)exp(-(*x)) * 2.f * (float)cos(*x); dy[2] = dy[1] - y[2] * 2.f + t1; dy[3] = dy[1] + y[2] * 9998.f - y[3] * 9990.f - y[4] * 10.f + t1; dy[4] = dy[1] + y[2] * 9988.f + y[3] * 20.f - y[4] * 10010.f + t1; return 0; } /* f_c */ int fj_c(float *x, float *y, float *df, int *m) { #define df_ref(a_1,a_2) df[(a_2)*4 + a_1] /* Parameter adjustments */ df -= 5; --y; /* Function Body */ df_ref(1, 1) = -100.f; df_ref(1, 2) = 0.f; df_ref(1, 3) = 0.f; df_ref(1, 4) = 0.f; df_ref(2, 1) = -100.f; df_ref(2, 2) = -2.f; df_ref(2, 3) = 0.f; df_ref(2, 4) = 0.f; df_ref(3, 1) = -100.f; df_ref(3, 2) = 9998.f; df_ref(3, 3) = -9990.f; df_ref(3, 4) = -10.f; df_ref(4, 1) = -100.f; df_ref(4, 2) = 9988.f; df_ref(4, 3) = 20.f; df_ref(4, 4) = -10010.f; return 0; } /* fj_c */ #undef df_ref int fx_c(float *x, float *y, float *dx, int *m) { /* Builtin functions */ double exp(double), cos(double), sin(double); /* Parameter adjustments */ --dx; --y; /* Function Body */ dx[1] = 0.f; dx[2] = (float)exp(*x * -100.f) * -2e3f - (float)exp(-(*x)) * 2.f * ((float)cos(*x) + (float)sin(*x)); dx[3] = dx[2]; dx[4] = dx[2]; return 0; } /* fx_c */ :
-
y1 y2 9.997558891759 + 00 1.099755889174 + 01 y3 y4 1.085857138761 + 02 1.085880963993 + 02 yx(1) yx(2) 9.997558891700 + 00 1.099755889169 + 01 yx(3) yx(4) 1.085857138677 + 02 1.085880963909 + 02 x h 2.441406250001 - 06 2.441406250001 - 06
:
rab(1) rab(2) - 9.701276818918 - 13 - 2.910383045670 - 12 rab(3) rab(4) 7.823109626764 - 09 7.784304519497 - 09
-
y1 y2 9.997548894156 + 00 1.099754889414 + 01 y3 y4 1.085759455506 + 02 1.085783375935 + 02 yx(1) yx(2) 9.997548894098 + 00 1.099754889408 + 01 yx(3) yx(4) 1.085759455420 + 02 1.085783375847 + 02 x h 2.451406249999 - 06 2.000000000004 - 08
:
rab(1) rab(2) 0.000000000000 + 00 0.000000000000 + 00 rab(3) rab(4) - 7.761021455135 - 12 - 1.552204291027 - 11
-
y1 y2 9.997558891759 + 00 1.099755889174 + 01 y3 y4 1.085857138761 + 02 1.085880963993 + 02 yx(1) yx(2) 9.997558891613 + 00 1.099755889160 + 01 yx(3) yx(4) 1.085857138667 + 02 1.085880963901 + 02 x h 2.441406249998 - 06 - 2.000000000004 - 08
:
rab(1) rab(2) - 9.701276818918 - 13 - 9.701276818918 - 13 rab(3) rab(4) - 2.328306436536 - 11 - 1.552204291027 - 11
-
y1 y2 9.997568889303 + 00 1.099756888929 + 01 y3 y4 1.085954831772 + 02 1.085978561790 + 02 yx(1) yx(2) 9.997568889157 + 00 1.099756888914 + 01 yx(3) yx(4) 1.085954831680 + 02 1.085978561698 + 02 x h 2.431406249996 - 06 - 4.000000000008 - 08
:
rab(1) rab(2) - 1.940255363783 - 12 - 1.940255363783 - 12 rab(3) rab(4) - 1.552204291027 - 11 - 1.552204291027 - 11
-
y1 y2 9.997558891759 + 00 1.099755889174 + 01 y3 y4 1.085857138761 + 02 1.085880963993 + 02 yx(1) yx(2) 9.997558891613 + 00 1.099755889160 + 01 yx(3) yx(4) 1.085857138667 + 02 1.085880963901 + 02 x h 2.441406249998 - 06 - 2.000000000004 - 08
:
rab(1) rab(2) - 9.701276818918 - 13 - 9.701276818918 - 13 rab(3) rab(4) - 2.328306436536 - 11 - 1.552204291027 - 11
-
y1 y2 9.995118379389 + 00 1.099511837936 + 01 y3 y4 1.062995982552 + 02 1.062342483763 + 02 yx(1) yx(2) 9.995118379200 + 00 1.099511837916 + 01 yx(3) yx(4) 1.062995982379 + 02 1.062342483588 + 02 x h 4.882812499996 - 06 2.441406250001 - 06
:
rab(1) rab(2) - 1.940255363783 - 12 - 2.910387045670 - 12 rab(3) rab(4) 7.644606133297 - 09 7.590278983110 - 09