Автор работы: Пользователь скрыл имя, 28 Октября 2013 в 06:07, лабораторная работа
Bu holda, [a,b] kesmani t0=(a+b)/2 nuqta yordamida teng ikkiga bo‘lamiz: agar f(t0)=0 bo‘lsa, x=t0 yechim bo‘ladi. f(t0) 0 bo‘lgan holda, agar f(a)f(t0)<0 bo‘lsa, 1.1-teoremaga ko‘ra, x=t ildiz [a1,b1]=[a,t0] oraliqda, aks holda [a1, b1]=[t0, b] oraliqda yotadi.
1-tajriba ishi
Tenglamalarning ildizlarini EHM yordamida ajratish. Tenglamalarni ildizini kesmani teng ikkiga bo‘lish usulida topishni algoritmlash va dasturlash.
Ishdan maqsad: Tenglamalarning ildizlarini kesmani teng ikkiga bo’lish usulida aniqlash algoritmini va dasturini tuzishni o’rganish.
Nazariy qism
Amaliyotda ko’pincha
f(x)=0 (1.1)
kabi tenglamalarning ildizini taqribiy hisoblab topishga to’g’ri keladi.
1.1-teorema . Aytaylik,
U holda, (1.1) tenglama [a,b] oraliqda yagona yechimga ega bo‘ladi.
f(x)=0 tenglama berilgan bo‘lsin. [a,b] kesmada u=f(x) funktsiya 1.1-teoremaning barcha shartlarini qanoatlantirsin.
Berilgan aniqlikdagi taqribiy ildizni olish uchun jarayonni shart bajarilguncha davom ettirish kifoya bo‘lib, taqribiy ildiz sifatida
x= (an +bn)/2
ni qabul qilamiz.
1.1-masala. ex -10x -2=0 tenglama yechimi kesmani teng ikkiga bo‘lish usulida e=0,01 aniqlik bilan toping.
Yechish. f(x)=ex-10x-2 funktsiya [-1,0] oraliqda 1.1-teoremaning barcha shartlarini qanoatlantiradi. Shuning uchun tenglamaga kesmani teng ikkiga bo‘lish usulini ishlatish mumkin.
f(t0)=e-0.5 + 5 – 2 >0 , f(-1)=8.386>0 , f(0)=-1<0
bo‘lganligi uchun yechim [-0.5, 0] oraliqda yotadi.
f(-1).f(-0,25)=8,386.1,279>0
bo‘lganligi uchun yechim [a2, b2]=[-0.25, 0] oraliqda yotadi.
Aniqlik |b2-a2|=0.25>2e etarli bo‘lmagani uchun [-0.25, 0] oraliqni
t2=(0-0.25)/2=0.125
nuqta yordamida teng ikkiga bo‘lamiz.
3) f(-0.125)=0.132 >0 bo‘lganligi uchun yechim [a3,b3]= [-0.125, 0] oraliqda yotadi. Aniqlik |a3-b3|=0.125>2e=0.02 etarli bo‘lmagani uchun [-0.125,0] oraliqni
t3=(0.125+0)/2= =-0.063
nuqta yordamida teng ikkiga bo‘lamiz.
t4= (-0.125 - 0. 063)/2=-0.094
nuqta yordamida teng ikkiga bo‘lamiz.
t5= (-0.125- 0.094)/2= -0.1095
|a5-b5|=0.031>2e=0.02, bo‘lgani uchun yechim [-0.125, -0.1095] oraliqda, f(-0.1095)=-0.00872<0
t6= (-0.125- 0.1095)/2= -0.11725
bundan f(-0.11725)=0.0623, yechim [-0.1173, -0.1095] oraliqda bo‘ladi, bu yerda
|-0.1095 – (-0.1173)| = | 0.1173 – 0.1095| = 0.008<2e=0,02
bo‘lgani uchun taqribiy ildiz
bo‘ladi.
Quyida ex-10x-2=0 tenglamani kesmani teng ikkiga bo’lish usuli bilan yechishning blok-sxemasi va Delphi dasturlash tilida yozilgan dasturi keltirilgan:
1.1-rasm. ex-10x-2=0 tenglamani kesmani teng ikkiga bo’lish usuli bilan yechishning blok-sxemasi.
ex-10x-2=0 tenglamani kesmani teng ikkiga bo’lish usuli bilan yechishning Delphi dasturlash tilida tuzilgan dasturi:
unit kesmau;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Button1: TButton;
Edit2: TEdit;
Edit3: TEdit;
Edit1: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var a,b,x,f,f1,f2,E:real;
var i:integer;
label 1,2;
begin
a:=strtofloat(Edit1.Text);
b:=strtofloat(Edit2.Text);
E:=strtofloat(Edit3.Text);
i:=0;
1:
i:=i+1;
x:=(a+b)/2;
f:=Exp(x)-10*x-2;
if F=0 then goto 2
else begin
f1:=Exp(a)-10*a-2;
f2:=Exp(b)-10*b-2;
if (ABS(f2-f1)<2*E) then
begin
x:=(a+b)/2;
goto 2
end
else
begin
if (f*f1>0) then a:=x
else b:=x;
goto 1;
end;
end;
2:
edit4.Text:='Yechim topildi';
edit5.Text:=inttostr(i);
edit6.Text:=floattostr(x);
end;
end.
1.2-rasm. ex-10x-2=0 tenglamasini kesmani teng ikkiga bo’lish usuli bilan yechish dasturi oynasining ko’rinishi.
MUSTAQIL ISHLAR UCHUN TOPSHIRIQLAR
Quyidagi tenglamalar:
1. Ildizlarning qisqa atrofini EHM yordamida aniqlang;
2. Aniqlangan oraliqda ildizni ikkiga bo‘lish usuli bilan E=0.0001 aniqlikda taqribiy 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 |
O‘z-o‘zini tekshirish uchun savollar
1. Yechim yotgan Kesmani aniqlash.
2. Boshlang‘ich shartni tanlash usulini tushuntiring.
3. Iteratsiya usulining yaqinlashish shartini ayting.
4. Iteratsiya usulida boshlang‘ich shartni tanlash usulini tushuntiring.
5. Kesmani ikkiga bo‘lish usuli va uning yaqinlashish shartini ayting.
6. Tenglamalarni taqribiy hisoblashda ketma-ket yaqinlashish (iteratsiya) shartlari.
7. Iteratsiya usulini qo‘llashda x=j(x) tenglamadagi j(x) uchun qo‘yilgan shartlar.
8. Iteratsiya usulini qo‘llashda x=j(x) tenglamadagi j‘(x) uchun qo‘yilgan shartlar.
9. Ketma-ket yaqinlashish (iteratsiya) usulida boshlang‘ich yaqinlashish qiymatini tanlash qoidasi.
10. Kesmani ikkiga bo‘lish usuli va uni qo‘llash haqidagi shartlar.