1-2 tajriba mashg'ulotlari. Algebraik va transendent tenglamalarni yechish usullari va algoritmlari


Download 147.26 Kb.
bet3/5
Sana18.02.2023
Hajmi147.26 Kb.
#1209660
1   2   3   4   5
Bog'liq
1-2 TAJRIBA ISHLARI

Berilganlar

Belgilashlar

matn bo‘yicha

dastur bo‘yicha

Tenglama funksiyasi

f(x)=ex-10x-2

FNF(x)=EXP(X)-10*X -2

Iteratsiya usulini qo‘llash uchun tenglamani o‘zgartirilgan ko‘rinishi

x=(ex-2)/10



X=(EXP(X)-2)/10

Tenglama funksiyasi ning ikkinchi hosilasi

f ’’ (x)=ex-10

FNF2(x)=EXP(X)

Ildiz yotgan Kesma

a=-1, b=0

a=-1, b=0

Kesmani bo‘linish qadami va aniqlikda

H=0.1, =0.01

H=0.1: E=0.01

Ildiz yotgan kesma

(x1, x2)=(x1, x1+h)

(x1, x2)=(x1, x1+h)

Ildiz yotgan kesmani aniqlash sharti

f(x1) ·f(x2) <0

fnf(x1)*fnf(x2)<0

Urinmalar va vatarlar usulini qo‘llash sharti

f(x) f’’(x)>0
f(x) f’’(x)<0

fnf(x)*fnf2(x)>0
fnf(x)*fnf2(x)<0

Urinmalar va vatarlar usulida hisoblash formulasi

x2= x1f(x1)/ f '(x1),
x1= x1 – (x2 – x1)f(x1)/ (f(x2)-f(x1))



A=A-FNF(A)/ FNF1(A),
X=X-(A-X)* FNF(X)/(FNF(A)-FNF(X))

Ildizga yaqinlashish sharti

x1 –x2<

ABS(x1-x2)<=E yoki FNF(X)<=E



4 ‘ -------- 2.9- DASTUR --------------------------
5 ‘—---Iteratsiya usulida trantsendent tenglama ----------
6 ‘ ----------- ildizini aniqlash---------------------
10 PRINT “Boshlangich qiymatni, aniqlikni va iteratsiya sonin”
12 PRINT “kiriting X1 , E, N=:”
20 INPUT X1 , E, N
30 DEF FNF(X)=(EXP(X)-2)/10
40 X=X1
50 FOR I=1 TO N
60 Y=FNF(X)
70 IF ABS(Y-X)<=E THEN 120
80 X=Y
90 NEXT I
100 PRINT “ berilga N aniqlik etarli emas”
110 GOTO 10
120 PRINT” Xisob natijasi: “
130 PRINT” i=”; i,” da x=”;x ,”y=”;y
140 END
Berilganlar: x0=0 , =0.01 , N=100
Javob: I=3 , x= -0.1095 , y= -0.108965

(*----------------- 2.9- DASTUR -----------------*)
(* Iteratsiya usulida chiziksiz tenglamalarni *)
(* Paskal tili dasturida hisoblash dasturi *)
USES CRT;
LABEL L1,L2;
function fnf(x:real):real;
write(‘ х=’);readln(х);
begin fnf:= (EXP(x)-2)/10; end;
y:=fnf(x);
P:=x-y;
if abs(P)
write( i:2,’-yakinlashish’);
writeln(‘x(‘,i:2,’)=’,x:8:4);
i:=i+1;
x:=y;
goto L1;
L2: writeln(‘x(‘,i:2,’)=’,x:8:4);
readln;
end.
X=-1
1-yakinlashish x(1)= -1.0000
2-yakinlashish x(2)= -0.1632
3-yakinlashish x(3)= -0.1151



2.4-Maple 7 dasturi
> f:= x -> (exp(x)-2)/10;
> x||0:=0;
> for k from 1 to 16 do x||k: =evalf(f(x)||(k-1)): od:
> f(x)=x; solve(%, x);evalf(%,4);



