How do you build a schedule for the formula?



  • There is a formula:

    Формула1

    R is the rate of population reproduction in the absence of intra- intra-species competition (materially a = 0).

    The equation then defines simply a change in the by-law population of geometric progress:

    введите сюда описание изображения

    where N0 is the initial population.

    A = 5, b = 8, N0 = 200, depending on the R parameter in the range 1 ≤ R ≤ 5

    So far there's a code like this:

    procedure TForm2.Button1Click(Sender: TObject);
    const
      a = 5;
      b = 8;
      R = 2;
    var
      x0,y0: Integer;
      x,y: Real;
    begin
      // находим центр
      x0 := Image1.Width div 2;
      y0 := Image1.Height div 2;
      // рисуем оси
      Image1.Canvas.Pen.Color := clGreen;
      Image1.Canvas.Pen.Width := 2;
      Image1.Canvas.MoveTo(x0, 0);
      Image1.Canvas.LineTo(x0, ClientHeight);
      Image1.Canvas.MoveTo(0, y0);
      Image1.Canvas.LineTo(ClientWidth, y0);
    

    // рисуем график
    Image1.Canvas.Pen.Color := clRed;
    Image1.Canvas.Pen.Width := 3;

    // ... что делать здесь?

    end;

    I don't know. If you can tell me. TChartit'll be fine.



  • Establish a function that adopts input sets and returns the result as a set of values to be inserted TChart

    Upd:

    To calculate the values, the formula will look like:

    If we use a data storage unit, then we can record it. SetLength(...)and the count itself:

    for i:= 0 to t-1 do
      N[t+1] := (N[t]*R)/(1+ Power((a*N[t]),b));
    

    /... what do we do here?

    We need to go through the N array and draw a schedule, like:

    Image1.Canvas.MoveTo(0, 0);
    for i:=0 to Length(N)-1 do
      Image1.Canvas.LineTo(i, N[i]);
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2