һ

 

 

 

 

 

 

 

..

 

 

 

 

Web PHP

II

 

 

 

 

 

 

 

 

 

 

 

-

2018

 

 

 

- ( Web- ) , Internet. , , . , , , , , , - , , , .

PHP Web- .

, () , , , .

Web- 02.03.02 - , 010302 - . , , . 30 . . . . - .:.- ,1981.-103 ., . . , . . , . . .-.: , 1980 .-318 ., . ., . . .- .: ,1979.-184. . . .-.:,1989.-155..[29,32]. . . , , , . , , PHP , , . , PHP , , . , PHP, C

1

:

1. , .

2. - .

3. , .

4. , , , , procedure.

5. , .

6.1 .

6.2

6.3

6.4

: m n , , , - , - .

m x n, m n . , i= 1,2,...,m; j=1,2,...,n.

, .

mxn ,

nxm, .

, .. m=n, .

 

, . aij , ..

;

,

a a; .. ,

. :

n- ( -) ( -), aij , -

 

 

-

.

, ;

,

.. .

.

 

 

3) ,

 

4)

 

abilr1120012017.php,abilr1420012017.php, abilr1320012017.php,abilr1220012017.php,idlr11.txt, idlr12.txt, idlr13.txt, idlr14.txt, iidlr11.txt,iidlr12.txt, iidlr13.txt, iidlr14.txt, , , .

abilr1120012017.php

<?php

function det2($d)

{

return $d[1][1]*$d[2][2]-$d[2][1]*$d[1][2];

}

function det3($d)

{

$c=array();

$s=0;$r=-1;

for ($k=1;$k<=3;$k++)

{

for ($i=1;$i<=3;$i++)

{

for ($j=2;$j<=3;$j++)

{

if ($i<>$k )

{

if($i<$k)

{

$c[$i][$j-1]=$d[$i][$j];

}

else

{

$c[$i-1][$j-1]=$d[$i][$j];

}

}

}

}

$r=-$r;$s=$s+$r*$d[$k][1]*det2($c);

}

return $s;

}

function det4($d)

{

$c=array();

$s=0;$r=-1;

for ($k=1;$k<=4;$k++)

{

for ($i=1;$i<=4;$i++)

{

for ($j=2;$j<=4;$j++)

{

if ($i<>$k )

{

if($i<$k)

{

$c[$i][$j-1]=$d[$i][$j];

}

else

{

$c[$i-1][$j-1]=$d[$i][$j];

}

}

}

}

$r=-$r;$s=$s+$r*$d[$k][1]*det3($c);

}

return $s;

}

$ff = fopen('idlr11.txt', 'r'); //

$b=array();

$f = fgets($ff, 999);

$b = explode(",", $f);

$n=count($b)-1;

for($i=0;$i<=$n;$i++)

{

$f = fgets($ff, 999);

$a[$i] = explode(",", $f);

}

$a1=$a;

echo"bbb<br />";

print_r($b);

echo"<br />";

echo"a1a1a1a1<br />";

print_r($a1);

$det=det4($a1);

fclose($ff);

if(abs($det)<0.0000001){echo "$n,$r,$det,<br/>"; break;}

/*fwrite($fd, $str); // */

/*fseek($fd, 0); // */

/*fwrite($fd, ""); // */

/*fseek($fd, 0, SEEK_END); // */

/*fwrite($fd, $str); // */

$str="";$x=array();$d=array();

for($k=1;$k<=4;$k++)

{

for($i=1;$i<=4;$i++)

{

for($j=1;$j<=4;$j++)

{

if($j==$k)

{

$a1[$i][$j]=$b[$i];

}

else

{

$a1[$i][$j]=$a[$i][$j];

}

}

}

$x[$k]=det4($a1)/$det;

$str.="x($k)=$x[$k],<br />";

}

for($k=1;$k<=4;$k++)

{$det=$b[$k];

for($i=1;$i<=4;$i++)

{

$det-=$a[$k][$i]*$x[$i];

}

$d[$k]=$det;

$str.="d($k)=$det,<br />";

}

$fff = fopen('iidlr11.txt', 'a'); //

//fseek($fff, 0, SEEK_END); //

$ss1 = implode(",", $x);

fwrite($fff, $ss1."\r\n"); //

$ss1 = implode(",", $d);

fwrite($fff, $ss1."\r\n"); //

echo"<br />";

echo"xxx<br />";

print_r($x);

echo"<br />";

echo"ddd<br />";

print_r($d);

echo"<br /> $str <br />";

?>

abilr1120012017.php:

bbb

Array ( [0] => 0 [1] => 1 [2] => -4 [3] => -6 [4] => -4 )

a1a1a1a1
Array ( [0] => Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 [4] => 0 ) [1] => Array ( [0] => 0 [1] => 1 [2] => 1 [3] => 2 [4] => 3 ) [2] => Array ( [0] => 0 [1] => 3 [2] => -1 [3] => -1 [4] => -2 ) [3] => Array ( [0] => 0 [1] => 2 [2] => 3 [3] => -1 [4] => -1 ) [4] => Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => -1 ) )
xxx
Array ( [1] => -1 [2] => -1 [3] => 0 [4] => 1 )
ddd
Array ( [1] => 0 [2] => 0 [3] => 0 [4] => 0 )
x(1)=-1,
x(2)=-1,
x(3)=0,
x(4)=1,
d(1)=0,
d(2)=0,
d(3)=0,
d(4)=0,

idlr11.txt:

0,1,-4,-6,-4

0,0,0,0,0

0,1,1,2,3

0,3,-1,-1,-2

0,2,3,-1,-1

0,1,2,3,-1

iidlr11.txt

-1,-1,0,1

0,0,0,0

abilr1220012017.php

<?php

function det2($d)

{

return $d[1][1]*$d[2][2]-$d[2][1]*$d[1][2];

}

function det3($d)

{

$c=array();

$s=0;$r=-1;

for ($k=1;$k<=3;$k++)

{

for ($i=1;$i<=3;$i++)

{

for ($j=2;$j<=3;$j++)

{

if ($i<>$k )

{

if($i<$k)

{

$c[$i][$j-1]=$d[$i][$j];

}

else

{

$c[$i-1][$j-1]=$d[$i][$j];

}

}

}

}

$r=-$r;$s=$s+$r*$d[$k][1]*det2($c);

}

return $s;

}

function det4($d)

{

$c=array();

$s=0;$r=-1;

for ($k=1;$k<=4;$k++)

{

for ($i=1;$i<=4;$i++)

{

for ($j=2;$j<=4;$j++)

{

if ($i<>$k )

{

if($i<$k)

{

$c[$i][$j-1]=$d[$i][$j];

}

else

{

$c[$i-1][$j-1]=$d[$i][$j];

}

}

}

}

$r=-$r;$s=$s+$r*$d[$k][1]*det3($c);

}

return $s;

}

function obmat4($d)

{

$c=array();

$r=-1;$s=det4($d);

for ($k=1;$k<=4;$k++)

{

for ($l=1;$l<=4;$l++)

{

for ($i=1;$i<=4;$i++)

{

for ($j=1;$j<=4;$j++)

{

if($i<>$k&&$j<>$l)

{

if($i<$k)

{

if($j<$l)

{

$c[$i][$j]=$d[$i][$j];

}

else

{

$c[$i][$j-1]=$d[$i][$j];

}

}

else

{

if($j<$l)

{

$c[$i-1][$j]=$d[$i][$j];

}

else

{

$c[$i-1][$j-1]=$d[$i][$j];

}

}

}

}

}

$r=-$r;$v[$l][$k]=$r*det3($c)/$s;

}

}

return $v;

}

$ff = fopen('idlr12.txt', 'r'); //

$b=array();

$f = fgets($ff, 999);

$b = explode(",", $f);

$n=count($b)-1;

for($i=0;$i<=$n;$i++)

{

$f = fgets($ff, 999);

$a[$i] = explode(",", $f);

}

$a1=$a;

$det=det4($a1);

fclose($ff);

echo"bbb<br />";

print_r($b);

echo"<br />";

echo"a1a1a1<br />";

print_r($a1);

if(abs($det)<0.0000001){echo "$n,$r,$det,<br/>"; break;}

/*fwrite($fd, $str); // */

/*fseek($fd, 0); // */

/*fwrite($fd, ""); // */

/*fseek($fd, 0, SEEK_END); // */

/*fwrite($fd, $str); // */

$v=array();$x=array();$d=array();

$v=obmat4($a1);$a1=$v;

for ($k=1;$k<=4;$k++)

{$s=0;

for ($i=1;$i<=4;$i++)

{

$s+=$b[$i]*$a1[$i][$k];

}

$x[$k]=$s;

}

$str="";

for($k=1;$k<=4;$k++)

{

$str.="x($k)=$x[$k],<br />";

}

for($k=1;$k<=4;$k++)

{

$det=$b[$k];

for($i=1;$i<=4;$i++)

{

$det-=$a[$k][$i]*$x[$i];

}

$d[$k]=$det;

$str.="d($k)=$det,<br />";

}

$fff = fopen('iidlr12.txt', 'w'); //

//fseek($fff, 0, SEEK_END); //

$ss1 = implode(",", $x);

fwrite($fff, $ss1."\r\n"); //

$ss1 = implode(",", $d);

fwrite($fff, $ss1."\r\n"); //

echo"<br />";

echo"xxx<br />";

print_r($x);

echo"<br />";

echo"ddd<br />";

print_r($d);

fclose($fff);

echo "<br /> $str <br />";

?>

abilr1220012017.php:

bbb

Array ( [0] => 0 [1] => 1 [2] => -4 [3] => -6 [4] => -4 )

a1a1a1

Array ( [0] => Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 [4] => 0 ) [1] => Array ( [0] => 0 [1] => 1 [2] => 1 [3] => 2 [4] => 3 ) [2] => Array ( [0] => 0 [1] => 3 [2] => -1 [3] => -1 [4] => -2 ) [3] => Array ( [0] => 0 [1] => 2 [2] => 3 [3] => -1 [4] => -1 ) [4] => Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => -1 ) )

xxx

Array ( [1] => -1 [2] => -1 [3] => 5.5511151231258E-17 [4] => 1 )

ddd

Array ( [1] => 4.4408920985006E-16 [2] => -2.2204460492503E-16 [3] => -1.1102230246252E-16 [4] => -3.3306690738755E-16 )

x(1)=-1,

x(2)=-1,

x(3)=5.5511151231258E-17,

x(4)=1,

d(1)=4.4408920985006E-16,

d(2)=-2.2204460492503E-16,

d(3)=-1.1102230246252E-16,

d(4)=-3.3306690738755E-16,

idlr12.txt:

0,1,-4,-6,-4

0,0,0,0,0

0,1,1,2,3

0,3,-1,-1,-2

0,2,3,-1,-1

0,1,2,3,-1

iidlr12.txt

-1,-1,5.5511151231258E-17,1

4.4408920985006E-16,-2.2204460492503E-16,-1.1102230246252E-16,-3.3306690738755E-16

abilr1320012017.php

<?php

function sl($u,$v)

