14.11.2013, 17:39
|
Прохожий
|
|
Регистрация: 14.11.2013
Сообщения: 1
Версия Delphi: Delphi 7
Репутация: 10
|
|
функция
Народ, хелпаните плиз!
1)пытаюсь создать функцию Q(t) и выдаёт ошибку.
там цель чтобы рассчитало время когда величина первого уравнения станет равной величине второго(z=u).
2)и ещё вопросик. Как в делфи считать dp/dt? ( я из пока обозначил как константы).
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, TeEngine, Series, ExtCtrls, TeeProcs, Chart,Math;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label1: TLabel;
Label3: TLabel;
Button1: TButton;
Label4: TLabel;
Label5: TLabel;
Edit4: TEdit;
Label6: TLabel;
Graphic: TChart;
Series1: TLineSeries;
Series2: TLineSeries;
Memo1: TMemo;
Edit5: TEdit;
Label2: TLabel;
Label7: TLabel;
Button2: TButton;
Edit6: TEdit;
Edit7: TEdit;
Label8: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
function Q(t: real): real;
public
{ Public declarations }
end;
const Ro2=260;
const Rco2=189;
const Temp=293;
const dPo2=20;
const dt=10;
var
Form1: TForm1;
v:real;
P,Po2,Pco2:real;
Mo2,Mco2:real;
Kd:real;
Proc:real;
u,z,dPco2:real;
Q0:real;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
v:= StrToFloat(Edit1.Text);
P:= StrToFloat(Edit3.Text);
Proc:= StrToFloat(Edit2.Text);
Kd:= StrToFloat(Edit5.Text);
Q0:= StrToFloat(Edit6.Text);
Mo2:=(0.87-0.2*Kd)*exp(-4*ln(10));
Mco2:=(1.2-0.275*Kd)*Kd*exp(-4*ln(10));
Po2:=Proc*P/100 ;
Pco2:=(100-Proc)*P/100;
Z:=-Mo2*Q;
Z:=(v/(Ro2*Temp)*(dPo2/dt)) ;
u:=Mco2*Q;
u:=(v/(Rco2*Temp)*(dPco2/dt)) ;
Edit7.Text:=FloatToStr(Pco2);
end;
end.
|