MUSTAQIL ISHLAR UCHUN TOPSHIRIQLAR
Quyidagi tenglamalar:
1.Ildizlarning qisqa atrofini analitik yoki grafik usulda aniqlang;
2. Aniqlangan oraliqda ildizning taqribiy qiymatini 0.01 aniqlikda iteratsiya usuli bilan hisoblang;


1. 1) x-sinx=0.25
2) x3-3x2+9x-8=0

2 1) tg(0.58x+0.1)=x2
2) x3-6x-8=0

3 1) x-cos(0.378x)=0
2) x3-3x2+6x+3=0

4 1) tg(0.4x+0.4)=x2
2) x3-0.1x2+0.4x-1.5=0

5 1) lgx-7/ (2x+6)=0
2) x3+x-5=0

6 1) tg(0.5x+0.2)=x2
2) x3+x-5=0

7 1) 3x-cosx-1=0
2) x3+0.2x2+0.5x-1.2=0

8 1) x+lgx=0.5
2) x3+3x+1=0

9 1)tg(0.5x+0.1)=x2
2) x3+0.2x2=0.5x-2=0

10 1) x3+4sinx=0
2) x3-3x2+12x-9=0

11 1) ctg(1.05x)-x2=0
2) x3-0.2x2+0.3x-1.2=0

12 1) tg(0.4x-0.3)=x2
2) x3-3x2+6x-2=0

13 1)xlgx-1.2=0
2) x3-0.1x2+0.4x-1.5=0

14 1) 1.8x2-sin10x=0
2) x3+3x2+6x-1=0

15. 1) ctgx-x/4=0
2) x3-0.1x2+0.4x-1.2=0

16. 1) tg(0.3x+0.4)=0
2) x3+4x-6=0

17. 1) x2-20Sinx=0
2) x3+0.2x2+0.5x+0.8=0

18. 1) ctgx-x/3=0
2) x3-3x2+12x-12=0

19. 1) tg(0.47x+0.2)=x2
2) x3-0.2x2+0.3x+1.2=0

20. 1) x2+4sinx=0
2) x3-2x+4=0

21 1) ctgx-x/2=0
2) x3-0.2x2+0.5x-1.4=0

22 1) 2x-lgx-7=0
2) x3-3x2+6x-5=0

23 1) tg(0.44x+0.3)=x2
2) x3-0.1x2+0.4x+1.2=0

24 1) 3x-cosx-1=0
2) x3-0.2x2+0.5x-1=0

25 1) ctgx-x/10=0
2) x3+3x2+12x+3=0

26 1) x2+4Sinx=0
2) x3-0.1x2+0.4x+2=0

27 1) tg(0.36x+0.4)=x2
2) x3-0.2x2+0.4x-1.4=0

28 1) x+lgx=0.5
2) x3+0.4x2+0.6x-1.6=0

29 1) ctgx-x/5=0
2) x3+x-3=0

30 1) 2lgx-x/2+1=0
2) x3-0.2x2+0.5x+1.4=0


1. Vatarlar usuli
2.2-masala. ex-10x-2=0 tenglamaning =0.01 aniqlikdagi taqribiy ildizi topilsin.
Yechish. f(x)=ex-10x-2 funksiya [-1,0] oraliqda 2.4-teoremaning barcha shartlarini qanoatlantirishini tekshirib ko‘rish qiyinchilik tug‘dirmaydi. ­x[-1,0] da ikkinchi tartibli hosila f''(x) = ex >0. undan tashqari, f(0)=-1, f(-1)=8.368 bo‘lganligi uchun, (2.5) shartga asosan f(0)f''(0)<0 bo‘lgani uchun {bn} ketma-ketlik (2.7) jarayon bilan quriladi.
Berilganlar: a=-1, b=0, =0. 01
f(x)= ex-10x-2, f (-1) =e-1 -10(-1) -2=8.386, f (0) =e0-100-2= -1
(2.7) formulaga asosan:
b0= 0
b1= b0 – (a- b0) f(b0)/ (f(a)-f(b0))= -0.107
b1 –b2> bo‘lganligi uchun b2 yaqinlashishni hisoblaymiz. Buning uchun
b1= -0.107, f (-0.107) =e-0.107-10(-0.107)-2=-0.038, f(a)=f(-1)=8.386 larga asosan:
b2= b1 – (a- b 1) f(b 1)/ (f(a)-f(b 1)) = -0,111
b2- b1=- 0.111+0.107=0.004<=0,01
Demak, 0.01 aniqlikdagi taqribiy yechim deb t b2 =-0.11 ni olish mumkin.
ex-10x-2=0 tenglamani [a,b] oraliqdagi yechimini vatarlar usuli bilan topishning Beysik tilidagi blok sxemaci va 2.6-dasturini tuzamiz.
Masaladagi berilganlar asosida ko’rsatilgan usulda hisoblashning algoritmini 2.6-jadvalda beramiz :
2.6-jadval

Berilganlar

Belgilashlar

matn bo‘yicha

dastur bo‘yicha

Tenglama funksiyasi

f(x)=ex-10x-2

FNF(x)=exp(X)-10*X -2

Tenglama funksiyasining birinchi hosilasi

f '(x)=ex-10

FNF1(x)=exp(X)-10

Tenglama funksiyasining ikkinchi hosilasi

f '' (x)=ex

FNF2(x)=exp(X)

Ildiz yotgan kesma сhegarasi

A=-1, b=0

a=-1, b=0

Kesmani bo‘linish qadami

H=0.1

H=0.1

Ildiz yotgan kesma

(x1, x2)=(x1, x1+h)

(x1, x2)=(x1, x1+h)

Ildiz yotgan kesmani aniqlash sharti

f(x1f(x2)<0

fnf(x1)*fnf(x2)<0

Vatarlar usulini qo‘llash sharti

f(x) f ''(x)<0

fnf(x)*fnf2(x)<0

Vatarlar usulida hisoblash formulasi

x1= x1 – (x2 – x1)f(x1)/ (f(x2)-f(x1))



X=X-(A-X)* FNF(X)/(FNF(A)-FNF(X))

Ildizga yaqinlashish sharti

x1 –x2<

ABS(x1-x2)<=E yoki FNF(X)<=E



(* -- 2.6 - Paskal tili dastur -----*)
(* VATARLAR USULIDA *)
(*Trantsendent tenglamaning ildizi yotgan oraliq va ildizni anuqlash *)
USES CRT;
LABEL L1,L2,L3,L4;
function fnf(x:real):real;
begin fnf:=EXP(x)-10*x-2; end;
function fna(x:real):real;
begin fna:=EXP(x) -10; end;
function fnb(x:real):real;
begin fnb:=EXP(x); end;
var
a,b,h,EPS,x1,x2,x:real;
i:integer;
begin
clrscr;
writeln(‘Ildiz yotgan Kesma (a,b)’);
writeln(‘ildizni aniqlash qadavb h’);
write(‘ a=’);readln(a);
write(‘ b=’);readln(b);
write(‘ h=’);readln(h);
write(‘ildiz ytgan oraliq va ildiz ‘);
i:=1; EPS:=0.001;
x1:=a;
L1: x2:=x1+h; x:=x1; a:=x2;
if x2>b then goto L4;
if fnf(x1)*fnf(x2)>0 then goto L3;
if fnf(x1)*fnb(x1)>0 then goto L2;
x:=x2;a:=x1;
L2: x:=x-fnf(x)*(a-x)/(fnf(a)-fnf(x));
if abs(fnf(x))>EPS then goto L2;
writeln;
write(‘ (‘,’x1=’,x1:6:3,’, ‘,’x2=’,x2:6:3,’)’,’ ‘,’x=’,x:8:4);
i:=i+1;
L3: x1:=x2;
goto L1;
L4: readln;
end.
Ildiz yotgan Kesma (a,b) va ildizni aniqlash qadavb h bo‘lganda
VATARLAR usulida hisoblash
a=-7
b=7
h=0.1
ildiz ytgan oraliq va ildiz
(x1= -0.200, x2= -0.100) x= -0.1104
(x1= 3.600, x2= 3.700) x= 3.6509


4 ‘ ------ 2.6- DASTUR ---------------
5 ‘—-Vatarlar usulida trantsendent tenglama ----

Download 147.26 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling