Professional Documents
Culture Documents
Diseño de Un Circuito Electrico
Diseño de Un Circuito Electrico
DISEÑO DE UN
CIRCUITO
ELECTRICO
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
Dialogs, StdCtrls, math;
type
TForm1 = class(TForm)
GroupBox1: TGroupBox;
biseccion: TButton;
Edit1: TEdit;
Label1: TLabel;
Edit2: TEdit;
Label2: TLabel;
resultado1: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
GroupBox2: TGroupBox;
Label6: TLabel;
Button1: TButton;
x0: TEdit;
Label7: TLabel;
x1: TEdit;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
procedure biseccionClick(Sender: TObject);
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
procedure Edit2KeyPress(Sender: TObject; var Key: Char);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
End;
REPEAT
label3.caption:='numero de iteracion ';
xr:=XR_FP(xl,xu);
aux:=f(xl)* f(xu) ;
ea:=abs(((xr-xr_ant)/xr)*100);
xr_ant:=xr;
it:=it+1;
UNTIL (ea<0.0001);
resultado1.Caption:='Raíz= '+floattostr(xr);
label4.Caption:='Error: '+ floattostr(ea);
label3.Caption:='Iteración: '+inttostr(it);
end;
begin
xi:= strtofloat(x0.Text);
xii:= strtofloat(x1.Text);
fi:=f(xi);
fii:=f(xii);
aux:=xii;
xii:=x11(xii,xi);
xi:=aux;
iter:=1;
while error(xii,xi)*(-1)>=0.0001 do
begin
aux:=xii;
xii:=x11(xii,xi);
xi:=aux;
iter:=iter+1;
end;
label8.Caption:='Raíz= '+floattostr(xii);
label9.Caption:='Iteración: '+inttostr(iter);
label10.Caption:='Error: ' + floattostr(redondear((error(xii,xi)*(-
1)),9));
end;
end.