Source Code Metode Bisection
Posted on April 27th, 2007 in Programming, 440 views
Berikut ini merupakan source code metode bisection yang saya buat menggunakan delphi.
label bawah;
var
fxb,xa,xb,xrlama,error,xr,fxr,fxa,cek,xrbaru,galat: real;
i:integer;
begin
edit3.clear;
xa:=strtofloat(edit1.Text);
xb:=strtofloat(edit2.Text);
fxa:=(xa*xa)-70;
fxb:=(xb*xb)-70;
if (fxa<=0) and (fxb<=0) then
begin
application.MessageBox(’Jika nilai f(Xa) positif maka nilai f(Xb) harus bernilai negatif, Masukkan lagi nilai Xa dan Xb yang lain…’,'Warning’,MB_OK or MB_ICONEXCLAMATION);
goto bawah;
end
else if (fxa>=0) and (fxb>=0) then
begin
application.MessageBox(’Jika nilai f(Xa) positif maka nilai f(Xb) harus bernilai negatif, Masukkan lagi nilai Xa dan Xb yang lain…’,'Warning’,MB_OK or MB_ICONEXCLAMATION);
goto bawah;
end;
i:=1;
xrlama:=0;
error:=0.01;
repeat
xr:=(xa+xb)/2;
fxr:=(xr*xr)-70;
fxa:=(xa*xa)-70;
cek:=fxr*fxa;
if cek<0 then
begin
xa:=xa;
xb:=xr;
end
else
begin
xa:=xr;
xb:=xb;
end;
xrbaru:=xr;
galat:=abs((xrbaru-xrlama)/xrbaru);
memo1.Lines.add(inttostr(i)+chr(vk_tab)+floattostr(galat)+chr(vk_tab)+
floattostr(xr));
xrlama:=xr;
i:=i+1;
until (galat<=error);
edit3.Text:=floattostr(xr);
bawah:
end;
Related Posts :
- Source Code Metode False Position
- Source Code Metode Gauss Sedel
- Source Code Metode Simpson
- Source Code Metode Trapesium
- Source Code Metode Newton Cotes Open Formula
- Source Code Metode Newton Cotes Close Formula
- Source Code Newton Raphson
- Source Code Metode Secant
- Source Code Metode Interpolasi Newton
- Source Code Metode Jacobi




Mas mo nanya skrip fxa:=(xa*xa)-70;
fxb:=(xb*xb)-70; itu persamaan yang akan dicari ya?
iya anda benar