Love What You Do, Do What You Love

Program Mencari Akar Hampiran dengan Metode Iterasi Titik Tetap Menggunakan Delphi 7

Posted by : Unknown
Selasa, 26 November 2013 0 comments

Pseudo Code:

var
x0,x1,e,p,q:real;
i,n:integer;
begin
  x0:=strtofloat(edit1.Text);
  e:=0.0001;
  i:=0;
  n:=strtoint(edit2.Text);
  repeat
    i:=i+1;
    listbox1.Items.add(inttostr(i));
    listbox2.Items.add(floattostr(x0));
    x1:=sqrt(cos(x0));
    listbox3.Items.add(floattostr(x1));
    p:=(x1-x0)/x1;
    q:=abs(p);
    listbox4.Items.add(floattostr(q));
    x0:=x1;
  until
    q<e;
  edit3.Text:=floattostr(x1);
end;

end.

Program Mencari Akar Hampiran dengan Metode Secant Menggunakan Delphi 7

Posted by : Unknown
0 comments

Pseudo Code:

var
  x0,x1,x2,y0,y1,y2,e,d,m,j:real;
  i,n:integer;
begin
  x0:=strtofloat(edit1.text);
  x1:=strtofloat(edit2.Text);
  e:=0.000001;
  d:=0.000001;
  i:=0;
  n:=strtoint(edit3.Text);
repeat
  i:=i+1;
  listbox1.Items.Add(inttostr(i));
  listbox2.Items.add(format('%8.4f',[x0]));
  listbox3.items.Add(format('%8.4f',[x1]));
  y0:=(cos(x0)-(x0*x0));
  y1:=(cos(x1)-(x1*x1));
  listbox5.Items.add(format('%8.4f',[y0]));
  listbox6.Items.add(format('%8.4f',[y1]));
  j:=abs(y1-y0);
  if j<d then showmessage ('terlalukecil');
  x2:=((x0*y1)-(x1*y0))/(y1-y0);
  listbox4.Items.add(format('%8.4f',[x2]));
  y2:=(cos(x2)-(x2*x2));
  m:=abs(y2);
  listbox7.Items.add(format('%8.6f',[y2]));
  x0:=x1;
  x1:=x2;
  if i=n then m:=e;
until
  m<e;
  edit4.Text:=format('%8.4f',[x2]);
end;
end.

Program Mencari Akar Hampiran dengan Metode Posisi Palsu Menggunakan Delphi 7

Posted by : Unknown
1 comments

Pseudo Code:

var
a,b,e,x, c, fa, fb, fc : real;
i:integer;

begin
  a:= strtofloat (edit1.text);
  b:= strtofloat (edit2.Text);

  fa := cos(a) - (a*a);
  fb := cos(b) - (b*b);
    if fa*fb > 0 then  label1.Caption:='selang a dan b tidak memuat akar'
    else
    begin
    x:= strtofloat(edit3.Text);
    i:=-1;
    repeat
    i:= i+1;
    c:= (b- (((fb*b)-(fb*a))/(fb-fa)));
    listbox1.Items.add(floattostr(a));
    listbox2.Items.add(floattostr(b));
    listbox3.Items.add(floattostr(c));
    fa := cos(a) - (a*a);
    fb := cos(b) - (b*b);
    fc := cos(c) - (c*c);
    listbox4.Items.add(floattostr(fa));
    listbox5.Items.add(floattostr(fb));
    listbox6.Items.add(floattostr(fc));
    if fa*fc <= 0 then b:= c else a:=c;
    e:= abs ((b-a)/b);
    until e<= x;
    edit4.text:= floattostr(c);
    edit5.Text:= floattostr(i);
    end;
    end;

end.

Program Mencari Akar Hampiran dengan Metode Newton Raphson Menggunakan Delphi 7

Posted by : Unknown
0 comments

Pseudo Code:

var
  x0,x1,y0,y1,d,e,m:Real;
  i,n:integer;
begin
  x0:=StrToFloat(edit1.text);
  e:=0.000001 ;
  d:=0.000001 ;
  n:=strtoint(edit2.text);
  i:=0;
repeat
  i:=i+1;
  listbox1.Items.add(inttostr(i));
  listbox2.Items.add(format('%8.4f',[x0]));
  y0:=(cos(x0)-(x0*x0));
  y1:=(-(sin(x0))-2*x0);
  listbox4.Items.add(format('%8.4f',[y0]));
  listbox5.Items.add(format('%8.4f',[y1]));
  if (abs(y1))<d then showmessage('kemiringan terlalu kecil');
  x1:=(x0)-(y0/y1);
  listbox3.Items.add(format('%8.4f',[x1]));
  m:=abs((x1-x0)/x1);
  listbox6.Items.add(format('%8.4f',[m]));
  if m>e then x0:=x1;
until
  i=n;
  edit4.Text:=format('%8.4f',[x1]);
end;

end.

Program Mencari Akar Hampiran dengan Metode Bagi Dua Menggunakan Delphi 7

Posted by : Unknown
0 comments

Pseudo Code:

r
a,b,e,x, c, fa, fb, fc : real;
i:integer;

begin
  a:= strtofloat (edit1.text);
  b:= strtofloat (edit2.Text);

  fa := cos(a) - (a*a);
  fb := cos(b) - (b*b);
    if fa*fb > 0 then  label1.Caption:='selang a dan b tidak memuat akar'
    else
    begin
    x:= strtofloat(edit3.Text);
    i:=-1;
    repeat
    i:= i+1;
    c:=(a+b)/2;
    listbox1.Items.add(floattostr(a));
    listbox2.Items.add(floattostr(b));
    listbox3.Items.add(floattostr(c));
    fa := cos(a) - (a*a);
    fb := cos(b) - (b*b);
    fc := cos(c) - (c*c);
    listbox4.Items.add(floattostr(fa));
    listbox5.Items.add(floattostr(fb));
    listbox6.Items.add(floattostr(fc));
    if fa*fc <= 0 then b:= c else a:=c;
    e:= abs ((b-a)/b);
    until e<= x;
    edit4.text:= floattostr(c);
    edit5.Text:= floattostr(i);
    end;
    end;

end.

Copyright © 2012 Zuka Zuka World | Hatsune Miku Theme | Designed by Johanes DJ