Uses CORE;

var
 Model  : ^CModel;
 Buffer : PBuffer;
 Device : PDevice;
 Srcs1,Srcs2,Srcs3   : PSource;
 i :  longint;

 BegVal,
 LastVal : Real;
 Steps   : integer;

 BufferSize : integer;
 S1,S2,S3 : Real;

 Delta, DovInt : real;

begin
 Randomize;
Assign(output,'1.out');
Rewrite(output);
 Delta := 0.1;
 DovInt := 1.64;

 BegVal := 1.0;
 LastVal := 4.0;

 Steps := 20;

 BufferSize := 5;
 S1 := 2.0;
 S2 := 1.0;
 S3 := 5.0;

 New(Buffer, Init(BufferSize));
 New(Device, Init(BegVal));
 New(Model, Init(3,Device,Buffer,Delta,DovInt));

 New(Srcs1,Init(0,S1));
 Model^.AddNewSource(Srcs1);
 New(Srcs2,Init(1,S2));
 Model^.AddNewSource(Srcs2);
 New(Srcs3,Init(2,S3));
 Model^.AddNewSource(Srcs3);

{ for i := 0 to Steps do
  begin
   Device^.Lambda := BegVal + (LAstVal-BegVal)/Steps*i;}
   Model^.Start;
   while Model^.Step do if Model^.Curstep mod 1000 = 6 then
    begin
     WriteLn('˜ £ - ',Model^.Curstep,' : P®âª2 = ',100*Srcs2^.RefusedReq/Srcs2^.TotalReq:0:2);
    end;
{   Model^.PrintValues;
  end;}

 Close(OutPut);
 Dispose(Model,Done);
 Dispose(Buffer,Done);
 Dispose(Device,Done);
end.