{for ($k=0;$k<count($u[0]);$k++)

for ($i=0;$i<count($u[0]);$i++)

$w[$k][$i]=$u[$k][$i]+$v[$k][$i];

return $w;

}

function rs($u,$v)

{for ($k=0;$k<count($u[0]);$k++)

for ($i=0;$i<count($u[0]);$i++)

$w[$k][$i]=$u[$k][$i]-$v[$k][$i];

return $w;

}

function ums($u,$t)

{for ($k=0;$k<count($u[0]);$k++)

for ($i=0;$i<count($u[0]);$i++)

$w[$k][$i]=$u[$k][$i]*$t;

return $w;

}

function pr($u,$v)

{for ($i=0;$i<count($u[0]);$i++)

for ($j=0;$j<count($u[0]);$j++)

{

$s=0;

for ($k=0;$k<count($u[0]);$k++)

$s+=$u[$i][$k]*$v[$k][$j];

$w[$i][$j]=$s;

}

return $w;

}

$n=2;

$a=array();

$b=array();

$c=array();

$d=array();

$c2=array();

$ff = fopen('idlr13.txt', 'r'); //

for($i=0;$i<=$n;$i++)

{

$f = fgets($ff, 999);

$a[$i] = explode(",", $f);

}

for($i=0;$i<=$n;$i++)

{

$f = fgets($ff, 999);

$b[$i] = explode(",", $f);

}

$c=pr($a,$b);$d=ums($c,3);$c=rs($a,$b);$c2=ums($b,2);$c2=sl($a,$c2);$c2=pr($c,$c2);$c=sl($c2,$d);

// 3AB+(A-B)(A+2B)

echo"<br />";

echo" A <br />";

print_r($a);

echo"<br />";

echo" B <br />";

print_r($b);

echo"<br />";

echo" 3AB+(A-B)(A+2B) <br />";

print_r($c);

echo"<br />";

fclose($ff);

$fff = fopen('iidlr13.txt', 'a'); //

for($i=0;$i<=$n;$i++)

{

$f = implode(",", $c[$i]);

fwrite($fff, $f."\r\n"); //

}

fclose($fff);

?>

abilr1320012017.php:

A

Array ( [0] => Array ( [0] => 1 [1] => 2 [2] => 1 ) [1] => Array ( [0] => 0 [1] => -1 [2] => 2 ) [2] => Array ( [0] => 2 [1] => -1 [2] => 0 ) )

B

Array ( [0] => Array ( [0] => 1 [1] => 1 [2] => 3 ) [1] => Array ( [0] => 3 [1] => 2 [2] => 1 ) [2] => Array ( [0] => 0 [1] => 2 [2] => -1 ) )

3AB+(A-B)(A+2B)

Array ( [0] => Array ( [0] => 23 [1] => 18 [2] => 20 ) [1] => Array ( [0] => -34 [1] => -12 [2] => -44 ) [2] => Array ( [0] => -13 [1] => 2 [2] => 15 ) ) idlr13.txt:

1,2,1

0,-1,2

2,-1,0

1,1,3

3,2,1

0,2,-1

iidlr13.txt

23,18,20

-34,-12,-44

-13,2,15

abilr1420012017.php

<?php

function det2($d)

{

return $d[1][1]*$d[2][2]-$d[2][1]*$d[1][2];

}

function det3($d)

{

$c=array();

$s=0;$r=-1;

for ($k=1;$k<=3;$k++)

{

for ($i=1;$i<=3;$i++)

{

for ($j=2;$j<=3;$j++)

{

if ($i<>$k )

{

if($i<$k)

{

$c[$i][$j-1]=$d[$i][$j];

}

else

{

$c[$i-1][$j-1]=$d[$i][$j];

}

}

}

}

$r=-$r;$s=$s+$r*$d[$k][1]*det2($c);

}

return $s;

}

function det4($d)

{

$c=array();

$s=0;$r=-1;

for ($k=1;$k<=4;$k++)

{

for ($i=1;$i<=4;$i++)

{

for ($j=2;$j<=4;$j++)

{

if ($i<>$k )

{

if($i<$k)

{

$c[$i][$j-1]=$d[$i][$j];

}

else

{

$c[$i-1][$j-1]=$d[$i][$j];

}

}

}

}

$r=-$r;$s=$s+$r*$d[$k][1]*det3($c);

}

return $s;

}

$ff = fopen('idlr14.txt', 'r'); //

$b1=array();$a=array();

for($i=0;$i<=4;$i++)

{

$f = fgets($ff, 999);

$b1[$i] = explode(",", $f);

}

$n=count($b1[0])-1;

for($i=0;$i<=$n;$i++)

{

$f = fgets($ff, 999);

$a[$i] = explode(",", $f);

}

echo"bbb<br />";

print_r($b1);

echo"<br />";

echo"a1a1a1a1<br />";

print_r($a);

fclose($ff);

$det=det4($a);

if(abs($det)<0.0000001){echo "$n,$r,$det,<br/>"; break;}

/*fwrite($fd, $str); // */

/*fseek($fd, 0); // */

/*fwrite($fd, ""); // */

/*fseek($fd, 0, SEEK_END); // */

/*fwrite($fd, $str); // */

$str="";

$x1=array();$d1=array();

for($k1=1;$k1<=4;$k1++)

{

$x=array();$d=array();$b=array();$a1=array();

$a1=$a;$b=$b1[$k1];$det=det4($a1);

for($k=1;$k<=4;$k++)

{

for($i=1;$i<=4;$i++)

{

for($j=1;$j<=4;$j++)

{

if($j==$k)

{

$a1[$i][$j]=$b[$i];

}

else

{

$a1[$i][$j]=$a[$i][$j];

}

}

}

$x[$k]=det4($a1)/$det;

}

for($k=1;$k<=4;$k++)

{$det=$b[$k];

for($i=1;$i<=4;$i++)

{

$det-=$a[$k][$i]*$x[$i];

}

$d[$k]=$det;

}

$d1[$k1]=$d;$x1[$k1]=$x;

}

for($i=1;$i<=$n;$i++)

for($j=1;$j<=$n;$j++)

{

$rr=$x1[$i][$j];$str.="x[$i][$j]=$rr;<br />";

}

for($i=1;$i<=$n;$i++)

for($j=1;$j<=$n;$j++)

{

$rr=$d1[$i][$j];$str.="d[$i][$j]=$rr;<br />";

}

$fff = fopen('iidlr14.txt', 'a'); //

//fseek($fff, 0, SEEK_END); //

for($k1=1;$k1<=4;$k1++)

{

$ss1 = implode(",", $x1[$k1]);

fwrite($fff, $ss1."\r\n"); //

}

for($k1=1;$k1<=4;$k1++)

{

$ss1 = implode(",", $d1[$k1]);

fwrite($fff, $ss1."\r\n"); //

}

echo"<br />";

echo"xxx<br />";

print_r($x1);

echo"<br />";

echo"ddd<br />";

print_r($d1);

echo"<br /> $str <br />";

?>

abilr1420012017.php:

bbb

Array ( [0] => Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 [4] => 0 ) [1] => Array ( [0] => 0 [1] => 1 [2] => -4 [3] => -6 [4] => -4 ) [2] => Array ( [0] => 0 [1] => 1 [2] => 1 [3] => 2 [4] => 3 ) [3] => Array ( [0] => 0 [1] => 2 [2] => 2 [3] => 3 [4] => 4 ) [4] => Array ( [0] => 0 [1] => 3 [2] => 3 [3] => 4 [4] => 5 ) )

a1a1a1a1

Array ( [0] => Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 [4] => 0 ) [1] => Array ( [0] => 0 [1] => 1 [2] => 1 [3] => 2 [4] => 3 ) [2] => Array ( [0] => 0 [1] => 3 [2] => -1 [3] => -1 [4] => -2 ) [3] => Array ( [0] => 0 [1] => 2 [2] => 3 [3] => -1 [4] => -1 ) [4] => Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => -1 ) )

xxx

Array ( [1] => Array ( [1] => -1 [2] => -1 [3] => 0 [4] => 1 ) [2] => Array ( [1] => 0.45098039215686 [2] => 0.43137254901961 [3] => 0.47058823529412 [4] => -0.27450980392157 ) [3] => Array ( [1] => 0.90196078431373 [2] => 0.52941176470588 [3] => 0.6078431372549 [4] => -0.2156862745098 ) [4] => Array ( [1] => 1.3529411764706 [2] => 0.62745098039216 [3] => 0.74509803921569 [4] => -0.15686274509804 ) )

ddd

Array ( [1] => Array ( [1] => 0 [2] => 0 [3] => 0 [4] => 0 ) [2] => Array ( [1] => 1.1102230246252E-16 [2] => -1.1102230246252E-16 [3] => 0 [4] => -1.1102230246252E-16 ) [3] => Array ( [1] => 2.2204460492503E-16 [2] => -2.2204460492503E-16 [3] => -2.2204460492503E-16 [4] => 1.1102230246252E-16 ) [4] => Array ( [1] => -1.1102230246252E-16 [2] => 2.2204460492503E-16 [3] => -1.1102230246252E-16 [4] => -1.1102230246252E-16 ) )

x[1][1]=-1;

x[1][2]=-1;

x[1][3]=0;

x[1][4]=1;

x[2][1]=0.45098039215686;

x[2][2]=0.43137254901961;

x[2][3]=0.47058823529412;

x[2][4]=-0.27450980392157;

x[3][1]=0.90196078431373;

x[3][2]=0.52941176470588;

x[3][3]=0.6078431372549;

x[3][4]=-0.2156862745098;

x[4][1]=1.3529411764706;

x[4][2]=0.62745098039216;

x[4][3]=0.74509803921569;

x[4][4]=-0.15686274509804;

d[1][1]=0;

d[1][2]=0;

d[1][3]=0;

d[1][4]=0;

d[2][1]=1.1102230246252E-16;

d[2][2]=-1.1102230246252E-16;

d[2][3]=0;

d[2][4]=-1.1102230246252E-16;

d[3][1]=2.2204460492503E-16;

d[3][2]=-2.2204460492503E-16;

d[3][3]=-2.2204460492503E-16;

d[3][4]=1.1102230246252E-16;

d[4][1]=-1.1102230246252E-16;

d[4][2]=2.2204460492503E-16;

d[4][3]=-1.1102230246252E-16;

d[4][4]=-1.1102230246252E-16;

idlr14.txt:

0,0,0,0,0

0,1,-4,-6,-4

0,1,1,2,3

0,2,2,3,4

0,3,3,4,5

0,0,0,0,0

0,1,1,2,3

0,3,-1,-1,-2

0,2,3,-1,-1

0,1,2,3,-1

iidlr14.txt

-1,-1,0,1

0.45098039215686,0.43137254901961,0.47058823529412,-0.27450980392157

0.90196078431373,0.52941176470588,0.6078431372549,-0.2156862745098

1.3529411764706,0.62745098039216,0.74509803921569,-0.15686274509804

0,0,0,0

1.1102230246252E-16,-1.1102230246252E-16,0,-1.1102230246252E-16

2.2204460492503E-16,-2.2204460492503E-16,-2.2204460492503E-16,1.1102230246252E-16

-1.1102230246252E-16,2.2204460492503E-16,-1.1102230246252E-16,-1.1102230246252E-16

 

1.

 

3) ,

 

 

4)

 

 

2.

3) ,

 

 

4)

3.

3) ,

 

4.

 

3) ,

 

 

4)

5.

3) ,

 

4)

6.

3) ,

4)

 

 

 

 

 

7.

1) 2)

 

3) ,

 

 

4)

 

8.

1) 2)

3) ,

4)

 

9.

1) 2)

 

3) ,

 

 

4) = .

10.

1) 2)

 

3) ,

4)

11.

1) 2)

 

3) ,

 

4)

12.

1) 2)

 

3) ,

 

4)

 

 

13.

1) 2)

3)

4)

 

14.

1) 2)

 

3) ,

 

4)

15.

1) 2)

 

3) ,

4)

 

16.

1) 2)

3) ,

 

4)

 

 

 

17.

1) 2)

 

3) ,

 

 

4)

18.

1) 2)

3) ,

 

 

4)

19.

1) 2)

 

3) ,

 

 

4)

20.

1) 2)

 

3) ,

 

 

4)

21.

1) 2)

3) ,

 

4)

 

22.

1) 2)

3) 3(A+B)-(A-B)A,

4)

23.

1) 2)

 

3) ,

 

4)

24.

1) 2)

3) ,

 

4)

25.

1) 2)

3) ,

26.

1) 2)

3) ,

4)

27.

1) 2)

3) ,

4)

28.

1) 2)

3) ,

4)

29.

1) 2)

3) ,

4)

30.

1) 2)

3) ,

4)

 

 

2

:

 

1. ,

2. - .

3. , .

4.

5. , .

6. , .

.

( ).

n .

 

- xk - (1) .

,

abilr222012017.php, idlr2.txt, iidlr2.txt, , :

 

abilr222012017.php

<?php

function mgaussa($u)

{

$w=array();$w1=array();

$w=$u;

$m=count($u[0])-1;$n=$m-1;

 

for($k=0;$k<=$n;$k++)

{

for ($i=$k;$i<=$n;$i++)for ($j=$k;$j<=$m;$j++)

if ($j==$k && $i>$k) $w1[$i][$j]=0; else

if ($i==$k) $w1[$i][$j]=$w[$i][$j]/$w[$k][$k];

else

$w1[$i][$j]=$w[$i][$j]-$w[$i][$k]*$w[$k][$j]/$w[$k][$k];

$w=$w1;

}

for($k=$n;$k>=0;$k--)

{

$s=$w[$k][$m];

for($i=$n;$i>=$k+1;$i--) $s-=$w[$k][$i]*$v[$i];

$v[$k]=$s;

}

return $v;

}

$ff = fopen('idlr2.txt', 'r'); //

$b=array();$x=array();$a=array();$d=array();

$f = fgets($ff, 999);

$b = explode(",", $f);

$n=count($b)-1;$m=$n+1;

for($i=0;$i<=$n;$i++)

{

$f = fgets($ff, 999);

$a[$i] = explode(",", $f);

}

echo"<br />";

echo"aaaaa<br />";

print_r($a);

echo"<br />";

echo"bbbbbb<br />";

print_r($b);

echo"<br />";

$a1=$a;

for($i=0;$i<=$n;$i++)

$a1[$i][$m]=$b[$i];

echo"a1a1a1a1<br />";

print_r($a1);

$x=mgaussa($a1);

fclose($ff);

/*fwrite($fd, $str); // */

/*fseek($fd, 0); // */

/*fwrite($fd, ""); // */

/*fseek($fd, 0, SEEK_END); // */

/*fwrite($fd, $str); // */

$str="";

for($k=0;$k<=$n;$k++)

$str.="x($k)=$x[$k],<br />";

for($k=0;$k<=$n;$k++)

{$det=$b[$k];

for($i=0;$i<=$n;$i++)

{

$det-=$a[$k][$i]*$x[$i];

}

$d[$k]=$det;

$str.="d($k)=$det,<br />";

}

$fff = fopen('iidlr2.txt', 'a'); //

//fseek($fff, 0, SEEK_END); //

$ss1 = implode(",", $x);

fwrite($fff, $ss1."\r\n"); //

$ss1 = implode(",", $d);

fwrite($fff, $ss1."\r\n"); //

echo"<br />";

echo"xxxxxx<br />";

print_r($x);

echo"<br />";

echo"dddddddd<br />";

print_r($d);

echo"<br /> $str <br />";

?>

abilr222012017.php

aaaaa

Array ( [0] => Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 ) [1] => Array ( [0] => 3 [1] => -1 [2] => -1 [3] => -2 ) [2] => Array ( [0] => 2 [1] => 3 [2] => -1 [3] => -1 ) [3] => Array ( [0] => 1 [1] => 2 [2] => 3 [3] => -1 ) )

bbbbbb

Array ( [0] => 1 [1] => -4 [2] => -6 [3] => -4 )

a1a1a1a1

Array ( [0] => Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 1 ) [1] => Array ( [0] => 3 [1] => -1 [2] => -1 [3] => -2 [4] => -4 ) [2] => Array ( [0] => 2 [1] => 3 [2] => -1 [3] => -1 [4] => -6 ) [3] => Array ( [0] => 1 [1] => 2 [2] => 3 [3] => -1 [4] => -4 ) )

xxxxxx

Array ( [3] => 1 [2] => 0 [1] => -1 [0] => -1 )

dddddddd

Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 )

x(0)=-1,

x(1)=-1,

x(2)=0,

x(3)=1,

d(0)=0,

d(1)=0,

d(2)=0,

d(3)=0,

idlr2.txt

1,-4,-6,-4

1,1,2,3

3,-1,-1,-2

2,3,-1,-1

1,2,3,-1

iidlr2.txt

1,0,-1,-1

0,0,0,0

 

 

.

 

1. 2.

3. 4.

5 6.

7. 8.

9. 10.

11. 12.

13. 14.

15. 16.

17. 18.

19. 20.

21. 22.

23. 24.

25. 26.

27. 28.

29. 30.

 

3

:

1. ,

2. - .

3. , .

4.

5. , .

6. . , , .

. .

.

 

.

(1)

, - , - :

,

(1) , - a , ..

.

abilr322012017.php,idlr3.txt, iidlr3.txt, , .

 

 

 

abilr322012017.php

<?php

function mzejd($au,$bu,$eps)

{

$u=array();$z=array();$w=array();

$n=count($bu)-1;

for($k=0;$k<=$n;$k++)$z[$k]=$bu[$k]/$au[$k][$k];

for($i=0;$i<=$n;$i++)

{

$t=$au[$i][$i];

for($j=0;$j<=$n;$j++)

$u[$i][$j]=$au[$i][$j]/$t;

$u[$i][$i]--;

}

$w=$z;

while ($t>=$eps)

{

$t=0;

for($k=0;$k<=$n;$k++)

{

$s=$z[$k];

for($i=0;$i<=$n;$i++) $s-=$u[$k][$i]*$w[$i];

if($t<abs($w[$k]-$s)) $t=abs($w[$k]-$s);

$w[$k]=$s;

}

}

return $w;

}

$ff = fopen('idlr3.txt', 'r'); //

$b=array();$x=array();$a=array();$d=array();

$f = fgets($ff, 999);

$b = explode(",", $f);

$n=count($b)-1;$m=$n+1;

for($i=0;$i<=$n;$i++)

{

$f = fgets($ff, 999);

$a[$i] = explode(",", $f);

}

echo"<br />";

echo"aaaaa<br />";

print_r($a);

echo"<br />";

echo"bbbbbb<br />";

print_r($b);

echo"<br />";

$a1=$a;

echo"a1a1a1a1<br />";

print_r($a1);

fclose($ff);

$eps=0.000000001;

$x=mzejd($a1,$b,$eps);

/*fwrite($fd, $str); // */

/*fseek($fd, 0); // */

/*fwrite($fd, ""); // */

/*fseek($fd, 0, SEEK_END); // */

/*fwrite($fd, $str); // */

$str="";

for($k=0;$k<=$n;$k++)

$str.="x[$k]=$x[$k],<br />";

for($k=0;$k<=$n;$k++)

{$det=$b[$k];

for($i=0;$i<=$n;$i++)

{

$det-=$a[$k][$i]*$x[$i];

}

$d[$k]=$det;

$str.="d[$k]=$det,<br />";

}

$fff = fopen('iidlr3.txt', 'a'); //

//fseek($fff, 0, SEEK_END); //

$ss1 = implode(",", $x);

fwrite($fff, $ss1."\r\n"); //

$ss1 = implode(",", $d);

fwrite($fff, $ss1."\r\n"); //

fclose($fff);

echo"<br />";

echo"xxxxxx<br />";

print_r($x);

echo"<br />";

echo"dddddddd<br />";

print_r($d);

echo"<br /> $str <br />";

?>

 

abilr322012017.php

aaaaa

Array ( [0] => Array ( [0] => 7.6 [1] => 0.5 [2] => 2.4 ) [1] => Array ( [0] => 2.2 [1] => 9.1 [2] => 4.4 ) [2] => Array ( [0] => 1.8 [1] => 2.5 [2] => 4.6 ) )

bbbbbb

Array ( [0] => 1.9 [1] => 9.7 [2] => 2.2 )

a1a1a1a1

Array ( [0] => Array ( [0] => 7.6 [1] => 0.5 [2] => 2.4 ) [1] => Array ( [0] => 2.2 [1] => 9.1 [2] => 4.4 ) [2] => Array ( [0] => 1.8 [1] => 2.5 [2] => 4.6 ) )

xxxxxx

Array ( [0] => 0.24751596510826 [1] => 1.1145646423298 [2] => -0.22433485717815 )

dddddddd

Array ( [0] => 1.2398837512251E-9 [1] => 3.1440892112045E-9 [2] => -2.2204460492503E-16 )

x[0]=0.24751596510826,

x[1]=1.1145646423298,

x[2]=-0.22433485717815,

d[0]=1.2398837512251E-9,

d[1]=3.1440892112045E-9,

d[2]=-2.2204460492503E-16,

idlr3.txt

1.9,9.7,2.2

7.6,0.5,2.4

2.2,9.1,4.4

1.8,2.5,4.6

iidlr3.txt

0.24751596510826,1.1145646423298,-0.22433485717815

1.2398837512251E-9,3.1440892112045E-9,-2.2204460492503E-16

 

.

 

1.

3.

5.

7.

9.

11.

13.

15.

17.

19.

21.

23.

25.

27.

 

 

29.

 

2.

4.

6.

8.

10.

12.

14.

16.

18.

20

22.

24.

26.

28.

 

30.

 

 

 

4

.

1. ,

2. - .

3. , .

4. .

5. , .

.

6.1 , .

6.2 , .

. .

(1)

f j- . , n- , (n+1) .

,

,

, , .

.

(1)

, - , . , n- , (n+1)-

C, , e>0 - .

.

1) 2)

abilr4123012017.php, abilr41a23012017.htm, abilr42gr23012017.php, abilr42a23012017.php. lidlr41.txt , idlr42gr.txt, idlr42.txt, iidlr42.txt, , .

abilr4123012017.php

<?php

function f1($u,$v)

{

return sin($u-0.6)-$v-1.6;

}

function f2($u,$v)

{

return 3*$u-cos($v)-0.9;

}

function g1($u)

{

//return $u*$u;

return sin($u-0.6)-1.6;

}

function g2($v)

{

//return -$v*$v;

return cos($v)/3+0.3;

}

 

$im=imageCreateTrueColor(400,500);/* S0zdaecz Host */

$c=imageColorAllocate($im,220,220,200); /* Sozdaem cvet */

for($i=0;$i<1000;$i++)

{

$x=mt_rand(0,imageSX($im));

$y=mt_rand(0,imageSY($im));

imageSetPixel($im,$x,$y,$c);/* Zakrashivaencz pixel*/

}

/*$a=-15;$b=15;$h=0.2;$mx=10;$my=200;*/

$ff = fopen('idlr41.txt', 'r'); //

$abcd=array();

$f = fgets($ff, 999);

$abcd = explode(",", $f);

$a=$abcd[0];$b=$abcd[1];$cc=$abcd[2];$d=$abcd[3];

$hx=$abcd[4];$hy=$abcd[5];$mx=$abcd[6];$my=$abcd[7];

$c=imageColorAllocate($im,220,220,220); /* Sozdaem cvet */

$x0=imageSX($im)/2;$y0=imageSY($im)/2;

imageLine($im,$x0,0,$x0,2*$y0,$c); /* Risuem os ox*/

imageLine($im,0,$y0,2*$x0,$y0,$c); /* Risuem os oy*/

$x=$a;$x2=$x0+floor($mx*($x));$y2=$y0-floor($my*g1($x));

while($x<=$b)

{

$x1=$x2;

$y1=$y2;

$x+=$hx;

$x2=$x0+floor($mx*($x));

$y2=$y0-floor($my*g1($x));

imageLine($im,$x1,$y1,$x2,$y2,$c);

}

$y=$cc;$x2=$x0+floor($mx*g2($y));$y2=$y0-floor($my*$y);

while($y<=$d)

{

$x1=$x2;

$y1=$y2;

$y+=$hy;

$x2=$x0+floor($mx*g2($y));

$y2=$y0-floor($my*$y);

imageLine($im,$x1,$y1,$x2,$y2,$c);

}

for($i=-50;$i<=50;$i++)

{

$x1=floor($x0+$i*10);floor($y1=$y0-5);$x2=floor($x0+$i*10);$y2=floor($y0+5);

imageLine($im,$x1,$y1,$x2,$y2,$c);

$x1=$x0-5;$y1=$y0-$i*10;$x2=$x0+5;$y2=$y0-$i*10;

imageLine($im,$x1,$y1,$x2,$y2,$c);

}

ImagePng($im);

imagePng($new_im,"lek3_12.png");/*Sochronim v file*/

imageDestroy($im);

?>

abilr4123012017.php (.1).

 

.1. 1).

 

idlr41.txt

-4,4,-4,4,0.01,0.01,100,100

 

abilr41a23012017.html

<html >

<head>

<title> </title>

</head>

<body>

<form name="myform" action="abilr41a23012017.php?id=15" method ="POST">

<table>

<tr>

<td> a: </td>

<td> <input type="text" name="a" /> </td>

</tr>

<tr>

<td> b: </td>

<td> <input type="text" name="b" /> </td>

</tr>

<tr>

<td> c: </td>

<td> <input type="text" name="c" /> </td>

</tr>

<tr>

<td> d: </td>

<td> <input type="text" name="d" /> </td>

</tr>

<tr>

<td> eps: </td>

<td> <input type="text" name="eps" /> </td>

</tr>

<tr>

<td colspen="2">

<input type="submit" name="send" value ="" /> </td>

</tr

</table>

</form>

</body>

</html>

abilr41a23012017.html

abilr41a23012017.php

<?php

function f1($u,$v)

{

return sin($u-0.6)-$v-1.6;

}

function f2($u,$v)

{

return 3*$u-cos($v)-0.9;

}

function g1($u)

{

return sin($u-0.6)-1.6;

}

function g2($v)

{

return cos($v)/3+0.3;

}

$a=$_POST["a"];$b=$_POST["b"];$c=$_POST["c"];

$d=$_POST["d"];$eps=$_POST["eps"];

$x=($a+$b)/2; $y=($c+$d)/2;$z=1000;

While($z>=$eps)

{

$z=g1($x);

$x=g2($y);

$y=$z;

$z=abs(f1($x,$y));

if ($z<abs(f2($x,$y))) $z=abs(f2($x,$y));

}

$z1=f1($x,$y);$z2=f2($x,$y);

echo "<br />x=$x;<br />y==$y;<br />f1($x,$y)=$z1;<br />f2($x,$y)=$z2<br />"

?>

abilr41a23012017.php

x=0.15105719056704;

y==-2.0340132775591;

f1(0.15105719056704,-2.0340132775591)=-6.9476697062143E-8;

f2(0.15105719056704,-2.0340132775591)=-6.6695402645145E-8

 

abilr42gr23012017.php

<?php

function fx1($u)

{

return 2*$u-asin(0.4+1.2*$u);

}

function fx11($u)

{

return 2*$u+asin(0.4+1.2*$u);

}

function fx2($u)

{

return sqrt(1-0.82*$u*$u)/1.5;

}

function f1($u,$v)

{

return sin(2*$u-$v)-1.2*$u-0.4;

}

function f2($u,$v)

{

return 0.8*$u*$u+1.5*$v*$v-1;

}

$im=imageCreateTrueColor(400,500);/* S0zdaecz Host */

$c=imageColorAllocate($im,220,220,200); /* Sozdaem cvet */

for($i=0;$i<1000;$i++)

{

$x=mt_rand(0,imageSX($im));

$y=mt_rand(0,imageSY($im));

imageSetPixel($im,$x,$y,$c);/* Zakrashivaencz pixel*/

}

/*$a=-15;$b=15;$h=0.2;$mx=10;$my=200;*/

$ff = fopen('idlr42gr.txt', 'r'); //

$abcd=array();

$f = fgets($ff, 999);

$abcd = explode(",", $f);

$a=$abcd[0];$b=$abcd[1];$cc=$abcd[2];$d=$abcd[3];

$hx=$abcd[4];$hy=$abcd[5];$mx=$abcd[6];$my=$abcd[7];

$x0=imageSX($im)/2;$y0=imageSY($im)/2;

imageLine($im,$x0,0,$x0,2*$y0,$c); /* Risuem os ox*/

imageLine($im,0,$y0,2*$x0,$y0,$c); /* Risuem os oy*/

$y=$cc;

while($y<=$d)

{

$y1=$y0-floor($my*($y-$hy));$y2=$y0-floor($my*($y));

$x=$a;

while($x<=$b)

{

if (f1($x,$y)*f1($x+$hx,$y+$hy)<0)

{

$x1=$x0+floor($mx*$x);$x2=$x0+floor($mx*($x+$hx));

imageLine($im,$x1,$y1,$x2,$y2,$c);

}

if (f2($x,$y)*f2($x+$hx,$y+$hy)<0)

{

$x1=$x0+floor($mx*$x);$x2=$x0+floor($mx*($x+$hx));

imageLine($im,$x1,$y1,$x2,$y2,$c);

}

$x=$x+$hx;

}

$y+=$hy;

}

for($i=-50;$i<=50;$i++)

{

$x1=floor($x0+$i*10);floor($y1=$y0-5);$x2=floor($x0+$i*10);$y2=floor($y0+5);

imageLine($im,$x1,$y1,$x2,$y2,$c);

$x1=$x0-5;$y1=$y0-$i*10;$x2=$x0+5;$y2=$y0-$i*10;

imageLine($im,$x1,$y1,$x2,$y2,$c);

}

ImagePng($im);

imagePng($new_im,"lek3_12.png");/*Sochronim v file*/

imageDestroy($im);

?>

abilr41a23012017.php.( . 2.)

 

.2. 2).

 

idlr42gr.txt

-1.4,1.4,-2.5,2.5,0.01,0.01,150,150

4,-1,-0.1,-0.8,-0.39,-0.5,-0.5,0.3,-0.6,0.000000001

abilr42a23012017.php

<?php

function f1($u,$v)

{

return sin(2*$u-$v)-1.2*$u-0.4;

}

function f2($u,$v)

{

return 0.8*$u*$u+1.5*$v*$v-1;

}

function f1x($u,$v)

{

return 2*cos(2*$u-$v)-1.2;

}

function f2x($u,$v)

{

return 1.6*$u;

}

function f1y($u,$v)

{

return -cos(2*$u-$v);

}

function f2y($u,$v)

{

return 3*$v;

}

$ss="";

$ff = fopen('idlr42.txt', 'r'); //

$abcd=array();$xy=array();$fxy=array();

$f = fgets($ff, 999);

$f = fgets($ff, 999);

$abcd = explode(",", $f);

$k=$abcd[0];

$e=$abcd[9];

fclose($ff);

for($i=1;$i<=$k;$i++)

{

$z=10;

$x=$abcd[2*$i-1];$y=$abcd[2*$i];

While ( $z>=$e)

{

$dd=f1x($x,$y)*f2y($x,$y)-f2x($x,$y)*f1y($x,$y);

$dh=f1y($x,$y)*f2($x,$y)-f2y($x,$y)*f1($x,$y);

$dk=f1($x,$y)*f2x($x,$y)-f2($x,$y)*f1x($x,$y);

$x=$x+$dh/$dd;$y=$y+$dk/$dd;

$z=abs(f1($x,$y));

if ($z<abs(f2($x,$y))) $z=abs(f2($x,$y));

}

$r1=f1($x,$y);$r2=f2($x,$y);

$ss.="<br />x[$i]=$x;y[$i]=$y;<br />f1($x,$y)=$r1;f2($x,$y)=$r2;<br />";

$xy[2*$i-1]=$x;$xy[2*$i]=$y;$fxy[2*$i-1]=f1($x,$y);$fxy[2*$i]=f2($x,$y);

}

echo"<br />";

print_r($xy);

echo"<br />";

print_r($fxy);

echo"<br />";

$fff = fopen('iidlr42.txt', 'a'); //

//fseek($fff, 0, SEEK_END); //

$ss1 = implode(",", $xy);

fwrite($fff, $ss1."\r\n"); //

$ss1 = implode(",", $fxy);

fwrite($fff, $ss1."\r\n"); //

fclose($fff);

echo $ss;

?> abilr42a23012017.php

x[1]=-1.0905939210938;y[1]=-0.17978490744856;

f1(-1.0905939210938,-0.17978490744856)=5.8508753397746E-14;f2(-1.0905939210938,-0.17978490744856)=7.7982065249671E-13;

 

x[2]=-0.94158156251895;y[2]=0.44025699229699;

f1(-0.94158156251895,0.44025699229699)=5.4400928206633E-15;f2(-0.94158156251895,0.44025699229699)=8.7041485130612E-14;

 

x[3]=-0.43905728052058;y[3]=-0.75090299575156;

f1(-0.43905728052058,-0.75090299575156)=1.8324231021438E-13; f2(-.43905728052058,-0.75090299575156)=5.491163079796E-12;

x[4]=0.49123795053369;y[4]=-0.73346130131155;

f1(0.49123795053369,-0.73346130131155)=-4.2229442165365E-11; f2(0.49123795053369,-0.73346130131155)=1.8085755115749E-11;

{

-3 3 -4 4 0.01 0.01 0.00001

4 -1 -0.1 -0.8 -0.39 -0.5 -0.5 0.3 -0.6

idlr42.txt

1.1,1.1,0.001,100,100

4,-1,-0.1,-0.8,-0.39,-0.5,-0.5,0.3,-0.6,0.000000001

iidlr42.txt

-1.0905939210938,-0.17978490744856,-0.94158156251895,0.44025699229699,

-0.43905728052058,-0.75090299575156,0.49123795053369,-0.73346130131155

5.8508753397746E-14,7.7982065249671E-13,5.4400928206633E-15,8.7041485130612E-14,1.8324231021438E-13,5.491163079796E-12,

-4.2229442165365E-11,1.8085755115749E-11

.

 

1.1

2.1

3.1

4.1

5.1

6.1

7.1

8.1

9.1

10.1

11.1

12.1

13.1

14.1

 

15.1

16.1

17.1

18.1

19.1

20.1

21.1

 

22.1

23.1

24.1

25.1

26.1

27.1

28.1

29.1

30.1

1.2

2.2

3.2

4.2

5.2

6.2

7.2

8.2

9.2

10.2

11.2

12.2

13.2

14.2

15.2

16.2

17.2

18.2

19.2

20.2

21.2

22.2

23.2

24.2

25.2

26.2

27.2

28.2

29.2

30.2

 

 

 

 

 

 

5

:

.

1. ,

2. - .

3. , .

4. .

5. , .

6. . . , .

.

, [a,b]. o [a,b] .

, n- n bn. (n+1)- .

, ( ), [,bn+1 ,an+1,] . ,

max e>0 - .

.

abilr5gr24012017.php,abilr524012017.php,lidlr5.txt, iidlr5.txt, , .

abilr5gr24012017.php

<?php

function fx($u)

{

return $u*$u*$u-3*$u*$u+3.5;

}

$im=imageCreateTrueColor(400,500);/* S0zdaecz Host */

$c=imageColorAllocate($im,220,220,200); /* Sozdaem cvet */

for($i=0;$i<1000;$i++)

{

$x=mt_rand(0,imageSX($im));

$y=mt_rand(0,imageSY($im));

imageSetPixel($im,$x,$y,$c);/* Zakrashivaencz pixel*/

}

 

$ff = fopen('idlr5.txt', 'r'); //

$abcd=array();

$f = fgets($ff, 999);

$abcd = explode(",", $f);

$a=$abcd[0];$b=$abcd[1];

$hx=$abcd[2];$mx=$abcd[4];$my=$abcd[5];

$x0=imageSX($im)/2;$y0=imageSY($im)/2;

imageLine($im,$x0,0,$x0,2*$y0,$c); /* Risuem os ox*/

imageLine($im,0,$y0,2*$x0,$y0,$c); /* Risuem os oy*/

$x=$a;

while($x<=$b)

{

$y1=$y0-floor($my*fx($x));$y2=$y0-floor($my*fx($x+$hx));

$x1=$x0+floor($mx*$x);$x2=$x0+floor($mx*($x+$hx));

imageLine($im,$x1,$y1,$x2,$y2,$c);

$x=$x+$hx;

}

for($i=-50;$i<=50;$i++)

{

$x1=floor($x0+$i*10);floor($y1=$y0-5);$x2=floor($x0+$i*10);$y2=floor($y0+5);

imageLine($im,$x1,$y1,$x2,$y2,$c);

$x1=$x0-5;$y1=$y0-$i*10;$x2=$x0+5;$y2=$y0-$i*10;

imageLine($im,$x1,$y1,$x2,$y2,$c);

}

ImagePng($im);

imagePng($new_im,"lek3_12.png");/*Sochronim v file*/

imageDestroy($im);

?>

abilr5gr24012017.php

 

.3.

.

 

idlr5.txt

-10,10,0.01,0.0000001,50,50

abilr524012017.php

<?php

function fx($u)

{

return $u*$u*$u-3*$u*$u+3.5;

}

function fx1($u)

{

return 3*$u*$u-6*$u;end;

}

function fx2($u)

{

return 6*$u-6;

}

function cx($c,$d,$e1)

{

if(fx($c)*fx2($c)>0)

{$an=$d;$bn=$c;}

else

{$an=$c;$bn=$d;}

$u=10;

while($u>=$e1)

{

$bn=$bn-fx($bn)/fx1($bn);

$an=$an-fx($an)*($bn-$an)/(fx($bn)-fx($an));

$u=abs(fx($an));

if ($u<abs(fx($bn))) $u=abs(fx($bn));

}

return ($an+$bn)/2;

}

$ss="";

$ff = fopen('idlr5.txt', 'r'); //

$abcd=array();$xx=array();$fx=array();

$f = fgets($ff, 999);

$abcd = explode(",", $f);

$a=$abcd[0];$b=$abcd[1];$hx=$abcd[2];$eps=$abcd[3];

$mx=$abcd[4];$my=$abcd[5];

fclose($ff);

echo "<br />";

print_r($abcd);

 

$k=0;$ak=array();$bk=array();

$x=$a;

while($x<=$b)

{

if(fx($x)*fx($x-$hx)<0)

{$k++;$ak[$k]=$x-$hx;$bk[$k]=$x;}

$x+=$hx;

}

echo "<br />";

print_r($ak);

echo "<br />";

print_r($bk);

for($i=1;$i<=$k;$i++)

{

$rr=cx($ak[$i],$bk[$i],$eps); $frr=fx($rr);

$ss.="<br />x[$i]=$rr;f($rr)=$frr<br />";

$xx[$i]=$rr;$fx[$i]=$frr;

}

$fff = fopen('iidlr5.txt', 'a'); //

//fseek($fff, 0, SEEK_END); //

$ss1 = implode(",", $xx);

fwrite($fff, $ss1."\r\n"); //

$ss1 = implode(",", $fx);

fwrite($fff, $ss1."\r\n"); //

fclose($fff);

echo $ss;

?>

abilr524012017.php

Array ( [0] => -10 [1] => 10 [2] => 0.01 [3] => 0.0000001 [4] => 50 [5] => 50 )

Array ( [1] => -0.95000000000017 [2] => 1.5499999999998 [3] => 2.3799999999998 )

Array ( [1] => -0.94000000000017 [2] => 1.5599999999998 [3] => 2.3899999999998 )

x[1]=-0.9422418515824;f(-0.9422418515824)=-5.0960435871161E-9

x[2]=1.5578746973541;f(1.5578746973541)=2.0196493366598E-9

x[3]=2.3843671543243;f(2.3843671543243)=4.6358863414753E-9

iidlr5.txt

-0.9422418515824,1.5578746973541,2.3843671543243

-5.0960435871161E-9,2.0196493366598E-9,4.6358863414753E-9

 

.

1.

3.

5.

7.

9.

11.

13.

15.

17.

19.

21.

23.

25.

27.

29.

 

 

2.

4.

6.

8.

10.

12.

14.

16.

18.

20.

22.

24.

26.

28.

30.

 

6.

: .

:

1. ,

2. - .

3. , .

4. , :

1) ;

2) .

5. , .

.

1) ,

.

2)

.

.

1) 2)

 

x

x

0,43

1,63597

0,702

1,375

5,04192

1,3832

0,48

1,73234

0,512

1,380

5,17744

1,3926

0,55

1,87686

0,645

1,385

5,32016

1,3862

0,62

203345

0,736

1,390

5,47069

1,3934

0,70

2.22846

0,608

1,395

5,62968

1,3866

0,75

2,35975

 

1,400

5,79788

 

abilr6124012017.php, abilr622512017.php. idlr61.txt, idlr62.txt, iidlr61.txt, iidlr62.txt, , , .

 

abilr61gr24012017.php

<?php

function f($t,$u,$v)

{$n=count($u)-1;

$s=0;

for ($i=0;$i<=$n;$i++)

{

$r=1;

for ($j=0;$j<=$n;$j++)

if($i<>$j) $r*=($t-$u[$j])/($u[$i]-$u[$j]);

$s+=$r*$v[$i];

}

return $s;

}

 

$im=imageCreateTrueColor(400,500);/* S0zdaecz Host */

$c=imageColorAllocate($im,220,220,200); /* Sozdaem cvet */

for($i=0;$i<1000;$i++)

{

$x=mt_rand(0,imageSX($im));

$y=mt_rand(0,imageSY($im));

imageSetPixel($im,$x,$y,$c);/* Zakrashivaencz pixel*/

}

$ss="";$xk=array();$yk=array();$xx=array();$yy=array();

$ff = fopen('idlr61.txt', 'r'); //

$f = fgets($ff, 999);

$xk = explode(",", $f);

$f = fgets($ff, 999);

$yk = explode(",", $f);

$f = fgets($ff, 999);

$xx = explode(",", $f);

fclose($ff);

$n=count($xk)-1;$m=$n-1;

for ($i=0;$i<=$m;$i++)

{

$t=$xx[$i];

$yy[$i]=f($xx[$i],$xk,$yk);

}

$mx=$xx[$m+1];$my=$xx[$m+2];

$x0=imageSX($im)/2;$y0=imageSY($im)/2;

imageLine($im,$x0,0,$x0,2*$y0,$c); /* Risuem os ox*/

imageLine($im,0,$y0,2*$x0,$y0,$c); /* Risuem os oy*/

for ($i=0;$i<=$n-1;$i++)

{$x1=$x0+floor($mx*$xk[$i]);$x2=$x0+floor($mx*($xk[$i+1]));

$y1=$y0-floor($my*$yk[$i]);$y2=$y0-floor($my*$yk[$i+1]);

imageLine($im,$x1,$y1,$x2,$y2,$c);

}

$c=imageColorAllocate($im,255,220,100); /* Sozdaem cvet */

for ($i=0;$i<=$n-2;$i++)

{

$x1=$x0+floor($mx*$xx[$i]);$x2=$x0+floor($mx*($xx[$i+1]));

$y1=$y0-floor($my*$yy[$i]);$y2=$y0-floor($my*$yy[$i+1]);

imageLine($im,$x1,$y1,$x2,$y2,$c);

}

for($i=-50;$i<=50;$i++)

{

$x1=floor($x0+$i*10);floor($y1=$y0-5);$x2=floor($x0+$i*10);$y2=floor($y0+5);

imageLine($im,$x1,$y1,$x2,$y2,$c);

$x1=$x0-5;$y1=$y0-$i*10;$x2=$x0+5;$y2=$y0-$i*10;

imageLine($im,$x1,$y1,$x2,$y2,$c);

}

ImagePng($im);

imagePng($new_im,"lek3_12.png");/*Sochronim v file*/

imageDestroy($im);

?>

abilr6124012017.php

<?php

function f($t,$u,$v)

{$n=count($u)-1;

$s=0;

for ($i=0;$i<=$n;$i++)

{

$r=1;

for ($j=0;$j<=$n;$j++)

if($i<>$j) $r*=($t-$u[$j])/($u[$i]-$u[$j]);

$s+=$r*$v[$i];

}

return $s;

}

$ss="";$xk=array();$yk=array();$xx=array();$fxy=array();

$ff = fopen('idlr61.txt', 'r'); //

$f = fgets($ff, 999);

$xk = explode(",", $f);

$f = fgets($ff, 999);

$yk = explode(",", $f);

$f = fgets($ff, 999);

$xx = explode(",", $f);

fclose($ff);

echo "<br />";

print_r($xk);

echo "<br />";

print_r($yk);

echo "<br />";

print_r($xx);

$n=count($xk)-1;$m=$n-1;

$ss="";

for ($i=0;$i<=$m;$i++)

{

$t=$xx[$i];

$rf=f($xx[$i],$xk,$yk);

$ss.="<br />f($t)=$rf;<br />";

$fxy[$i]=$rf;

}

$fff = fopen('iidlr61.txt', 'a'); //

//fseek($fff, 0, SEEK_END); //

$ss1 = implode(",", $xx);

fwrite($fff, $ss1."\r\n"); //

$ss1 = implode(",", $fxy);

fwrite($fff, $ss1."\r\n"); //

fclose($fff);

echo $ss;

?>

idlr61.txt

0.43,0.48,0.55,0.62,0.70,0.75

1.63597,1.73234,1.87686,2.03345,2.22846,2.35973

0.702,0.512,0.645,0.736,0.608,150,50

abilr6124012017.php

Array ( [0] => 0.43 [1] => 0.48 [2] => 0.55 [3] => 0.62 [4] => 0.70 [5] => 0.75 )

Array ( [0] => 1.63597 [1] => 1.73234 [2] => 1.87686 [3] => 2.03345 [4] => 2.22846 [5] => 2.35973 )

Array ( [0] => 0.702 [1] => 0.512 [2] => 0.645 [3] => 0.736 [4] => 0.608 [5] => 150 [6] => 50 )

f(0.702)=2.2335675728857;

f(0.512)=1.7969695304244;

f(0.645)=2.0924854408434;

f(0.736)=2.3222117744257;

f(0.608)=2.0057070199987;

iidlr61.txt

0.702,0.512,0.645,0.736,0.608,150,50

2.2335675728857,1.7969695304244,2.0924854408434,2.3222117744257,2.0057070199987

abilr62gr25012017.php

?php

function f($t,$u,$v)

{$n=count($u)-1;

$s=0;

for ($i=0;$i<=$n;$i++)

{

$r=1;

for ($j=0;$j<=$n;$j++)

if($i<>$j) $r*=($t-$u[$j])/($u[$i]-$u[$j]);

$s+=$r*$v[$i];

}

return $s;

}

 

$im=imageCreateTrueColor(400,500);/* S0zdaecz Host */

$c=imageColorAllocate($im,220,220,200); /* Sozdaem cvet */

for($i=0;$i<1000;$i++)

{

$x=mt_rand(0,imageSX($im));

$y=mt_rand(0,imageSY($im));

imageSetPixel($im,$x,$y,$c);/* Zakrashivaencz pixel*/

}

$ss="";$xk=array();$yk=array();$xx=array();$yy=array();

$ff = fopen('idlr62.txt', 'r'); //

$f = fgets($ff, 999);

$xk = explode(",", $f);

$f = fgets($ff, 999);

$yk = explode(",", $f);

$f = fgets($ff, 999);

$xx = explode(",", $f);

fclose($ff);

$n=count($yk)-1;$m=$n-1;

for ($i=0;$i<=$m;$i++)

{

$t=$xx[$i];

$yy[$i]=f($t,$xk[0],$xk[1],$yk);

}

$h=$xk[1];

for ($i=1;$i<=$n;$i++)

{

$xk[$i]=$xk[$i-1]+$h;

}

$mx=$xx[$m+1];$my=$xx[$m+2];

$x0=imageSX($im)/2;$y0=imageSY($im)/2;

imageLine($im,$x0,0,$x0,2*$y0,$c); /* Risuem os ox*/

imageLine($im,0,$y0,2*$x0,$y0,$c); /* Risuem os oy*/

for ($i=0;$i<=$n-1;$i++)

{$x1=$x0+floor($mx*$xk[$i]);$x2=$x0+floor($mx*($xk[$i+1]));

$y1=$y0-floor($my*$yk[$i]);$y2=$y0-floor($my*$yk[$i+1]);

imageLine($im,$x1,$y1,$x2,$y2,$c);

}

$c=imageColorAllocate($im,255,220,100); /* Sozdaem cvet */

for ($i=0;$i<=$n-2;$i++)

{

$x1=$x0+floor($mx*$xx[$i]);$x2=$x0+floor($mx*($xx[$i+1]));

$y1=$y0-floor($my*$yy[$i]);$y2=$y0-floor($my*$yy[$i+1]);

imageLine($im,$x1,$y1,$x2,$y2,$c);

}

for($i=-50;$i<=50;$i++)

{

$x1=floor($x0+$i*10);floor($y1=$y0-5);$x2=floor($x0+$i*10);$y2=floor($y0+5);

imageLine($im,$x1,$y1,$x2,$y2,$c);

$x1=$x0-5;$y1=$y0-$i*10;$x2=$x0+5;$y2=$y0-$i*10;

imageLine($im,$x1,$y1,$x2,$y2,$c);

}

ImagePng($im);

imagePng($new_im,"lek3_12.png");/*Sochronim v file*/

imageDestroy($im);

?>

abilr622512017.php

<?php

function f($x,$u,$h1,$v)

{

$n=count($v)-1;

$t=($x-$u)/$h1;$p=$t;$c=1;

for ($i=1;$i<=$n;$i++) $c*=$i;

if ($n%2==1) $c=-$c;

$s=$v[0]/($t*$c);

for ($i=1;$i<=$n;$i++)

{

$p*=($t-$i);$c=-$c*$i/($n-$i+1);

$s+=$v[$i]/(($t-$i)*$c);

}

return $s*$p;

}

$ss="";$xk=array();$yk=array();$xx=array();$fxy=array();

$ff = fopen('idlr62.txt', 'r'); //

$f = fgets($ff, 999);

$xk = explode(",", $f);

$f = fgets($ff, 999);

$yk = explode(",", $f);

$f = fgets($ff, 999);

$xx = explode(",", $f);

fclose($ff);

echo "<br />";

print_r($xk);

echo "<br />";

print_r($yk);

echo "<br />";

print_r($xx);

$n=count($yk)-1;$m=$n-1;

$ss="";

for ($i=0;$i<=$m;$i++)

{

$t=$xx[$i];

$rf=f($t,$xk[0],$xk[1],$yk);

$ss.="<br />f($t)=$rf;<br />";

$fxy[$i]=$rf;

}

$fff = fopen('iidlr62.txt', 'w'); //

//fseek($fff, 0, SEEK_END); //

$ss1 = implode(",", $xx);

fwrite($fff, $ss1."\r\n"); //

$ss1 = implode(",", $fxy);

fwrite($fff, $ss1."\r\n"); //

fclose($fff);

echo $ss;

?>

abilr622512017.php

Array ( [0] => 1.375 [1] => 0.005 )

Array ( [0] => 5.04192 [1] => 5.17744 [2] => 5.32016 [3] => 5.47069 [4] => 5.62968 [5] => 5.79788 )

Array ( [0] => 1.3832 [1] => 1.3926 [2] => 1.3862 [3] => 1.3934 [4] => 1.3866 [5] => 100 [6] => 30 )

f(1.3832)=5.2679131947303;

f(1.3926)=5.5522646150742;

f(1.3862)=5.3555515348877;

f(1.3934)=5.5778397132407;

f(1.3866)=5.3674501192073

idlr62.txt

1.375,0.005

5.04192,5.17744,5.32016,5.47069,5.62968,5.79788

1.3832,1.3926,1.3862,1.3934,1.3866,100,30

iidlr62.txt

1.3832,1.3926,1.3862,1.3934,1.3866,100,30

5.2679131947303,5.5522646150742,5.3555515348877,5.5778397132407,5.3674501192073

 

N 1

x

y

N

x

0,43

0,48

0,55

0,62

0,70

0,75

1,63597

1,73234

1,87686

2,03345

2,22846

2,35973

1

7

13

19

25

0,702

0,512

0,645

0,736

0,608

 

N 2

x

y

N

x

0,02

0,08

0,12

0,17

0,23

0,30

1,02316

1,09590

1,14725

1,21483

1,30120

1,40976

2

8

14

20

26

0,102

0,114

0,125

0,203

0,154

 

N 3

x

y

N

x

0,35

0,41

0,47

0,51

0,56

0,64

 

2,73951

2,30080

1,96864

1,78776

1,559502

1,34310

3

9

15

21

27

 

0,526

0,453

0,482

0,552

0,436

N 4

x

y

N

x

0,41

0,46

0,52

0,60

0,65

0,72

2,57418

2,32513

2,09336

1,86203

1,74926

1,62098

4

10

16

22

28

 

0,616

0,478

0,665

0,537

0,673

 

N 5

x

y

N

x

0,68

0,73

0,80

0,88

0,93

0,99

0,80866

0,89492

1,02964

1,20966

1,34087

1,52368

5

11

17

23

29

0,896

0,812

0,774

0,955

0,715

 

 

N 6

x

y

N

x

0,11

0,15

0,21

0,29

0,35

0,40

9,07418

6,62513

4,69336

3,36203

2,74926

2,36098

6

12

18

24

30

 

0,314

0,235

0,332

0,275

0,186

 

 

 

 

2)

N 1

x

y

N

x

1,375

1,380

1,385

1,390

1,395

1,400

 

5,04192

5,17744

5,32016

5,47069

5,62968

5,79788

1

7

13

19

25

1,3832

1,3926

1,3862

1,3934

1,3866

 

N 2

x

y

N

x

0,115

0,120

0,125

0,130

0,135

0,140

8,65729

8,29329

7,95829

7,64893

7,36235

7,09613

2

8

14

20

26

0,1264

0,1315

0,1232

0,1334

0,1285

 

N3

x

y

N

x

0,150

0,155

0,160

0,165

0,170

0,175

6,61659

6,39989

6,19658

6,00551

5,82558

5,65583

3

9

15

21

27

0,1521

0,1611

0,1662

0,1542

0,1625

 

 

N4

x

y

N

x

0,180

0,185

0,190

0,195

0,200

0,205

5,61543

5,46693

5,32634

5,19304

5,06649

4,94619

4

10

16

22

28

 

0,1838

0,1875

0,1944

0,1976

0,2038

 

N5

x

y

N

x

0,210

0,215

0,220

0,225

0,230

0,235

4,83170

4,72261

4,61855

4,51919

4,42422

4,33337

5

11

17

23

29

0,2121

0,2165

0,2232

0,2263

0,2244

N6

x

y

N

x

1,415

1,420

1,425

1,430

1,435

1,440

0,888551

0,889599

0,890637

0,891667

0,892687

0,893698

6

12

18

24

30

1,4179

1,4258

1,4396

1,4236

1,4315

 

 

7

:

1. ,

2. - .

3. , .

4.1) e=10-4, 10-5, 10-6.

2) n=10; 20. .

3) , ( n1=4 n2=5).

5. , .

.

1) n : ,

 

3)

i t i - .

n=4 :

c1 = 0.34785; t1 = -0.86114; c2 = 0.65215; t2 = -0.33998;

c3 = c2 ; c4 = c1; t3=-t2; t4 = -t1;

n=5 :

c1 = 0.23693; t1 = -0.90618; c2 = 0.47863; t2 = -0.538469;

c3= 0.56889; t3=0; c4 = c2 ; c5 = c1; t4=-t 2; t5 = -t1;

.

abilr725012017.php, abilr725012017.php, idlr7.txt, iidlr7.txt, , .

abilr725012017.php

<?php

function f1($t)

{

return 1/sqrt(2*$t*$t+0.3);

}

function f12($t)

/*f12- f1*/

{

$r1=8*$t*$t-0.6;$r2=2*$t*$t+0.3;

return $r1/($r2*$r2*sqrt($r2));

}

function f2($t)

{

return log10($t*$t+3.5);

}

function f3($t)

{

return ($t+0.8)/sqrt($t*$t+1.2);

}

function intotf1($a1,$b1,$hx,$ee)

{ $z=$a1;$zm=abs(f12($z));

while ($z<=$b1)

{

$z+=$hx;

if($zm<abs(f12($z))) $zm=abs(f12($z));

}

$n=floor(sqrt(($b1-$a1)*$zm/(12*$ee)))+1;

$hz=($b1-$a1)/$n;$s=(f1($a1)+f1($b1))/2;

for($i=1;$i<$n;$i++)

$s+=f1($a1+$i*$hz);

return $s*$hz;

}

function intotf2($a1,$b1,$nn)

{

$hz=($b1-$a1)/(2*$nn);$s=f1($a1)+f1($b1);$r=4;

for ($i=1;$i<=2*$nn-1;$i++)

{

$s+=$r*f2($a1+$i*$hz);$r=6-$r;

}

return $s*$hz/3;

}

function d4max($a1,$b1,$nn)

{

$hz=($b1-$a1)/(2*$nn);$z=$a1+3*$hz;

$d11=f2($a1+$hz)-f2($a1);$d12=f2($a1+2*$hz)-f2($a1+$hz);

$d13=f2($a1+3*$hz)-f2($a1+2*$hz);

$d21=$d12-$d11;$d22=$d13-$d12;

$d32=$d22-$d21; $d4m=0;

for($i=1;$i<=2*$nn-4;$i++)

{

$d12=$d13;

$d13=f2($z+$hz)-f2($z);

$d21=$d22;$d22=$d13-$d12;

$d31=$d32;$d32=$d22-$d21;

$d4=$d32-$d31;if ($d4m<abs($d4)) $d4m=abs($d4);

}

return $d4m;

}

function intotf3($a1,$b1,$nn)

{$cc=array();$tt=array();

if ($nn=4)

{

$cc[1]=0.34785;$cc[4]=$cc[1];$cc[2]=0.65215;

$cc[3]=$cc[2];$tt[1]=-0.86114;$tt[2]=-0.33998;

$tt[3]=-$tt[2];$tt[4]=-$tt[1];

}

else

{

$cc[1]=0.23693;$cc[5]=$cc[1];$cc[2]=0.47863;

$cc[4]=$cc[2];$cc[3]=0.56889;$tt[1]=-0.90618;

$tt[2]=-0.538469;$tt[3]=0;$t[4]=-$tt[2];$tt[5]=-$tt[1];

}

$s=0;

for($i=1;$i<=$nn;$i++)

$s+=$cc[$i]*f3(($a1+$b1)/2+($b1-$a1)*$tt[$i]/2);

return $s*($b1-$a1)/2;

}

$ab1=array();$ab2=array();$ad3=array();

$ff = fopen('idlr7.txt', 'r'); //

$f = fgets($ff, 999);

$ab1 = explode(",", $f);

$f = fgets($ff, 999);

$ab2 = explode(",", $f);

$f = fgets($ff, 999);

$ab3 = explode(",", $f);

fclose($ff);

echo "<br />";

print_r($ab1);

echo "<br />";

print_r($ab2);

echo "<br />";

print_r($ab3);

$ss1="";$ss2="";$ss3="";

$a=$ab1[0];$b=$ab1[1];$hx=$ab1[2];

$eps1=$ab1[3];$r1=intotf1($a,$b,$hx,$eps1);

$eps2=$ab1[4];$r2=intotf1($a,$b,$hx,$eps2);

$eps3=$ab1[5];$r3=intotf1($a,$b,$hx,$eps3);

$ss1.="<br />Int1($a,$b,$hx,$eps1)=$r1;<br />";

$ss1.="<br />Int1($a,$b,$hx,$eps2)=$r2;<br />";

$ss1.="<br />Int1($a,$b,$hx,$eps3)=$r3;<br />";

$a=$ab2[0];$b=$ab2[1];$n1=$ab2[2];$n2=$ab2[3];

$r1=intotf2($a,$b,$n1);

$ro1=d4max($a,$b,$n1);$di1=($b-$a)*$ro1;$ro1=$di1/180;

$r2=intotf2($a,$b,$n2);

$ro2=d4max($a,$b,$n2);$di2=($b-$a)*$ro2;$ro2=$di2/180;

$ss2.="<br />Int2($a,$b,$n1)=$r1;<br />";

$ss2.="<br />rost1($n1)=$ro1;<br />";

$ss2.="<br />di($n1)=$di1;<br />";

$ss2.="<br />Int2($a,$b,$n2)=$r2;<br />";

$ss2.="<br />rost1($n2)=$ro2;<br />";

$ss2.="<br />di($n2)=$di2;<br />";

$a=$ab3[0];$b=$ab3[1];$n1=$ab3[2];$n2=$ab3[3];

$r1=intotf3($a,$b,$n1);$r2=intotf3($a,$b,$n2);

$ss3.="<br />Int3($a,$b,$n1)=$r1;<br />";

$ss3.="<br />Int3($a,$b,$n2)=$r2;<br />";

$fff = fopen('iidlr7.txt', 'a'); //

//fseek($fff, 0, SEEK_END); //

fwrite($fff, $ss1."\r\n"); //

fwrite($fff, $ss2."\r\n"); //

fwrite($fff, $ss3."\r\n"); //

fclose($fff);

echo $ss1;echo $ss2;echo $ss3;

?>

abilr725012017.php

Array ( [0] => 0.7 [1] => 1.3 [2] => 0.001 [3] => 0.0001 [4] => 0.00001 [5] => 0.000001 )

Array ( [0] => 2 [1] => 6 [2] => 10 [3] => 20 )

Array ( [0] => 1.6 [1] => 2.7 [2] => 4 [3] => 5 )

Int1(0.7,1.3,0.001,0.0001)=0.40415378841855;

Int1(0.7,1.3,0.001,0.00001)=0.40413583007904;

Int1(0.7,1.3,0.001,0.000001 )=0.40413404026808;

Int2(2,6,10)=4.9522064207724;

rost1(10)=2.7395526115841E-5;

di(10)=0.0049311947008515;

Int2(2,6,20 )=5.0191041740618;

rost1(20 )=5.2151767047142E-6;

di(20 )=0.00093873180684856;

Int3(1.6,2.7,4)=1.3437735437077;

Int3(1.6,2.7,5)=1.3437735437077

idlr7.txt

0.7,1.3,0.001,0.0001,0.00001,0.000001

2,6,10,20

1.6,2.7,4,5

idlr7gr.txt

0.7,1.3,0.01

2,6,0.01

1.6,2.7,0.01,50,50

iidlr7.txt

<br />Int1(0.7,1.3,0.001,0.0001)=0.40415378841855;<br /><br />Int1(0.7,1.3,0.001,0.00001)=0.40413583007904;<br />

<br />Int1(0.7,1.3,0.001,0.000001)=0.40413404026808;<br />

<br />Int2(2,6,10)=4.9522064207724;<br /><br />rost1(10)=2.7395526115841E-5;<br />

<br />di(10)=0.0049311947008515;<br /><br />Int2(2,6,20)=5.0191041740618;<br />

<br />rost1(20)=5.2151767047142E-6;<br /><br />di(20

)=0.00093873180684856;<br />

<br />Int3(1.6,2.7,4)=1.3437735437077;<br /><br />Int3(1.6,2.7,5)=1.3437735437077;<br />

abilr7gr25012017.php

<?php

function f1($t)

{

return 1/sqrt(2*$t*$t+0.3);

}

function f2($t)

{

return log10($t*$t+3.5);

}

function f3($t)

{

return ($t+0.8)/sqrt($t*$t+1.2);

}

$im=imageCreateTrueColor(400,500);/* S0zdaecz Host */

$c=imageColorAllocate($im,220,220,200); /* Sozdaem cvet */

for($i=0;$i<1000;$i++)

{

$x=mt_rand(0,imageSX($im));

$y=mt_rand(0,imageSY($im));

imageSetPixel($im,$x,$y,$c);/* Zakrashivaencz pixel*/

}

$ab1=array();$ab2=array();$ad3=array();

$ff = fopen('idlr7gr.txt', 'r'); //

$f = fgets($ff, 999);

$ab1 = explode(",", $f);

$f = fgets($ff, 999);

$ab2 = explode(",", $f);

$f = fgets($ff, 999);

$ab3 = explode(",", $f);

fclose($ff);

$mx=$ab3[3];$my=$ab3[4];

$x0=imageSX($im)/2;$y0=imageSY($im)/2;

imageLine($im,$x0,0,$x0,2*$y0,$c); /* Risuem os ox*/

imageLine($im,0,$y0,2*$x0,$y0,$c); /* Risuem os oy*/

$a=$ab1[0];$b=$ab1[1];$h=$ab1[2];

$x=$a;$mxn=$x0+floor($mx*$x);$myn=floor($y0-$my*f1($x));

while($x<=$b)

{

$x+=$h;

$mxk=$x0+floor($mx*$x);$myk=$y0-floor($my*f1($x));

imageLine($im,$mxn,$myn,$mxk,$myk,$c); /* Risuem os oy*/

$mxn=$mxk;$myn=$myk;

}

$a=$ab2[0];$b=$ab2[1];$h=$ab2[2];

$x=$a;$mxn=$x0+floor($mx*$x);$myn=floor($y0-$my*f2($x));

$c=imageColorAllocate($im,220,220,220);

while ($x<=$b)

{

$x+=$h;

$mxk=$x0+floor($mx*$x);$myk=$y0-floor($my*f2($x));

imageLine($im,$mxn,$myn,$mxk,$myk,$c); /* Risuem os oy*/

$mxn=$mxk;$myn=$myk;

}

$a=$ab3[0];$b=$ab3[1];$h=$ab3[2];

$x=$a;$mxn=$x0+floor($mx*$x);$myn=floor($y0-$my*f3($x));

$c=imageColorAllocate($im,220,220,220);

while ($x<=$b)

{

$x+=$h;

$mxk=$x0+floor($mx*$x);$myk=$y0-floor($my*f3($x));

imageLine($im,$mxn,$myn,$mxk,$myk,$c); /* Risuem os oy*/

$mxn=$mxk;$myn=$myk;

}

ImagePng($im);

imagePng($new_im,"lek3_12.png");/*Sochronim v file*/

imageDestroy($im);

?>

 

1.1

2.1

3.1

4.1

5.1

6.1

7.1

8.1

9.1

10.1

11.1

12.1

13.1

14.1

15.1

16.1

17.1

18.1

19.1

20.1

21.1

22.1

23.1

24.1

25.1

26.1

27.1

28.1

29.1

30.1

 

1.2

2.2

3.2

4.2

5.2

6.2

7.2

8.2

9.2

10.2

11.2

12.2

13.2

14.2

15.1

16.2

17.2

18.2

19.2

20.2

21.2

22.2

23.2

24.2

25.2

26.2

27.2

28.2

 

29.2

30.2

 

 

.

1.

4.

7.

10.

13.

16.

19.

22.

25.

28.

2.

5.

 

8.

11.

 

14.

17.

20.

23.

26.

29.

 

3.

6.

 

9.

12.

15.

18.

21.

24.

27.

30.

8

: .

 

1. ,

2. - .

3. , .

4. , 0.0001 , ; , n=10.

5. , .

6. y=y(x).

.

, y(x) - ,

: .

, . . . , e>0 - .

.

abilr826012017.php, idlr8.txt,abilr8gr28012017.php, idlr8gr.txt, iidlr8.txt, , .

abilr826012017.php

<?php

function f($t,$z)

{

return $t+sin($z/2.25);

}

function difur($a1,$b1,$z0,$ee,$n)

{

$vk=array();

$vk[0]=$z0;$hz=($b1-$a1)/$n;

for($i=0;$i<=$n-1;$i++)

$vk[$i+1]=$vk[$i]+$hz*f($a1+$hz*$i,$vk[$i]);

$zm=100;

while($zm>=$ee)

{$zm=0;

for($i=0;$i<=$n-1;$i++)

{

$s=$vk[$i]+$hz*(f($a1+$hz*$i,$vk[$i])+f($a1+($i+1)*$hz,$vk[$i+1]))/2;

if ($zm<abs($s-$vk[$i+1]))

$zm=abs($s-$vk[$i+1]);$vk[$i+1]=$s;

}

}

return $vk;

}

$y=array();$x=array();$ab=array();

$ff = fopen('idlr8.txt', 'r'); //

$f = fgets($ff, 999);

$ab = explode(",", $f);

fclose($ff);

$a=$ab[0];$b=$ab[1];$yy0=$ab[2];$eps=$ab[3];$n=$ab[4];

$hx=($b-$a)/$n;

for($i=0;$i<=$n;$i++)

$x[$i]=$a+$i*$hx;

$y=difur($a,$b,$yy0,$eps,$n);

$ss="";

for($i=0;$i<=$n;$i++)

{ $xx=$x[$i];$yy=$y[$i];

$ss.="<br />y($xx)=$yy;<br />";

}

echo "<br />";

print_r($ab);

echo "<br />";

print_r($x);

echo "<br />";

print_r($y);

echo "<br />";

$ss1 = implode(",", $x);

$ss2 = implode(",", $y);

$fff = fopen('iidlr8.txt', 'a'); //

//fseek($fff, 0, SEEK_END); //

fwrite($fff, $ss1."\r\n"); //

fwrite($fff, $ss2."\r\n"); //

fclose($fff);

echo $ss;

?>

abilr826012017.php

 

Array ( [0] => 1.4 [1] => 2.4 [2] => 2.2 [3] => 0.0001 [4] => 10 )

Array ( [0] => 1.4 [1] => 1.5 [2] => 1.6 [3] => 1.7 [4] => 1.8 [5] => 1.9 [6] => 2 [7] => 2.1 [8] => 2.2 [9] => 2.3 [10] => 2.4 )

Array ( [0] => 2.2 [1] => 2.4305666903876 [2] => 2.6760771817546 [3] => 2.9357249585811 [4] => 3.2084426366815 [5] => 3.4929107599678 [6] => 3.7875858223939 [7] => 4.0907480257404 [8] => 4.4005664676553 [9] => 4.7151766082661 [10] => 5.0327626949653 )

y(1.4)=2.2;

y(1.5)=2.4305666903876;

y(1.6)=2.6760771817546;

y(1.7)=2.9357249585811;

y(1.8)=3.2084426366815;

y(1.9)=3.4929107599678;

y(2)=3.7875858223939;

y(2.1)=4.0907480257404;

y(2.2)=4.4005664676553;

y(2.3)=4.7151766082661;

y(2.4)=5.0327626949653

idlr8.txt

1.4,2.4,2.2,0.0001,10

iidlr8.txt

1.4,1.5,1.6,1.7,1.8,1.9,2,2.1,2.2,2.3,2.4

2.2,2.4305666903876,2.6760771817546,2.9357249585811,3.2084426366815,3.4929107599678,3.7875858223939,4.0907480257404,4.4005664676553,4.7151766082661,5.0327626949653

 

abilr8gr28012017.php

<?php

function f($t,$z)

{

return $t+sin($z/2.25);

}

function difur($a1,$b1,$z0,$ee,$n)

{

$vk=array();

$vk[0]=$z0;$hz=($b1-$a1)/$n;

for($i=0;$i<=$n-1;$i++)

$vk[$i+1]=$vk[$i]+$hz*f($a1+$hz*$i,$vk[$i]);

$zm=100;

while($zm>=$ee)

{$zm=0;

for($i=0;$i<=$n-1;$i++)

{

$s=$vk[$i]+$hz*(f($a1+$hz*$i,$vk[$i])+f($a1+($i+1)*$hz,$vk[$i+1]))/2;

if ($zm<abs($s-$vk[$i+1]))

$zm=abs($s-$vk[$i+1]);$vk[$i+1]=$s;

}

}

return $vk;

}

$im=imageCreateTrueColor(400,500);/* S0zdaecz Host */

$c=imageColorAllocate($im,220,220,200); /* Sozdaem cvet */

for($i=0;$i<1000;$i++)

{

$x=mt_rand(0,imageSX($im));

$y=mt_rand(0,imageSY($im));

imageSetPixel($im,$x,$y,$c);/* Zakrashivaencz pixel*/

}

$y=array();$y=array();$ab=array();

$ff = fopen('idlr8gr.txt', 'r'); //

$f = fgets($ff, 999);

$ab = explode(",", $f);

fclose($ff);

$a=$ab[0];$b=$ab[1];$yy0=$ab[2];$eps=$ab[3];$n=$ab[4];

$mx=$ab[5];$my=$ab[6];

$hx=($b-$a)/$n;

$y=difur($a,$b,$yy0,$eps,$n);

 

$x0=imageSX($im)/2;$y0=imageSY($im)/2;

imageLine($im,$x0,0,$x0,2*$y0,$c); /* Risuem os ox*/

imageLine($im,0,$y0,2*$x0,$y0,$c); /* Risuem os oy*/

$x=$a;$x2=$x0+floor($mx*$x); $y2=$y0-floor($my*$y[0]);

for($i=1;$i<=$n;$i++)

{

$x+=$hx;$x1=$x2;$y1=$y2;

$x2=$x0+floor($mx*$x);$y2=$y0-floor($my*$y[$i]);

imageLine($im,$x1,$y1,$x2,$y2,$c);

}

ImagePng($im);

imagePng($new_im,"lek3_12.png");/*Sochronim v file*/

imageDestroy($im);

?>

idlr8gr.txt

0.4,2.4,2.2,0.0001,10,50,30

.

1.

 

2.

3.

4.

5.

6.

7.

8.

9.

10.

11.

12.

 

13.

14.

15.

16.

17.

18.

19.

20.

21.

22.

23.

24.

 

25.

26.

27.

28.

29.

30.

9

: .

1. ,

2. - .

3. , .

4. . , , y(x0)=y0 ; , n=10. -.

5. y=y(x).

y1(a), y2=y(a+h) -. xi+1=xi+h,

, .

.

.

abilr926012017.php,idlr9.txt, abilr9gr28012017.php, idlr9gr.txt, iidlr9.txt, , .

 

abilr926012017.php

<?php

function f($t,$z)

{

return 1+0.2*$z*sin($t)-1.5*$z*$z;

}

function difur($a1,$b1,$z0,$n)

{

$vk=array();

$vk[0]=$z0;$hz=($b1-$a1)/$n;

for($i=0;$i<=1;$i++)

{

$k1=$hz*f($a1+$i*$hz,$vk[$i]);

$k2=$hz*f($a1+$i*$hz/2,$vk[$i]+$k1/2);

$k3=$hz*f($a1+$i*$hz/2,$vk[$i]+$k2/2);

$k4=$hz*f($a1+$i*$hz,$vk[$i]+$k3);

$vk[$i+1]=$vk[$i]+($k1+2*$k2+2*$k3+$k4)/6;

}

$q0=$hz*f($a1,$vk[0]);$q1=$hz*f($a1+$hz,$vk[1]);

$dq1=$q1-$q0;

for($i=2;$i<=$n-1;$i++)

{

$q0=$q1;$dq2=$dq1;$q1=$hz*f($a1+$i*$hz,$vk[$i]);

$dq2=$q1-$q0;$ddq=$dq2-$dq1;

$vk[$i+1]=$vk[$i]+$q1+$dq1/2+5*$ddq/12;

}

return $vk;

}

$y=array();$x=array();$ab=array();

$ff = fopen('idlr9.txt', 'r'); //

$f = fgets($ff, 999);

$ab = explode(",", $f);

fclose($ff);

$a=$ab[0];$b=$ab[1];$yy0=$ab[2];$n=$ab[3];

$hx=($b-$a)/$n;

for($i=0;$i<=$n;$i++)

$x[$i]=$a+$i*$hx;

$y=difur($a,$b,$yy0,$n);

$ss="";

for($i=0;$i<=$n;$i++)

{ $xx=$x[$i];$yy=$y[$i];

$ss.="<br />y($xx)=$yy;<br />";

}

echo "<br />";

print_r($ab);

echo "<br />";

print_r($x);

echo "<br />";

print_r($y);

echo "<br />";

$ss1 = implode(",", $x);

$ss2 = implode(",", $y);

$fff = fopen('iidlr9.txt', 'a'); //

//fseek($fff, 0, SEEK_END); //

fwrite($fff, $ss1."\r\n"); //

fwrite($fff, $ss2."\r\n"); //

fclose($fff);

echo $ss;

?>

abilr926012017.php

Array ( [0] => 0 [1] => 1 [2] => 0 [3] => 10 )

Array ( [0] => 0 [1] => 0.1 [2] => 0.2 [3] => 0.3 [4] => 0.4 [5] => 0.5 [6] => 0.6 [7] => 0.7 [8] => 0.8 [9] => 0.9 [10] => 1 )

Array ( [0] => 0 [1] => 0.099502793242868 [2] => 0.19628669397921 [3] => 0.2896331013129 [4] => 0.3762080192874 [5] => 0.45470575135438 [6] =>0.52446414121419 [7] => 0.58540229757293 [8] => 0.63788110208173 [9] => 0.68255004434683 [10] => 0.72021072693914 )