ETHZ_Logo RAMSES_Logo_Right    RAMSES    RAMSES_Logo_Left Systems Ecology   

Example: Worldmodel 2




MODULE Worldmodel 2;

  (*******************************************************)
  (* WorldModel2 by Forrester J.W. 1973 "World dynamics" *)
  (*******************************************************
                                                 
  Last changes: 
        tb      29.09.88    First implementation by Martina (Tina) 
                            Blanke
        tn      29.10.91    Version 0.3
                            updated to new version of TabFunc
                            with new support for ExtrapolModes
        dg      27.10.92    SimInit and ModelDefinitions 
                            changed for correct start-up
        af      14/03/96    Since the sources for V 0.5 got
                            lost, this is an attempt to construct
                            a new version using the newest RAMSES
                            software.
                            In contrast to version 0.4 German, this
                            version does switch in the year 1970
                            and therefore does fully conform to
                            what is described in the "Systems Ecology
                            Report #1"
        af      10/04/97    Adaptations to run it on the IBM PC
                            under Windows
        af      21/04/97    V 0.7 (port back from IBM PC)
        af      22/03/99    V 1.0 
                            - New TabFunc use with DefineDefltTabFuncEditWinPos
                            - Imports RunsOnAMac from DMSystem
  
  *******************************************************) 

  FROM DMSystem IMPORT ScreenWidth, ScreenHeight, MenuBarHeight, 
    TitleBarHeight, ScrollBarWidth, RunsOnAMac;
  FROM DMConversions IMPORT IntToString;
  FROM DMStrings IMPORT FindInString, LoadString, StoreString, Append;
  FROM DMWindows IMPORT WindowFrame, RectArea, 
    InnerWindowFrame, OuterWindowFrame, WindowKind, ScrollBars;
  FROM DMMenus IMPORT InstallAbout;  
  FROM DMWindIO IMPORT SetPos, WriteString,
    SetWindowFont, WindowFont, FontStyles, FontStyle;
  IMPORT DMWindIO; (* for local module AboutAux *)
  IMPORT DMMaster; (* for proper linking *)
  
  FROM DMKeyChars IMPORT ProgrammedOn, ComputerPlatform, BestCH;
  
  FROM SimBase IMPORT 
    Model, IntegrationMethod, DeclM, DeclSV, DeclP, RTCType, 
    StashFiling, Tabulation, Graphing, DeclMV, SetSimTime, 
    NoInitialize, NoInput, NoOutput, NoTerminate, NoAbout, 
    StateVar, Derivative, Parameter, AuxVar,
    SetMonInterval, StackWindows, 
    SetIntegrationStep, DisableWindow, CloseWindow, 
    SetDefltCurveAttrForMV, Stain, LineStyle, MWWindow, 
    SetDefltWindowArrangement, MWWindowArrangement, SetWindowPlace, 
    SetDefltIndepVarIdent, EnableWindow, GetWindowPlace,
    IOWColsDisplay, GetIOWColDisplay, SetIOWColDisplay, SetDefltIOWColDisplay;
  FROM SimMaster IMPORT 
    RunSimEnvironment, InstallDefSimEnv, CurrentTime;
  
  FROM WM2Tables IMPORT DeclareTables,
    BRCMT, BRFMT, BRMMT, BRPMT, 
    CFIFRT, CIMT, CIQRT,
    DRCMT, DRFMT, DRMMT, DRPMT, 
    FCMT, FPCIT, FPMT, 
    NREMT, NRMMT, 
    POLATT, POLCMT, 
    QLCT, QLFT, QLMT, QLPT;
    
  FROM TabFunc IMPORT Yi, Yie;
  
  IMPORT DMWindows; (* for local module AboutAux *)


  VAR 
    m: Model;
    
    (* state variables *)
    P: StateVar; PDot: Derivative;
    POL: StateVar; POLDot: Derivative;
    NR: StateVar; NRDot: Derivative;
    CI: StateVar; CIDot: Derivative;
    CIAF: StateVar; CIAFDot: Derivative;
    
    (* parameters *)
    BRN, BRN1, CIAFN, CIAFT, CIDN, CIDN1, CIGN, CIGN1, DRN, DRN1, ECIRN, 
    FC, FC1, FN, LA, NRI, NRUN, NRUN1, PDN, POLN, POLN1, POLS, QLS: Parameter; 
    (* switch years*)
    BRNSwitchYear, CIDNSwitchYear, CIGNSwitchYear, DRNSwitchYear, 
    FCSwitchYear, NRUNSwitchYear, POLNSwitchYear: Parameter;

    (* aux variables *)
    BR, BRCM, BRFM, BRMM, BRPM, CFIFR, CID, CIG, CIM, CIQR, 
    CIR, CIRA, CR, DR, DRCM, DRFM, DRMM, DRPM, ECIR, FCM, 
    FPCI, FPM, FR, MSL, NREM, NRFR, NRMM, NRUR, POLA, POLAT, 
    POLCM, POLG, POLR, QL, QLC, QLF,QLM, QLP: AuxVar;      
    
    
  MODULE AboutAux; (* *************************************************** *)
    
    FROM DMWindIO IMPORT SetPos, StringArea, GetPen, SetPen, WriteString;
    FROM DMWindows IMPORT RectArea;
    
    EXPORT aboutWidth, aboutHeigth,
      SetCenterWidth, SetCenterLine,
      WriteCenteredLn;
  
    VAR
      aboutWidth, aboutHeigth,
      centerWidth, centerLine, leftMar: INTEGER;
    
    PROCEDURE SetCenterWidth (w: INTEGER);
    BEGIN
      centerWidth := w;
    END SetCenterWidth;
    
    PROCEDURE SetLeftMargin (lm: CARDINAL);
    BEGIN
      leftMar := lm;
    END SetLeftMargin;
    
    PROCEDURE SetCenterLine  (l: CARDINAL);
    BEGIN
      centerLine := l; SetPos(l,leftMar);
    END SetCenterLine;

    PROCEDURE WriteCenteredLn (s: ARRAY OF CHAR);
      VAR a: RectArea; bl,ss,xx,yy: INTEGER;
    BEGIN
      SetPos(centerLine,leftMar);
      StringArea(s,a,bl,ss);
      GetPen(xx,yy); SetPen((centerWidth-a.w) DIV 2,yy);
      WriteString(s);
      INC(centerLine); SetPos(centerLine,leftMar);
    END WriteCenteredLn;
      
  BEGIN (* AboutAux *)
    aboutWidth := 150;
    aboutHeigth := 100;
    SetCenterWidth (aboutWidth);
    SetLeftMargin  (2);
    SetCenterLine  (2);
  END AboutAux;    (* *************************************************** *)

  
  PROCEDURE AboutP;
  BEGIN
    SetCenterLine(1);
    WriteCenteredLn("");
    SetWindowFont(Chicago,18,FontStyle{});
    WriteCenteredLn("World Model 2");
    SetWindowFont(Chicago,12,FontStyle{underline});
    WriteCenteredLn("");
    WriteCenteredLn("                                                                ");
    SetWindowFont(Geneva,10,FontStyle{});
    WriteCenteredLn("");
    WriteCenteredLn("");
    WriteCenteredLn("A teaching program by");
    SetWindowFont(Geneva,10,FontStyle{bold});
    WriteCenteredLn("A. Fischlin, M. Blanke, D. Gyalistras,");
    WriteCenteredLn("T. Nemecek, M. Baltensweiler & M. Ulrich");
    SetWindowFont(Geneva,10,FontStyle{});
    WriteCenteredLn("");
    WriteCenteredLn("based on");
    SetWindowFont(Geneva,10,FontStyle{bold});
    WriteCenteredLn('Forrester, J.W. (1971) "World Dynamics"');
    SetWindowFont(Geneva,10,FontStyle{});
    WriteCenteredLn("");
    WriteCenteredLn("Version 1.0 March 1999");
  END AboutP;  


  PROCEDURE Dynamic;
  BEGIN
    NRFR:= NR / NRI;                                        (*  7 *)
    CIR:= CI / P;                                           (* 23 *)
    NREM:= Yi(NREMT, NRFR);                                 (*  6 *)
    CR:= P / LA / PDN;                                      (* 15 *)
    CIRA:= CIR * CIAF / CIAFN;                              (* 22 *) 
    POLR:= POL / POLS;                                      (* 29 *)
    ECIR:= CIR * (1.0-CIAF) * NREM / (1.0-CIAFN);           (*  5 *)
    FCM:= Yi(FCMT, CR);                                     (* 20 *) 
    FPCI:= Yie(FPCIT, CIRA);                                (* 21 *)
    FPM:= Yi(FPMT, POLR);                                   (* 28 *)
    MSL:= ECIR / ECIRN;                                     (*  4 *)
      IF CurrentTime() < FCSwitchYear                       (* 19 *)
      THEN FR:= FPCI * FCM * FPM * FC / FN
      ELSE FR:= FPCI * FCM * FPM * FC1 / FN
      END;                                                  
    DRMM:= Yie(DRMMT, MSL);                                 (* 11 *)
    DRPM:= Yi(DRPMT, POLR);                                 (* 12 *)
    DRFM:= Yie(DRFMT, FR);                                  (* 13 *)
    DRCM:= Yi(DRCMT, CR);                                   (* 14 *)
    BRMM:= Yie(BRMMT, MSL);                                 (*  3 *)
    BRCM:= Yi(BRCMT, CR);                                   (* 16 *)
    BRFM:= Yie(BRFMT, FR);                                  (* 17 *)
    BRPM:= Yi(BRPMT, POLR);                                 (* 18 *)
      IF CurrentTime() < BRNSwitchYear                      (*  2 *)
      THEN BR:= P * BRN * BRMM * BRCM * BRFM * BRPM               
      ELSE BR:= P * BRN1 * BRMM * BRCM * BRFM * BRPM
      END;
      IF CurrentTime() < DRNSwitchYear                      (* 10 *)
      THEN DR:= P * DRN * DRMM * DRPM * DRFM * DRCM
      ELSE DR:= P * DRN1 * DRMM * DRPM * DRFM * DRCM
      END;               
    PDot:= BR - DR;                                         (*  1 *)

    NRMM:= Yie(NRMMT, MSL);                                 (* 42 *)
      IF CurrentTime() < NRUNSwitchYear                     (*  9 *)
      THEN NRUR:= P * NRUN * NRMM
      ELSE NRUR:= P * NRUN1 * NRMM
      END;                                 
    NRDot:= - NRUR;                                         (*  8 *)

    CIM:= Yie(CIMT, MSL);                                   (* 26 *)
      IF CurrentTime() < CIGNSwitchYear                     (* 25 *)
      THEN CIG:= P * CIM * CIGN
      ELSE CIG:= P * CIM * CIGN1
      END;
      IF CurrentTime() < CIDNSwitchYear                     (* 27 *)
      THEN CID:= CI * CIDN
      ELSE CID:= CI * CIDN1
      END;                                        
    CIDot:= CIG - CID;                                      (* 24 *)

    POLCM:= Yie(POLCMT, CIR);                               (* 32 *)
    POLAT:= Yi(POLATT, POLR);                               (* 34 *)
      IF CurrentTime() < POLNSwitchYear                     (* 31 *)
      THEN POLG:= P * POLN * POLCM
      ELSE  POLG:= P * POLN1 * POLCM
      END;                                
    POLA:= POL / POLAT;                                     (* 33 *)
    POLDot:= POLG - POLA;                                   (* 30 *)

    QLM:= Yie(QLMT, MSL);                                   (* 38 *)
    QLF:= Yie(QLFT, FR);                                    (* 40 *)
    CIQR:= Yie(CIQRT, QLM/QLF);                             (* 43 *)
    CFIFR:= Yie(CFIFRT, FR);                                (* 36 *)
    CIAFDot:= (CFIFR * CIQR - CIAF) / CIAFT;                (* 35 *)
    
    QLC:= Yi(QLCT, CR);                                     (* 39 *)
    QLP:= Yi(QLPT, POLR);                                   (* 41 *)
    QL:= QLS * QLM * QLC * QLF * QLP;                       (* 37 *)

  END Dynamic;

  PROCEDURE Objects;
  BEGIN
    DeclSV(P, PDot, 1.650E+9, 0.0 , 8.0E+9, "Population",
      "P", "people");
    DeclSV(NR, NRDot, 9.0E+11, 0.0 , 1.0E+12, "Natural resources",
      "NR", "Natural resource units");
    DeclSV(CI, CIDot, 4.0E+8, 0.0 , 2.0E+10, "Capital investment",
      "CI", "Capital units");
    DeclSV(POL, POLDot, 2.0E+8, 0.0 , 2.0E+11, "Pollution",
      "POL", "Pollution units");
    DeclSV(CIAF, CIAFDot, 0.2 , 0.0 , 1.0 ,
      "Capital-investment-in-agriculture fraction",
      "CIAF", "dimensionless");
      
    DeclMV(P, 0.0 , 8.0E+9, "(S) Population",
      "P/1", "people", 
       notOnFile, notInTable, isY);
    DeclMV(BR, 0.0, 4.0E+8, "(R) Birth rate",
      "BR/2", "people/year", 
       notOnFile, notInTable, notInGraph);
    DeclMV(BRMM, 0.0, 1.5, "(T) Birth-rate-from-material multipier",
      "BRMM/3", "dimensionless", 
       notOnFile, notInTable, notInGraph); 
    DeclMV(MSL, 0.0, 2.0, "(A) Material standard of living",
      "MSL/4", "dimensionless", 
       notOnFile, notInTable, notInGraph);
    DeclMV(ECIR, 0.0, 2.0, "(A) Effective-capital-investment ratio",
      "ECIR/5", "capital units/person", 
       notOnFile, notInTable, notInGraph); 
    DeclMV(NREM, 0.0, 2.0, "(T) Natural-resource-extraction multiplier",
      "NREM/6", "dimensionless", 
       notOnFile, notInTable, notInGraph); 
    DeclMV(NRFR, 0.0, 2.0, "(A) Natural-resource fraction remaining",
      "NRFR/7", "dimensionless", 
       notOnFile, notInTable, notInGraph); 
    DeclMV(NR, 0.0 , 1.0E+12, "(S) Natural resources",
      "NR/8", "natural resource units", 
       notOnFile, notInTable, isY); 
    DeclMV(NRUR,0.0, 8.0E+9, "(R) Natural-resource-usage rate",
      "NRUR/9", "natural resource units/year",
      notOnFile,notInTable,notInGraph);   
    DeclMV(DR, 0.0, 4.0E+8, "(R) Death rate",
      "DR/10", "people/year", 
       notOnFile, notInTable, notInGraph); 
    DeclMV(DRMM, 0.0, 3.0, "(T) Death-rate-from-material multiplier",
      "DRMM/11", "dimensionless", 
       notOnFile, notInTable, notInGraph); 
    DeclMV(DRPM, 0.0, 25.0, "(T) Death-rate-from-pollution multiplier",
      "DRPM/12", "dimensionless", 
       notOnFile, notInTable, notInGraph); 
    DeclMV(DRFM, 0.0, 30.0, "(T) Death-rate-from-food multiplier",
      "DRFM/13", "dimensionless", 
       notOnFile, notInTable, notInGraph);
    DeclMV(DRCM, 0.0, 9.0, "(T) Death-rate-from-crowding multiplier",
      "DRCM/14", "dimensionless", 
       notOnFile, notInTable, notInGraph); 
    DeclMV(CR, 0.0, 10.0, "(A) Crowding ratio",
      "CR/15", "dimensionless", 
       notOnFile, notInTable, notInGraph); 
    DeclMV(BRCM, 0.0, 1.5, "(T) Birth-rate-from-crowding multiplier",
      "BRCM/16", "dimensionless", 
       notOnFile, notInTable, notInGraph);
    DeclMV(BRFM, 0.0, 2.5 , "(T) Birth-rate-from-food multiplier",
      "BRFM17", "dimensionless", 
       notOnFile, notInTable, notInGraph);
    DeclMV(BRPM, 0.0, 1.5, "(T) Birth-rate-from-pollution multiplier",
      "BRPM/18", "dimensionless", 
       notOnFile, notInTable, notInGraph); 
    DeclMV(FR, 0.0, 2.0, "(A) Food ratio",
      "FR/19", "dimensionless", 
       notOnFile, notInTable, notInGraph); 
    DeclMV(FCM, 0.0, 3.0, "(T) Food-from-crowding multiplier",
      "FCM/20", "dimensionless", 
       notOnFile, notInTable, notInGraph); 
    DeclMV(FPCI, 0.0, 3.2, "(T) Food potential from capital investment",
      "FPCI/21", "food units/person/year", 
       notOnFile, notInTable, notInGraph);
    DeclMV(CIRA, 0.0, 12.0, "(A) Capital-investment ratio in agriculture",
      "CIRA/22", "capital units/person", 
       notOnFile, notInTable, notInGraph);
    DeclMV(CIR, 0.0, 10.0, "(A) Capital-investment ratio",
      "CIR/23", "capital units/person", 
       notOnFile, notInTable, notInGraph);
    DeclMV(CI, 0.0 , 2.0E+10, "(S) Capital investment",
      "CI/24", "capital units", 
       notOnFile, notInTable, isY);
    DeclMV(CIG, 0.0, 4.0E+8, "(R) Capital-investment generation",
      "CIG/25", "capital units/year", 
       notOnFile, notInTable, notInGraph);
    DeclMV(CIM, 0.0, 4.0, "(T) Capital-investment multiplier",
      "CIM/26", "dimensionless", 
       notOnFile, notInTable, notInGraph);
    DeclMV(CID, 0.0, 4.0E+8, "(R) Capital-investment discard",
      "CID/27", "capital units/year", 
       notOnFile, notInTable, notInGraph);
    DeclMV(FPM, 0.0, 1.5, "(T) Food-from-pollution multiplier",
      "FPM/28", "dimensionless", 
       notOnFile, notInTable, notInGraph); 
    DeclMV(POLR, 0.0, 40.0, "(A) Pollution ratio",
      "POLR/29", "dimensionless", 
       notOnFile, notInTable, isY);
    DeclMV(POL, 0.0, 2.0E+11, "(S) Pollution", 
      "POL/30", "pollution units", 
       notOnFile, notInTable, notInGraph);
    DeclMV(POLG, 0.0, 2.0E10, "(R) Pollution generation",
      "POLG/31", "pollution units/year", 
       notOnFile, notInTable, notInGraph);
    DeclMV(POLCM, 0.0, 10.5, "(T) Pollution-from-capital multiplier",
      "POLCM/32", "dimensionless", 
       notOnFile, notInTable, notInGraph);    
    DeclMV(POLA, 0.0, 2.0E10, "(R) Pollution absorption",
      "POLA/33", "pollution units/year", 
       notOnFile, notInTable, notInGraph);    
    DeclMV(POLAT,0.0, 16.0, "(T) Pollution-absorption time",
      "POLAT/34", "years", 
       notOnFile, notInTable, notInGraph);
    DeclMV(CIAF, 0.2, 0.6, "(S) Capital-investment-in-agrigulture fraction",
      "CIAF/35", "dimensionless", 
       notOnFile, notInTable, notInGraph);    
    DeclMV(CFIFR, 0.0, 1.0, "(T) Capital fraction indicated by food ratio",
      "CFIFR/36", "dimensionless", 
       notOnFile, notInTable, notInGraph);    
    DeclMV(QL, 0.0, 2.0, "(A) Quality of Life", 
      "QL/37","satisfaction units", 
       notOnFile, notInTable, isY);
    DeclMV(QLM, 0.0, 4.0, "(T) Quality of life from material",
      "QLM/38", "dimensionless", 
       notOnFile, notInTable, notInGraph);    
    DeclMV(QLC, 0.0, 2.0, "(T) Quality of life from crowding",
      "QLC/39", "dimensionless", 
       notOnFile, notInTable, notInGraph);    
    DeclMV(QLF, 0.0, 4.0, "(T) Quality of life from food",
      "QLF/40", "dimensionless", 
       notOnFile, notInTable, notInGraph);    
    DeclMV(QLP, 0.0, 2.0, "(T) Quality of life from pollution",
      "QLP/41", "dimensionless", 
       notOnFile, notInTable, notInGraph);
    DeclMV(NRMM, 0.0, 4.2, "(T) Natural-resource-from-material multiplier",
      "NRMM/42", "dimensionless", 
       notOnFile, notInTable, notInGraph);
    DeclMV(CIQR, 0.5, 4.0, "(T) Capital-investment-from-quality ratio",
      "CIQR/43", "dimensionless", 
       notOnFile, notInTable, notInGraph);
              
    DeclP(BRN1, 0.04, 0.0, 4.0, rtc, 
      "Birth rate normal No.1",  
      "BRN1", "fraction/year");
    DeclP(CIDN1, 0.025, 0.0, 2.5, rtc, 
      "Capital-investment discard normal No.1",
      "CIDN1", "fraction/year");
    DeclP(CIGN1, 0.05, 0.0, 5.0, rtc, 
      "Capital-investment generation normal No.1",
      "CIGN1", "capital units/person/year");
    DeclP(DRN1, 0.028, 0.0, 2.8, rtc, 
      "Death rate normal No.1",  
      "DRN1", "fraction/year");
    DeclP(FC1, 1.0, 0.0, 100.0, rtc, 
      "Food coefficient No.1",  
      "FC1", "dimensionless");
    DeclP(NRUN1,1.0, 0.0, 100.0, rtc, 
      "Natural-resource usage normal No.1",
      "NRUN1", "natural resource units/person/year");
    DeclP(POLN1, 1.0, 0.0, 100.0, rtc, "Pollution normal No.1",  
      "POLN1", "pollution units/person/year");
            
    DeclP(BRNSwitchYear, 1970.0, 1900.0, 2100.0, rtc, "BRNSwitchYear",  
      "BRNSY", "years");
    DeclP(CIDNSwitchYear, 1970.0, 1900.0, 2100.0, rtc, "CIDNSwitchYear",  
      "CIDNSY", "years");
    DeclP(CIGNSwitchYear, 1970.0, 1900.0, 2100.0, rtc, "CIGNSwitchYear",  
      "CIGNSY", "years");
    DeclP(DRNSwitchYear, 1970.0, 1900.0, 2100.0, rtc, "DRNSwitchYear",  
      "DRNSY", "years");
    DeclP(FCSwitchYear, 1970.0, 1900.0, 2100.0, rtc, "FCSwitchYear",  
      "FCSY", "years");
    DeclP(NRUNSwitchYear, 1970.0, 1900.0, 2100.0, rtc, "NRUNSwitchYear",  
      "NRUNSY", "years");
    DeclP(POLNSwitchYear, 1970.0, 1900.0, 2100.0, rtc, "POLNSwitchYear",  
      "POLNSY", "years");
                                                                                      
    (* DeclP(BRN, 0.04, 0.0, 4.0, noRtc, "Birth rate normal",  
      "BRN", "fraction/year"); *)
      BRN:= 0.04;
    (* DeclP(CIAFN,0.3, 0.0, 30.0, noRtc, 
      "Capital-investment-in-agriculture fraction normal",  
      "CIAFN", "dimensionless"); *)
      CIAFN:= 0.3;
    (* DeclP(CIAFT, 15.0, 0.0, 1500.0, noRtc, 
      "Capital-investment-in-agriculture fraction adjustment time",
      "CIAFT", "years"); *)
      CIAFT:= 15.0;
    (* DeclP(CIDN, 0.025, 0.0, 2.5, noRtc, 
      "Capital-investment discard normal",
      "CIDN", "fraction/year"); *)
      CIDN:= 0.025;
    (* DeclP(CIGN, 0.05, 0.0, 5.0, noRtc, 
      "Capital-investment generation normal",
      "CIGN", "capital units/person/year"); *)
      CIGN:= 0.05;
    (* DeclP(DRN, 0.028, 0.0, 2.8, noRtc, "Death rate normal",  
      "DRN", "fraction/year"); *)
      DRN:= 0.028;    
    (* DeclP(ECIRN, 1.0, 0.0, 100.0, noRtc, 
      "Effective-capital-investment ratio normal",  
      "ECIRN", "capital units/person"); *)
      ECIRN:= 1.0;
    (* DeclP(FC, 1.0, 0.0, 100.0, noRtc, "Food coefficient",  
      "FC", "dimensionless"); *)
      FC:= 1.0;
    (* DeclP(FN,1.0, 0.0, 100.0, noRtc, "Food normal",  
      "FN", "food units/person/year"); *)
      FN:= 1.0;
    (* DeclP(LA, 1.35E+8, 1.35E+6, 1.35E+12, noRtc, "Land area",  
      "LA", "square kilometers"); *)
      LA:= 1.35E+8;
    (* DeclP(NRI, 9.0E+11, 9.0E+9, 9.0E13, noRtc, 
      "Natural resources, initial",
      "NRI", "natural-resource units"); *)
      NRI:= 9.0E+11;
    (* DeclP(NRUN,1.0, 0.0, 100.0, noRtc, 
      "Natural-resource usage normal",
      "NRUN", "natural resource units/person/year"); *)
      NRUN:= 1.0;    
    (* DeclP(PDN, 26.5, 0.0, 2650.0, noRtc, 
      "Population density normal",  
      "PDN", "people/square kilometers"); *)
      PDN:= 26.5;
    (* DeclP(POLN, 1.0, 0.0, 100.0, noRtc, "Pollution normal",  
      "POLN", "pollution units/person/year"); *)
      POLN:= 1.0;
    (* DeclP(POLS, 3.6E+9, 3.6E+7, 3.6E+11, noRtc, 
      "Pollution standard",  
      "POLS", "pollution units"); *)
      POLS:= 3.6E+9;
    (* DeclP(QLS, 1.0, 0.0, 100.0, noRtc, 
      "Quality-of-life standard",  
      "QLS", "satisfaction units"); *)
      QLS:= 1.0;
  END Objects;


  PROCEDURE SimInit;
    VAR height, width, margin, heightPIOW : INTEGER;
      x,y,w,h, x1,y1,w1,h1, x2,y2,w2,h2: INTEGER;
      pAndMVSideBySide, iOWsWideEnough, isOpen: BOOLEAN;
      wd: IOWColsDisplay; wf: WindowFrame; 
    PROCEDURE DefineDefltTabFuncEditWinPos(mwwLow,mmwUp: MWWindow);
      CONST tabFuncDfltEWinID = 7501; (* see TabFunc *) marg = 10;
      VAR winPosStr: ARRAY [0..63] OF CHAR; isOpen, resFound: BOOLEAN; 
        mwf,tfewf: WindowFrame; istr: ARRAY [0..15] OF CHAR; strID: INTEGER;
    BEGIN 
      winPosStr := "";  
      LoadString("",tabFuncDfltEWinID,winPosStr);
      resFound := winPosStr[0]<>0C;
      IF resFound THEN 
        (* resource is actually present => can be modified according to current screen *)
        IF mwwLow <> MIOW THEN
          GetWindowPlace(mwwLow,mwf.x,mwf.y,mwf.w,mwf.h,isOpen);
          tfewf := mwf; (* x, y, w are ok *)
          OuterWindowFrame(tfewf,GrowOrShrinkOrDrag,WithoutScrollBars,tfewf);
          GetWindowPlace(mmwUp,mwf.x,mwf.y,mwf.w,mwf.h,isOpen);
          OuterWindowFrame(mwf,GrowOrShrinkOrDrag,WithoutScrollBars,mwf);
          tfewf.h := mwf.y+mwf.h - tfewf.y;
          InnerWindowFrame(tfewf,GrowOrShrinkOrDrag,WithoutScrollBars,tfewf);
        ELSE (* space used by MIOW and SIOW is too small => use all of screen *)
          (* use default, i.e. entire screen *)
          tfewf.x := marg; tfewf.y := marg;
          tfewf.w := ScreenWidth()-2*marg;
          tfewf.h := ScreenHeight()-MenuBarHeight()-2*marg;
          InnerWindowFrame(tfewf,GrowOrShrinkOrDrag,WithoutScrollBars,tfewf);
        END(*IF*);
        winPosStr := "";
        IntToString(tfewf.x,istr,7); Append(winPosStr,istr);
        IntToString(tfewf.y,istr,7); Append(winPosStr,istr);
        IntToString(tfewf.w,istr,7); Append(winPosStr,istr);
        IntToString(tfewf.h,istr,7); Append(winPosStr,istr);
        (* On a 1024 x 768 screen good values are tfewf.x = 5, y=634 w=495 h=217 *)
        strID := tabFuncDfltEWinID;
        StoreString("",strID,winPosStr);
      END(*IF*);
    END DefineDefltTabFuncEditWinPos;
  BEGIN (*SimInit*)
    (* avoid any premature opening of windows *)
    CloseWindow( GraphW );
    CloseWindow( TableW );
    DisableWindow( PIOW );
    DisableWindow( MVIOW );
    DisableWindow( GraphW );
    DisableWindow( TableW );
            
    GetWindowPlace( SVIOW, x1,y1, w1,h1, isOpen);
    GetWindowPlace( MVIOW, x2,y2, w2,h2, isOpen);
    pAndMVSideBySide := x1=x2;
    iOWsWideEnough := w1>((ScreenWidth()-3*ScrollBarWidth()) DIV 2);
    
    IF pAndMVSideBySide THEN 
      (* arrangement is:  M  SV
                          P  MV
                          T  G *)
      (* place P instead of SV to leave space for
      table function editing in the top left corner of the screen *)
      DefineDefltTabFuncEditWinPos(PIOW,SVIOW); (* PIOW not yet changed, SVIOW 
                                                still upper right corner *)
      SetWindowPlace( PIOW, x1,y1, w1,h1);
    ELSE
      (* arrangement is:  SV P  MV
                          M
                          T  G
                          screen is probably too small for tiling, 
                          emphasize p and mv IO-windows *)
      DefineDefltTabFuncEditWinPos(MIOW,MVIOW);
      height := ScreenHeight() - MenuBarHeight();
      width  := ScreenWidth();
      margin := 3*ScrollBarWidth() DIV 2;
      heightPIOW:= 140+TitleBarHeight();
      w := width-2*margin;
      h := height-2*margin;
      x := (width-w) DIV 2;
      y := (height-h) DIV 2;
      SetWindowPlace( TableW,x, y, w ,h );
      SetWindowPlace( GraphW, x, y, w ,h );
      wf.x := 0; wf.y := height-heightPIOW;
      wf.w := width; wf.h := heightPIOW;
      InnerWindowFrame(wf,GrowOrShrinkOrDrag,WithoutScrollBars,wf);
      SetWindowPlace( PIOW,  wf.x, wf.y, wf.w, wf.h );
      wf.x := 0; wf.y := 0;
      wf.w := width; wf.h := height-heightPIOW;
      InnerWindowFrame(wf,GrowOrShrinkOrDrag,WithoutScrollBars,wf);
      SetWindowPlace( MVIOW, wf.x,  wf.y, wf.w, wf.h );
    END(*IF*);
    
    IF iOWsWideEnough OR NOT pAndMVSideBySide THEN
      GetIOWColDisplay(PIOW,wd);
      wd.descrCol := TRUE;
      wd.identCol := TRUE;
      wd.p.unitCol := TRUE; 
      wd.p.pValCol := TRUE;
      SetIOWColDisplay(PIOW,wd);
      
      GetIOWColDisplay(MVIOW,wd);
      wd.descrCol := TRUE; 
      wd.identCol := TRUE;
      wd.mv.unitCol := TRUE; 
      wd.mv.mVMonSetCol := TRUE;
      SetIOWColDisplay(MVIOW,wd);
    END(*IF*);
    SetDefltWindowArrangement(current);

    EnableWindow( PIOW );
    EnableWindow( MVIOW );
    EnableWindow( GraphW );
    EnableWindow( TableW );
    
    GetWindowPlace( PIOW,  wf.x, wf.y, wf.w, wf.h, isOpen );
    SetWindowPlace( PIOW,  wf.x, wf.y, wf.w, wf.h );
    GetWindowPlace( MVIOW,  wf.x, wf.y, wf.w, wf.h, isOpen );
    SetWindowPlace( MVIOW,  wf.x, wf.y, wf.w, wf.h );
    IF iOWsWideEnough THEN 
      (* force opening of Table and Graph, despite no 
      tabulation or screen will look confusing to user *)
      GetWindowPlace( TableW,  wf.x, wf.y, wf.w, wf.h, isOpen );
      SetWindowPlace( TableW,  wf.x, wf.y, wf.w, wf.h );
      GetWindowPlace( GraphW,  wf.x, wf.y, wf.w, wf.h, isOpen );
      SetWindowPlace( GraphW,  wf.x, wf.y, wf.w, wf.h );
    END(*IF*);
    
  END SimInit;


  PROCEDURE ModelDefinitions;
    CONST macBullet = 245C; (*=165*)
  BEGIN
    aboutWidth := 330;
    aboutHeigth := 200;
    SetCenterWidth (aboutWidth);
    InstallAbout( "About World Model 2...", aboutWidth, aboutHeigth, AboutP );
    DeclM(m, Euler, NoInitialize, NoInput, NoOutput, Dynamic, NoTerminate, 
      Objects,
      "World model 2 by J.W. Forrester", "WM2model", NoAbout);

    ProgrammedOn(Mac); 
    SetDefltCurveAttrForMV( m, P,    coal,     unbroken,  BestCH(macBullet) );
    SetDefltCurveAttrForMV( m, NR,   emerald,  broken,    0C );
    SetDefltCurveAttrForMV( m, CI,   sapphire, invisible, "$" );
    SetDefltCurveAttrForMV( m, POLR, ruby,     unbroken,  0C );
    SetDefltCurveAttrForMV( m, QL,   pink,     spotted,   0C );
    SetDefltIndepVarIdent('year', 'year', 'year'); 
    
    SetSimTime(1900.0,2100.0);
    SetMonInterval(5.0);
    SetIntegrationStep(0.5); (* was 0.2 in original *)
    DeclareTables;
    (* suppress opening of windows during start up at wrong places *)
    DisableWindow( MIOW );
    DisableWindow( SVIOW );
    DisableWindow( PIOW );
    DisableWindow( MVIOW );
    DisableWindow( GraphW );
    DisableWindow( TableW );
    SetDefltWindowArrangement(tiled);
  END ModelDefinitions;

BEGIN
  InstallDefSimEnv( SimInit );
  RunSimEnvironment(ModelDefinitions);
END WorldModel2.   



DEFINITION MODULE WM2Tables;

  (******************************************************************

    Module  WM2TabFuncts     (Version 1.0)

              Copyright \2511988 by Andreas Fischlin and CELTIA,
              Swiss Federal Institute of Technology Zurich ETHZ

              Version for 'Dialog Machine' V1.0 and MacMETH V2.4
              1-Pass Modula-2 implementation, ModelWorks 1.0

      Purpose World Model 2 Table Functions
      
      References Forrester, J.W. 1971. World Dynamics.
              
      Programming

          Design
              M. Blanke               (22 Aug 88)
          Implementation
              M. Blanke               (22 Aug 88)
              
          Swiss Federal Institute of Technology Zurich
          Fachgruppe SystemoeSkologie ETHZ
          Bodenphysik/IWH, VOD
          ETH-Zentrum
          CH-8092 Zurich
          Switzerland

          Last revision:  29 Sept. 88 (mb)
         

  ******************************************************************)

  FROM TabFunc IMPORT TabFUNC;
  
  VAR
    BRCMT, BRFMT, BRMMT, BRPMT, CFIFRT, CIMT, CIQRT, DRCMT,
    DRFMT, DRMMT, DRPMT, FCMT, FPCIT, FPMT, NREMT,
    NRMMT, POLATT, POLCMT, QLCT, QLFT, QLMT, QLPT  :  TabFUNC;


  PROCEDURE DeclareTables;

END WM2Tables.



IMPLEMENTATION MODULE WM2Tables;

  (*

        Implementation and Revisions:
        ============================

        Author  Date        Description
        ------  ----        -----------

        tb      22/08/88    First implementation (DM 1.0,
                            MacMETH 2.4, ModelWorks 1.0)
        tb      29/09/88    fitted to new Modul "TabFunc"   
        tn      29.10.91    Version 0.3:
                            updated to new version of TabFunc: all ExtrapolModes
                            set to horizontally   
        af      21/04/97    V 0.7 (port back from IBM PC)
        af      22/03/99    V 1.0 with OS 8 support
  *)   

  FROM TabFunc IMPORT DeclTabF, TabFUNC, ExtrapolMode, DefineExtrapolationMode;

  VAR
    x4, y4 : ARRAY [0..4] OF REAL;
    x5, y5 : ARRAY [0..5] OF REAL;
    x6, y6 : ARRAY [0..6] OF REAL;
    x8, y8 : ARRAY [0..8] OF REAL;
    x10,y10: ARRAY [0..10] OF REAL;


  PROCEDURE DeclareTables;
  BEGIN

    (*BRCMT*)   x5[0]:= 0.0;
    (*BRCMT*)   x5[1]:= 1.0;
    (*BRCMT*)   x5[2]:= 2.0;
    (*BRCMT*)   x5[3]:= 3.0;
    (*BRCMT*)   x5[4]:= 4.0;
    (*BRCMT*)   x5[5]:= 5.0;
    (*BRCMT*)   y5[0]:= 1.05;
    (*BRCMT*)   y5[1]:= 1.0;
    (*BRCMT*)   y5[2]:= 0.9;
    (*BRCMT*)   y5[3]:= 0.7;
    (*BRCMT*)   y5[4]:= 0.6;
    (*BRCMT*)   y5[5]:= 0.55;
    DeclTabF(BRCMT, x5, y5, 6, TRUE,"BRCMT","CR","BRCM", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.001, 10.5);

    (*BRFMT*)   x4[0]:=  0.0;
    (*BRFMT*)   x4[1]:=  1.0;
    (*BRFMT*)   x4[2]:=  2.0;
    (*BRFMT*)   x4[3]:=  3.0;
    (*BRFMT*)   x4[4]:=  4.0;
    (*BRFMT*)   y4[0]:= 0.0;
    (*BRFMT*)   y4[1]:= 1.0;
    (*BRFMT*)   y4[2]:= 1.6;
    (*BRFMT*)   y4[3]:= 1.9;
    (*BRFMT*)   y4[4]:= 2.0;
    DeclTabF(BRFMT, x4, y4, 5, TRUE, "BRFMT", "FR", "BRFM", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.0, 20.0);

    (*BRMMT*)   x5[0]:= 0.0;
    (*BRMMT*)   x5[1]:= 1.0;
    (*BRMMT*)   x5[2]:= 2.0;
    (*BRMMT*)   x5[3]:= 3.0;
    (*BRMMT*)   x5[4]:= 4.0;
    (*BRMMT*)   x5[5]:= 5.0;
    (*BRMMT*)   y5[0]:= 1.2;
    (*BRMMT*)   y5[1]:= 1.0;
    (*BRMMT*)   y5[2]:= 0.85;
    (*BRMMT*)   y5[3]:= 0.75;
    (*BRMMT*)   y5[4]:= 0.7;
    (*BRMMT*)   y5[5]:= 0.7;
    DeclTabF(BRMMT, x5, y5, 6, TRUE, "BRMMT", "MSL", "BRMM", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.001, 12.0);

    (*BRPMT*)   x6[0]:= 0.0;
    (*BRPMT*)   x6[1]:= 10.0;
    (*BRPMT*)   x6[2]:= 20.0;
    (*BRPMT*)   x6[3]:= 30.0;
    (*BRPMT*)   x6[4]:= 40.0;
    (*BRPMT*)   x6[5]:= 50.0;
    (*BRPMT*)   x6[6]:= 60.0;
    (*BRPMT*)   y6[0]:= 1.02;
    (*BRPMT*)   y6[1]:= 0.9;
    (*BRPMT*)   y6[2]:= 0.7;
    (*BRPMT*)   y6[3]:= 0.4;
    (*BRPMT*)   y6[4]:= 0.25;
    (*BRPMT*)   y6[5]:= 0.15;
    (*BRPMT*)   y6[6]:= 0.1;
    DeclTabF(BRPMT, x6, y6, 7, TRUE, "BRPMT", "POLR", "BRPM", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.001, 10.2);

    (*CFIFRT*)   x4[0]:=  0.0;
    (*CFIFRT*)   x4[1]:=  0.5;
    (*CFIFRT*)   x4[2]:=  1.0;
    (*CFIFRT*)   x4[3]:=  1.5;
    (*CFIFRT*)   x4[4]:=  2.0;
    (*CFIFRT*)   y4[0]:= 1.0;
    (*CFIFRT*)   y4[1]:= 0.6;
    (*CFIFRT*)   y4[2]:= 0.3;
    (*CFIFRT*)   y4[3]:= 0.15;
    (*CFIFRT*)   y4[4]:= 0.1;
    DeclTabF(CFIFRT, x4, y4, 5, TRUE, "CFIFRT", "FR", "CFIFR", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.001, 10.0);

    (*CIMT*)   x5[0]:= 0.0;
    (*CIMT*)   x5[1]:= 1.0;
    (*CIMT*)   x5[2]:= 2.0;
    (*CIMT*)   x5[3]:= 3.0;
    (*CIMT*)   x5[4]:= 4.0;
    (*CIMT*)   x5[5]:= 5.0;
    (*CIMT*)   y5[0]:= 0.1;
    (*CIMT*)   y5[1]:= 1.0;
    (*CIMT*)   y5[2]:= 1.8;
    (*CIMT*)   y5[3]:= 2.4;
    (*CIMT*)   y5[4]:= 2.8;
    (*CIMT*)   y5[5]:= 3.0;
    DeclTabF(CIMT, x5, y5, 6, TRUE, "CIMT", "MSL", "CIM", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.001, 30.0);

    (*CIQRT*)   x4[0]:= 0.0;
    (*CIQRT*)   x4[1]:= 0.5;
    (*CIQRT*)   x4[2]:= 1.0;
    (*CIQRT*)   x4[3]:= 1.5;
    (*CIQRT*)   x4[4]:= 2.0;
    (*CIQRT*)   y4[0]:= 0.7;
    (*CIQRT*)   y4[1]:= 0.8;
    (*CIQRT*)   y4[2]:= 1.0;
    (*CIQRT*)   y4[3]:= 1.5;
    (*CIQRT*)   y4[4]:= 2.0;
    DeclTabF(CIQRT, x4, y4, 5, TRUE, "CIQR", "QLM/QLF", "CIQRT", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.001, 20.0);

    (*DRCMT*)   x5[0]:= 0.0;
    (*DRCMT*)   x5[1]:= 1.0;
    (*DRCMT*)   x5[2]:= 2.0;
    (*DRCMT*)   x5[3]:= 3.0;
    (*DRCMT*)   x5[4]:= 4.0;
    (*DRCMT*)   x5[5]:= 5.0;
    (*DRCMT*)   y5[0]:= 0.9;
    (*DRCMT*)   y5[1]:= 1.0;
    (*DRCMT*)   y5[2]:= 1.2;
    (*DRCMT*)   y5[3]:= 1.5;
    (*DRCMT*)   y5[4]:= 1.9;
    (*DRCMT*)   y5[5]:= 3.0;
    DeclTabF(DRCMT, x5, y5, 6, TRUE, "DRCMT", "CR", "DRCM", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.001, 30.0);

    (*DRFMT*)   x8[0]:= 0.0;
    (*DRFMT*)   x8[1]:= 0.25;
    (*DRFMT*)   x8[2]:= 0.5;
    (*DRFMT*)   x8[3]:= 0.75;
    (*DRFMT*)   x8[4]:= 1.0;
    (*DRFMT*)   x8[5]:= 1.25;
    (*DRFMT*)   x8[6]:= 1.5;
    (*DRFMT*)   x8[7]:= 1.75;
    (*DRFMT*)   x8[8]:= 2.0;
    (*DRFMT*)   y8[0]:= 30.0;
    (*DRFMT*)   y8[1]:= 3.0;
    (*DRFMT*)   y8[2]:= 2.0;
    (*DRFMT*)   y8[3]:= 1.4;
    (*DRFMT*)   y8[4]:= 1.0;
    (*DRFMT*)   y8[5]:= 0.7;
    (*DRFMT*)   y8[6]:= 0.6;
    (*DRFMT*)   y8[7]:= 0.5;
    (*DRFMT*)   y8[8]:= 0.5;
    DeclTabF(DRFMT, x8, y8, 9, TRUE, "DRFMT", "FR", "DRFM", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.001, 300.0);

    (*DRMMT*)   x10[0]:= 0.0;
    (*DRMMT*)   x10[1]:= 0.5;
    (*DRMMT*)   x10[2]:= 1.0;
    (*DRMMT*)   x10[3]:= 1.5;
    (*DRMMT*)   x10[4]:= 2.0;
    (*DRMMT*)   x10[5]:= 2.5;
    (*DRMMT*)   x10[6]:= 3.0;
    (*DRMMT*)   x10[7]:= 3.5;
    (*DRMMT*)   x10[8]:= 4.0;
    (*DRMMT*)   x10[9]:= 4.5;
    (*DRMMT*)   x10[10]:= 5.0;
    (*DRMMT*)   y10[0]:= 3.0;
    (*DRMMT*)   y10[1]:= 1.8;
    (*DRMMT*)   y10[2]:= 1.0;
    (*DRMMT*)   y10[3]:= 0.8;
    (*DRMMT*)   y10[4]:= 0.7;
    (*DRMMT*)   y10[5]:= 0.6;
    (*DRMMT*)   y10[6]:= 0.53;
    (*DRMMT*)   y10[7]:= 0.5;
    (*DRMMT*)   y10[8]:= 0.5;
    (*DRMMT*)   y10[9]:= 0.5;
    (*DRMMT*)   y10[10]:= 0.5;
    DeclTabF(DRMMT, x10, y10, 11, TRUE, "DRMMT", "MSL", "DRMM", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.001, 30.0);

    (*DRPMT*)   x6[0]:= 0.0;
    (*DRPMT*)   x6[1]:= 10.0;
    (*DRPMT*)   x6[2]:= 20.0;
    (*DRPMT*)   x6[3]:= 30.0;
    (*DRPMT*)   x6[4]:= 40.0;
    (*DRPMT*)   x6[5]:= 50.0;
    (*DRPMT*)   x6[6]:= 60.0;
    (*DRPMT*)   y6[0]:= 0.92;
    (*DRPMT*)   y6[1]:= 1.3;
    (*DRPMT*)   y6[2]:= 2.0;
    (*DRPMT*)   y6[3]:= 3.2;
    (*DRPMT*)   y6[4]:= 4.8;
    (*DRPMT*)   y6[5]:= 6.8;
    (*DRPMT*)   y6[6]:= 9.2;
    DeclTabF(DRPMT ,x6, y6, 7, TRUE, "DRPMT", "POLR", "DRPM", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.001, 92.0);

    (*FCMT*)   x5[0]:= 0.0;
    (*FCMT*)   x5[1]:= 1.0;
    (*FCMT*)   x5[2]:= 2.0;
    (*FCMT*)   x5[3]:= 3.0;
    (*FCMT*)   x5[4]:= 4.0;
    (*FCMT*)   x5[5]:= 5.0;
    (*FCMT*)   y5[0]:= 2.4;
    (*FCMT*)   y5[1]:= 1.0;
    (*FCMT*)   y5[2]:= 0.6;
    (*FCMT*)   y5[3]:= 0.4;
    (*FCMT*)   y5[4]:= 0.3;
    (*FCMT*)   y5[5]:= 0.2;
    DeclTabF(FCMT, x5, y5, 6, TRUE, "FCMT", "CR", "FCM", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.001, 24.0);

    (*FPCIT*)   x6[0]:= 0.0;
    (*FPCIT*)   x6[1]:= 1.0;
    (*FPCIT*)   x6[2]:= 2.0;
    (*FPCIT*)   x6[3]:= 3.0;
    (*FPCIT*)   x6[4]:= 4.0;
    (*FPCIT*)   x6[5]:= 5.0;
    (*FPCIT*)   x6[6]:= 6.0;
    (*FPCIT*)   y6[0]:= 0.5;
    (*FPCIT*)   y6[1]:= 1.0;
    (*FPCIT*)   y6[2]:= 1.4;
    (*FPCIT*)   y6[3]:= 1.7;
    (*FPCIT*)   y6[4]:= 1.9;
    (*FPCIT*)   y6[5]:= 2.05;
    (*FPCIT*)   y6[6]:= 2.2;
    DeclTabF(FPCIT, x6, y6, 7, TRUE, "FPCIT", "CIRA", "FPCI", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.001, 22.0);

    (*FPMT*)   x6[0]:=   0.0;
    (*FPMT*)   x6[1]:=  10.0;
    (*FPMT*)   x6[2]:=  20.0;
    (*FPMT*)   x6[3]:=  30.0;
    (*FPMT*)   x6[4]:=  40.0;
    (*FPMT*)   x6[5]:=  50.0;
    (*FPMT*)   x6[6]:=  60.0;
    (*FPMT*)   y6[0]:= 1.02;
    (*FPMT*)   y6[1]:= 0.9;
    (*FPMT*)   y6[2]:= 0.65;
    (*FPMT*)   y6[3]:= 0.35;
    (*FPMT*)   y6[4]:= 0.2;
    (*FPMT*)   y6[5]:= 0.1;
    (*FPMT*)   y6[6]:= 0.05;
    DeclTabF(FPMT, x6, y6, 7, TRUE, "FPMT", "POLR", "FPM", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.001, 10.2);

    (*NREMT*)   x4[0]:= 0.0;
    (*NREMT*)   x4[1]:= 0.25;
    (*NREMT*)   x4[2]:= 0.5;
    (*NREMT*)   x4[3]:= 0.75;
    (*NREMT*)   x4[4]:= 1.0;
    (*NREMT*)   y4[0]:= 0.0;
    (*NREMT*)   y4[1]:= 0.15;
    (*NREMT*)   y4[2]:= 0.5;
    (*NREMT*)   y4[3]:= 0.85;
    (*NREMT*)   y4[4]:= 1.0;
    DeclTabF(NREMT, x4, y4, 5, TRUE, "NREMT", "NRFR", "NREM", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.0, 10.0);

    (*NRMMT*)   x10[0]:= 0.0;
    (*NRMMT*)   x10[1]:= 1.0;
    (*NRMMT*)   x10[2]:= 2.0;
    (*NRMMT*)   x10[3]:= 3.0;
    (*NRMMT*)   x10[4]:= 4.0;
    (*NRMMT*)   x10[5]:= 5.0;
    (*NRMMT*)   x10[6]:= 6.0;
    (*NRMMT*)   x10[7]:= 7.0;
    (*NRMMT*)   x10[8]:= 8.0;
    (*NRMMT*)   x10[9]:= 9.0;
    (*NRMMT*)   x10[10]:= 10.0;
    (*NRMMT*)   y10[0]:= 0.0;
    (*NRMMT*)   y10[1]:= 1.0;
    (*NRMMT*)   y10[2]:= 1.8;
    (*NRMMT*)   y10[3]:= 2.4;
    (*NRMMT*)   y10[4]:= 2.9;
    (*NRMMT*)   y10[5]:= 3.3;
    (*NRMMT*)   y10[6]:= 3.6;
    (*NRMMT*)   y10[7]:= 3.8;
    (*NRMMT*)   y10[8]:= 3.9;
    (*NRMMT*)   y10[9]:= 3.95;
    (*NRMMT*)   y10[10]:= 4.0;
    DeclTabF(NRMMT, x10, y10, 11, TRUE, "NRMMT", "MSL", "NRMM", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.0, 40.0);

    (*POLATT*)   x6[0]:= 0.0;
    (*POLATT*)   x6[1]:= 10.0;
    (*POLATT*)   x6[2]:= 20.0;
    (*POLATT*)   x6[3]:= 30.0;
    (*POLATT*)   x6[4]:= 40.0;
    (*POLATT*)   x6[5]:= 50.0;
    (*POLATT*)   x6[6]:= 60.0;
    (*POLATT*)   y6[0]:= 0.6;
    (*POLATT*)   y6[1]:= 2.5;
    (*POLATT*)   y6[2]:= 5.0;
    (*POLATT*)   y6[3]:= 8.0;
    (*POLATT*)   y6[4]:= 11.5;
    (*POLATT*)   y6[5]:= 15.5;
    (*POLATT*)   y6[6]:= 20.0;
    DeclTabF(POLATT, x6, y6, 7, TRUE, "POLATT", "POLR", "POLAT", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.001, 200.0);

    (*POLCMT*)   x5[0]:= 0.0;
    (*POLCMT*)   x5[1]:= 1.0;
    (*POLCMT*)   x5[2]:= 2.0;
    (*POLCMT*)   x5[3]:= 3.0;
    (*POLCMT*)   x5[4]:= 4.0;
    (*POLCMT*)   x5[5]:= 5.0;
    (*POLCMT*)   y5[0]:= 0.05;
    (*POLCMT*)   y5[1]:= 1.0;
    (*POLCMT*)   y5[2]:= 3.0;
    (*POLCMT*)   y5[3]:= 5.4;
    (*POLCMT*)   y5[4]:= 7.4;
    (*POLCMT*)   y5[5]:= 8.0;
    DeclTabF(POLCMT, x5, y5, 6, TRUE, "POLCMT", "CIR", "POLCM", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.001, 80.0);
    
    (*QLCT*)   x10[0]:= 0.0;
    (*QLCT*)   x10[1]:= 0.5;
    (*QLCT*)   x10[2]:= 1.0;
    (*QLCT*)   x10[3]:= 1.5;
    (*QLCT*)   x10[4]:= 2.0;
    (*QLCT*)   x10[5]:= 2.5;
    (*QLCT*)   x10[6]:= 3.0;
    (*QLCT*)   x10[7]:= 3.5;
    (*QLCT*)   x10[8]:= 4.0;
    (*QLCT*)   x10[9]:= 4.5;
    (*QLCT*)   x10[10]:= 5.0;
    (*QLCT*)   y10[0]:= 2.0;
    (*QLCT*)   y10[1]:= 1.3;
    (*QLCT*)   y10[2]:= 1.0;
    (*QLCT*)   y10[3]:= 0.75;
    (*QLCT*)   y10[4]:= 0.55;
    (*QLCT*)   y10[5]:= 0.45;
    (*QLCT*)   y10[6]:= 0.38;
    (*QLCT*)   y10[7]:= 0.3;
    (*QLCT*)   y10[8]:= 0.25;
    (*QLCT*)   y10[9]:= 0.22;
    (*QLCT*)   y10[10]:= 0.2;
    DeclTabF(QLCT, x10, y10, 11, TRUE, "QLCT", "CR", "QLC", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.001, 20.0);

    (*QLFT*)   x4[0]:=  0.0;
    (*QLFT*)   x4[1]:=  1.0;
    (*QLFT*)   x4[2]:=  2.0;
    (*QLFT*)   x4[3]:=  3.0;
    (*QLFT*)   x4[4]:=  4.0;
    (*QLFT*)   y4[0]:= 0.0;
    (*QLFT*)   y4[1]:= 1.0;
    (*QLFT*)   y4[2]:= 1.8;
    (*QLFT*)   y4[3]:= 2.4;
    (*QLFT*)   y4[4]:= 2.7;
    DeclTabF(QLFT, x4, y4, 5, TRUE, "QLFT", "FR", "QLF", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.0, 27.0);

    (*QLMT*)   x5[0]:= 0.0;
    (*QLMT*)   x5[1]:= 1.0;
    (*QLMT*)   x5[2]:= 2.0;
    (*QLMT*)   x5[3]:= 3.0;
    (*QLMT*)   x5[4]:= 4.0;
    (*QLMT*)   x5[5]:= 5.0;
    (*QLMT*)   y5[0]:= 0.2;
    (*QLMT*)   y5[1]:= 1.0;
    (*QLMT*)   y5[2]:= 1.7;
    (*QLMT*)   y5[3]:= 2.3;
    (*QLMT*)   y5[4]:= 2.7;
    (*QLMT*)   y5[5]:= 2.9;
    DeclTabF(QLMT, x5, y5, 6, TRUE, "QLMT", "MSL", "QLM", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.001, 29.0);

    (*QLPT*)   x6[0]:= 0.0;
    (*QLPT*)   x6[1]:= 10.0;
    (*QLPT*)   x6[2]:= 20.0;
    (*QLPT*)   x6[3]:= 30.0;
    (*QLPT*)   x6[4]:= 40.0;
    (*QLPT*)   x6[5]:= 50.0;
    (*QLPT*)   x6[6]:= 60.0;
    (*QLPT*)   y6[0]:= 1.04;
    (*QLPT*)   y6[1]:= 0.85;
    (*QLPT*)   y6[2]:= 0.6;
    (*QLPT*)   y6[3]:= 0.3;
    (*QLPT*)   y6[4]:= 0.15;
    (*QLPT*)   y6[5]:= 0.05;
    (*QLPT*)   y6[6]:= 0.02;
    DeclTabF(QLPT, x6, y6, 7, TRUE, "QLPT", "POLR", "QLP", "dimensionless",
    "dimensionless", 0.0, 1000.0, 0.001, 10.4);
    
    DefineExtrapolationMode(BRCMT,  horizontally);
    DefineExtrapolationMode(BRFMT,  horizontally);
    DefineExtrapolationMode(BRMMT,  horizontally);
    DefineExtrapolationMode(BRPMT,  horizontally);
    DefineExtrapolationMode(CFIFRT, horizontally);
    DefineExtrapolationMode(CIMT,   horizontally);
    DefineExtrapolationMode(CIQRT,  horizontally);
    DefineExtrapolationMode(DRCMT,  horizontally);
    DefineExtrapolationMode(DRFMT,  horizontally);
    DefineExtrapolationMode(DRMMT,  horizontally);
    DefineExtrapolationMode(DRPMT,  horizontally);
    DefineExtrapolationMode(FCMT,   horizontally);
    DefineExtrapolationMode(FPCIT,  horizontally);
    DefineExtrapolationMode(FPMT,   horizontally);
    DefineExtrapolationMode(NREMT,  horizontally);
    DefineExtrapolationMode(NRMMT,  horizontally);
    DefineExtrapolationMode(POLATT, horizontally);
    DefineExtrapolationMode(POLCMT, horizontally);
    DefineExtrapolationMode(QLCT,   horizontally);
    DefineExtrapolationMode(QLFT,   horizontally);
    DefineExtrapolationMode(QLMT,   horizontally);
    DefineExtrapolationMode(QLPT,   horizontally);
  END DeclareTables;

END WM2Tables.


  RAMSES@env.ethz.ch Last modified 1/30/23 [Top of page]   

Modula-2 website ring
List all    |    <<  Prev    |    Next  >>    |    Join