1-2 tajriba mashg'ulotlari. Algebraik va transendent tenglamalarni yechish usullari va algoritmlari
> NewtonsMethod(exp(x)-10*x-2, x =3, view = [-2..5, DEFAULT], output =plot)
Download 147.26 Kb.
|
1-2 TAJRIBA ISHLARI
- Bu sahifa navigatsiya:
- Berilganlar Belgilashlar matn bo‘yicha
- 4 ‘ ----------- 2.7- DASTUR ------------------- 5 ‘Urinmalar usulida trantsendent tenglama 6 ‘--------- ildizini aniqlash
- 52 H=.1:E=.001 60 X1=A 70 X2=X1+H:X=X1:A=X2 80 IF X2>B THEN 180 90 IF FNF(X1)*FNF(X2)>0 THEN 170
- 150 PRINT “,”;USING “.”;X2; 160 PRINT “) x= “;USING “.”;X 170 X1=X2:GOTO 70 180 END Ok
- (*-------- 2.7- DASTUR ---------*) (* URINMALAR USULIDA *) (*Trantsendent tenglamaning ildizi yotgan oraliq va ildizni anuqlash *) uses crt;
- Mustaqil ishlar uchun topshiriqlar
> NewtonsMethod(exp(x)-10*x-2, x =3, view = [-2..5, DEFAULT], output =plot);
ex-10x-2=0 tenglamani [a,b] oraliqda >0 aniqlikdagi yechimini urinmalar usuli bilan topishning hisoblash dasturini tuzamiz. Masaladagi berilganlar asosida ko’rsatilgan usulda hisoblashning algoritmini 2.7-jadvalda beramiz : 2.7-jadval
4 ‘ ----------- 2.7- DASTUR ------------------- 5 ‘Urinmalar usulida trantsendent tenglama 6 ‘--------- ildizini aniqlash-------------- 10 REM SAVE”kas-1.bas”,a 20 DEF FNF(X)=EXP(X)-10*X-2 30 DEF FNF1(X)=EXP(X)-10 40 DEF FNF2(X)=EXP(X) 50 INPUT” ildiz chegarasi a,b=”; A,B 52 H=.1:E=.001 60 X1=A 70 X2=X1+H:X=X1:A=X2 80 IF X2>B THEN 180 90 IF FNF(X1)*FNF(X2)>0 THEN 170 100 IF FNF(X1)*FNF2(X1)>0 THEN 120 110 X=X2:A=X1 120 X=X-FNF(X)/FNF1(X) 130 IF FNF(X)>=E THEN 120 140 PRINT “(“;USING “##.###”;X1; 150 PRINT “,”;USING “##.###”;X2; 160 PRINT “) x= “;USING “##.######”;X 170 X1=X2:GOTO 70 180 END Ok RUN ? -2,5 (-0.200,-0.100) x= -0.110458 ( 3.600, 3.700) x= 3.650891 Ok (*-------- 2.7- DASTUR ---------*) (* URINMALAR 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 qadami h ‘); write(‘ a=’);readln(a); write(‘ b=’);readln(b); writeln(‘ URINMALAR usulida hisoblash ‘); writeln(‘oraliq va ildiz’); i:=1; EPS:=0.001; h:=0.1; 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)/fna(x); if abs(fnf(x))>EPS then goto L2; writeln; writeln(‘ (‘,x1:6:4,’, ‘,x2:6:4,’)’,’ x=’,x:8:4); i:=i+1; L3: x1:=x2; goto L1; L4: readln; end. Ildiz yotgan Kesma (a,b) va ildizni aniqlash qadami h bo‘lganda URINMALAR usulida hisoblash a= -7 b= 7 oraliq va ildiz (-0.2000, -0.1000) x= -0.1105 (3.6000, 3.7000) x= 3.6509 Mustaqil ishlar uchun topshiriqlar Quyidagi jadvaldagi tenglamalar ildizini: 1. Ildizlarining qisqa atrofini -analitik va grafik usulda aniqlang -ildizni ajratish dasturini tuzing (BEYSIK tilida) 2.Aniqlangan oraliqda ildizni vatarlar, urinmalar va birgalashgan usulida hisoblang.
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