home *** CD-ROM | disk | FTP | other *** search
- program Listing4-2;
-
- uses Graph, Crt, PlotData;
-
- var
- Plot1 : Plot;
- LB, RB, TB, BB : integer;
- GraphDriver, GraphMode : integer;
- i : integer;
- tmp : real;
-
- begin
-
- GraphDriver := Detect;
- InitGraph( GraphDriver, GraphMode, '' );
- Graph.SetColor( white );
-
- { border of 50 }
- LB := 50;
- RB := GetMaxX - LB;
- TB := 50;
- BB := GetMaxY - TB;
-
- Plot1.Init( 0, 90, 1, 0, 11, 1000, LB, RB, TB, BB, 1, 1, 1, 1,
- 'Pump Performance Curve',
- 'Flow, gpm (x 1000)', 'Pressure, psi' , false);
- Plot1.DrawVGridLine( 9000 );
- Plot1.DrawVGridLine( 4000 );
- Plot1.DrawHGridLine( 75 );
- Plot1.DrawHGridLine( 60 );
- Plot1.PlaceXAxisValue( 9000 );
- Plot1.PlaceXAxisvalue( 4000 );
- Plot1.PlaceYAxisValue( 60 );
- Plot1.PlaceYAxisValue( 75 );
- { done! setting up graph }
- for i := 0 to 70 do
- begin
- { plot
- pressure = MaxPressure - K * Flow ^2
- where
- MaxPressure = 78.7
- K = 2.3 e -7
- }
- tmp := 3000+(100*i);
- Plot1.AddPoint( tmp, 78.7-(tmp*tmp*2.3e-7) );
- end;
-
- repeat until KeyPressed;
-
- RestoreCRTMode;
- end.
-
-