X(2)= 2.000 Y(2)= 3.0402 Z(2)=3.0406
X(3)= 2.100 Y(3)= 3.2611 Z(3)=3.2617
X(4)= 2.200 Y(4)= 3.4823 Z(4)=3.4830
X(5)= 2.300 Y(5)= 3.7037 Z(5)=3.7044
X(6)= 2,400 Y(6)= 3.9251 Z(6)=3.9259
X(7)= 2.500 Y(7)= 4.1468 Z(7)=4.1476
X(1)= 2.600 Y(1)= 4.3688 Z(1)=4.3697
X(9)= 2.700 Y(9)= 4.5914 Z(9)=4.5926
X(90)= 2.800 Y(90)= 4.8150 Z(90)=4.8166
9.2- Paskal tili dasturi
{Birinchi tartibli differentsial tenglama }
{Y1=F(X,Y) uchun}
{Koshi masalasini Eylerning ketma-ket yaqinlashish usulida}
{taqribiy yechimini topish}
program ailer2(output,input);
label 11;
function fne(x,y:real):real;
begin fne:=x+cos(y/sqrt(5)); end;
var
x,y,x1,y1,h,b,z,eps:real;
i,n:integer;
begin
eps:=0.001;
writeln(' x=','y=',' h=',' b=');readln(x,y,h,b);
n:=trunc((b-x)/h);
for i:=1 to n do
begin
y1:=y;
y:=y+h*fne(x,y);
11: z:=y;
y:=y1+(fne(x,y1)+fne(x+h,z))*h/2;
x:=x+h;
if abs(z-y)>eps then goto 11;
writeln;
write(' x(',i:2,')=',x:8:4);
write(' y(',i:2,')=',y:8:4);
write(' z(',i:2,')=',x:8:4) ;
end;
end.
9.4 DASTUR
5 REM RUNGE – KUTTA USULI
10 DEF FNE (X;Y)=X+COS(Y/SQR (5))
20 REM “boshlang’ich qiymat ,qadam, berilgan kesma yuqori chegarasi:”
22 READ X, Y, H, B
24 REM “boshlang’ich qiymat ,qadam, berilgan kesma yuqori chegarasi qiymatlari:”
26 DATA 1.8, 2.6, 0.1, 2.8
30 PRINT
32 PRINT “Birinchi tartibli differentsial tenglama ”
Do'stlaringiz bilan baham: |