Delphi - sistema de ecuaciones

 
Vista:

sistema de ecuaciones

Publicado por jovanna (4 intervenciones) el 09/11/2008 03:37:45
hola quisiera que me ayuden a resolver un sistema de ecuaciones lineales ya q soy nueva con delphi y se me hace un poco dificil cualquier ayuda me serviria de mucho gracias .

el problema dice asi :
crear un programa en lenguaje delphi que permita resolver el siguiente sistema de ecuaciones

a11x1 + a12x2 + a13x3+........+ a1nxn = b1

a21x1 + a22x2 + a23x3+........+ a2nxn = b2

a31x1 + a32x2 + a33x3+........+ a3nxn = b3
...........................................................................
...........................................................................
............................................................................
am1x1+ am2x2 + am3x3+ ..... + amnxn =bm
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil
Val: 65
Oro
Ha mantenido su posición en Delphi (en relación al último mes)
Gráfica de Delphi

RE:sistema de ecuaciones

Publicado por E.T. (1244 intervenciones) el 10/11/2008 17:38:34
Haber, el valor de "a" para toda la matriz es el mismo, o a cada "a" le corresponde un valor único?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:sistema de ecuaciones

Publicado por JOVANNA (4 intervenciones) el 11/11/2008 20:09:27
el valor de 'a ' es unico haber si me puedes ayudar con este problema gracias
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil
Val: 65
Oro
Ha mantenido su posición en Delphi (en relación al último mes)
Gráfica de Delphi

RE:sistema de ecuaciones

Publicado por E.T. (1244 intervenciones) el 11/11/2008 23:56:25
Bien, haber si es esto lo que buscas:

Inserta un Edit, y dos botones, lo más arriba del form que puedas, de forma horizontal (uno a la derecha del otro), luego en uno de los botones agrega esto:

declara estas variables
var i,j,x,y:integer;

luego este codigo, en su evento onClick (con este codigo se crea la estructura de la matriz)

for i:=1 to StrToInt(Edit1.Text) do begin
x:=16;
for j:=1 to StrToInt(Edit1.Text) do begin
if TLabel(FindComponent('Label'+inttostr(i)+inttostr(j)+inttostr(j)))<> nil then
TLabel(FindComponent('Label'+inttostr(i)+inttostr(j)+inttostr(j))).Destroy;

if TEdit(FindComponent('Ed'+inttostr(i)+inttostr(j)+inttostr(j)))<> nil then
TEdit(FindComponent('Ed'+inttostr(i)+inttostr(j)+inttostr(j))).Destroy;
end;
if TLabel(FindComponent('LbI'+inttostr(i)))<> nil then
TLabel(FindComponent('LbI'+inttostr(i))).Destroy;
if TLabel(FindComponent('LbI'+inttostr(i)))<>nil then
TLabel(FindComponent('LbI'+inttostr(i))).Destroy;
if TEdit(FindComponent('EdI'+inttostr(i)))<>nil then
TEdit(FindComponent('EdI'+inttostr(i))).Destroy;
end;

y:=72;
for i:=1 to StrToInt(Edit1.Text) do begin
x:=16;
for j:=1 to StrToInt(Edit1.Text) do begin
TLabel.Create(self).Name:='Label'+inttostr(i)+inttostr(j)+inttostr(j);
with TLabel(FindComponent('Label'+inttostr(i)+inttostr(j)+inttostr(j)))do begin
if j>1 then
Caption:='+ a'+inttostr(i)+inttostr(j)
else
Caption:='a'+inttostr(i)+inttostr(j);
Parent:=Form1;
Left := x;
Top:= y;
end;
TEdit.Create(self).Name:='Ed'+inttostr(i)+inttostr(j)+inttostr(j);
with TEdit(FindComponent('Ed'+inttostr(i)+inttostr(j)+inttostr(j)))do begin
text:='1';
width:=41;
Parent:=Form1;
Left := x+32;
Top:= y-8;
end;
x:=x+80;
end;
TLabel.Create(self).Name:='LbI'+inttostr(i);
with TLabel(FindComponent('LbI'+inttostr(i)))do begin
Caption:=' = b'+inttostr(i);
Parent:=Form1;
Left := x;
Top:= y;
end;
TEdit.Create(self).Name:='EdI'+inttostr(i);
with TEdit(FindComponent('EdI'+inttostr(i)))do begin
text:='';
width:=41;
Parent:=Form1;
Left := x+30;
Top:= y-8;
end;
y:=y+32;
end

Luego en el otro botón, declara estas variables:
var i,j:integer;
suma:real;

Y pon este codigo, en su evento onClick

for i:=1 to StrToInt(Edit1.Text) do begin
suma:=0;
for j:=1 to StrToInt(Edit1.Text) do begin
with TEdit(FindComponent('Ed'+inttostr(i)+inttostr(j)+inttostr(j)))do begin
suma:=suma+(StrToFloat(Text)*j);
end;
TEdit(FindComponent('EdI'+inttostr(i))).Text:=FloatToStr(suma);
end;
end;

Al darle click en el primer botón, se te muestran una serie de edits, para que pongas los valores de a, cara casa miembro de la matriz, luego al darle click al segundo botón se empieza con las operaciones, en el primer edit, el que insertas al inicio se pone el valor para darle tamaño a la matriz, puedes poner cualquier numero, teniendo en cuenta que mientras sea más grande, más tardado será el proceso
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

ejercicio

Publicado por JESUS CONTRERAS  (1 intervención) el 14/07/2009 16:51:18
se tiene dos valores enteros numero 1 y numero ,2 los cuales se encuentran en 2 edit respectivamente se debe calcular el producto de dichos numeros mostrandolo en un edit solo el valor numerico obtenido.
en una etiqueta debe mostrar un mensaje que diga EL PRODUCTO DEL NUMERO 1 * EL NUMERO 2 ES.
UTILIZAR ESTRUCTURA FOR, STRTOINT Y INTTOSTR.
POR FAVOR AYUNDENME NO TENGO IDEA DE COMO HACERLO?????
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar