1-2 tajriba mashg'ulotlari. Algebraik va transendent tenglamalarni yechish usullari va algoritmlari
Download 147.26 Kb.
|
1-2 TAJRIBA ISHLARI
- Bu sahifa navigatsiya:
- =0.01 H=0.1: E=0.01
- 4 ‘ -------- 2.9- DASTUR -------------------------- 5 ‘—---Iteratsiya usulida trantsendent tenglama ---------- 6 ‘ ----------- ildizini aniqlash
- 40 X=X1 50 FOR I=1 TO N 60 Y=FNF(X) 70 IF ABS(Y-X) 80 X=Y 90 NEXT I
- (*----------------- 2.9- DASTUR -----------------*) (* Iteratsiya usulida chiziksiz tenglamalarni *) (* Paskal tili dasturida hisoblash dasturi *) USES CRT;
- 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
- 1. Vatarlar usuli 2.2-masala. e x -10x-2=0 tenglamaning =0.01 aniqlikdagi taqribiy ildizi topilsin. Yechish . f(x) =e
- Berilganlar Belgilashlar matn bo‘yicha
- (* -- 2.6 - Paskal tili dastur -----*) (* VATARLAR USULIDA *) (*Trantsendent tenglamaning ildizi yotgan oraliq va ildizni anuqlash *) USES CRT;
- 4 ‘ ------ 2.6- DASTUR --------------- 5 ‘—-Vatarlar usulida trantsendent tenglama
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. 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-100-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
(* -- 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 ---- 0>0>0>0>0> Download 147.26 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling