diff --git a/Project.toml b/Project.toml index fd07b3b..1e4c67a 100644 --- a/Project.toml +++ b/Project.toml @@ -16,6 +16,8 @@ PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a" ColorSchemes = "3.0 - 3.19" ColorTypes = "0.7 - 0.11" DifferentialEquations = "7.1 - 7.3" +GraphRecipes = "0.5" +IfElse = "0.1" ModelingToolkit = "8.0 - 8.16" PlotlyJS = "0.13 - 0.18" julia = "1.6 - 1.8" diff --git a/docs/make.jl b/docs/make.jl index a5b4992..1278487 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -5,7 +5,7 @@ makedocs(sitename="WorldDynamics.jl", pages=[ "Home" => "index.md", "WorldDynamics tutorial" => "tutorial.md", - "World3 equations and constants" => "world3.md", + "World 3 equations, variables, and parameters" => "world3.md", "Source code documentation" => "source.md" ] ) diff --git a/docs/src/assets/favicon.ico b/docs/src/assets/favicon.ico new file mode 100644 index 0000000..e682d92 Binary files /dev/null and b/docs/src/assets/favicon.ico differ diff --git a/docs/src/assets/logo.svg b/docs/src/assets/logo.svg new file mode 100644 index 0000000..397b247 --- /dev/null +++ b/docs/src/assets/logo.svg @@ -0,0 +1,29 @@ + + + + + + + + diff --git a/docs/src/img/world3.png b/docs/src/img/world3.png new file mode 100644 index 0000000..71bec77 Binary files /dev/null and b/docs/src/img/world3.png differ diff --git a/docs/src/tutorial.md b/docs/src/tutorial.md index 8cd9e41..3e8c948 100644 --- a/docs/src/tutorial.md +++ b/docs/src/tutorial.md @@ -1,10 +1,17 @@ # A WorldDynamics tutorial -`WorldDynamics` allows the user to *play* with the World3 model introduced in the book *Dynamics of Growth in a Finite World* (1974). Informally speaking, this model is formed by five sectors, each containg one or more subsectors. The following picture shows the structure of the model and the connections between the subsectors which share a common variable. +`WorldDynamics` allows the user to *play* with the World3 model introduced in the book *Dynamics of Growth in a Finite World* (1974). Informally speaking, this model is formed by five systems, each containg one or more subsystems. The following picture shows the structure of the model and the connections between the subsystems which share a common variable. +![The World3 model](img/world3.png) + +As it can be seen, the five systems are `Pop4` (which is the population system with four age levels), `Agriculture`, `Capital`, `Non-renewable` (resources), and `Pollution`. The `Pop4` system is formed by the three subsystems `pop` (population), `br` (birth rate), and `dr` (death rate). For instance, the subsystem `br` uses the variable `pop` which originates from the subsystem `pop`, while the subsystem `pop` uses the variable `le` which originates from the subsystem `dr`. Of course, there are variables which connect subsystem of different systems. For example, the subsystem `pp` of the system `Pollution` uses the variable `aiph` which originates from the subsystem `ai` of the system `Agriculture` (for an entire list of variables and of subsystems using them see the [World 3 equations, variables, and parameters](@ref eqs_vars_pars) page). + +In `WorldDynamics` each system is a Julia module and each subsystem correspond to a Julia function of this module (or of a module which is included in this module), which defines the ODE system corresponding to the subsystem itself. All the ODE systems corresponding to the subsystems of the World3 model have to be composed (see the function `compose` in the `solvesystems.jl` code file). This will produce the entire ODE system of the World3 model, which can then be solved by using the function `solve` in the `solvesystems.jl` code file. + +Let us now see how we can replicate the runs described in Chapter 7 of the above mentioned book. ## Replicating historical runs -We first have to solve the ODE system, which is constructed in the `world3_historicalrun` function, included in the `world3_historicalrun.jl` code file. This ODE system is the one described in the book *Dynamics of Growth in a Finite World* (1974), and used in Chapter 7 of the book itself. +We first have to solve the World3 ODE system, which is constructed in the `world3_historicalrun` function, included in the `world3_historicalrun.jl` code file. ``` using WorldDynamics @@ -13,7 +20,7 @@ system = world3_historicalrun() sol = WorldDynamics.solve(system, (1900, 2100)) ``` -We then have to define the variables that we want to plot. For example, Figure 7-2 of the above book shows the plot of eleven variables in the population sector of the model. In order to easily access to these variables, we first create shortcuts to the subsectors in which they are introduced. +We then have to define the variables that we want to plot. For example, Figure 7-2 of the above book shows the plot of eleven variables in the population system of the model. In order to easily access to these variables, we first create shortcuts to the subsystems in which they are introduced. ``` @named pop = WorldDynamics.World3.Pop4.population() @@ -38,14 +45,14 @@ fig_7_2_variables = [ ] @variables t ``` -For each variable of the model, the above vector includes a quadruple, containing the Julia variable, its range, and its symbolic name to be shonw in the plot (the range and the symbolic name are optional). The time variable `t` has also to be declared. + +For each variable of the model, the above vector includes a quadruple, containing the Julia variable, its range, and its symbolic name to be shown in the plot (the range and the symbolic name are optional). The time variable `t` has also to be declared. Finally, we can plot the evolution of the model variables according to the previously computed solution. ``` plotvariables(sol, (t, 1900, 1970), fig_7_2_variables, name="Fig. 7-2", showlegend=true, colored=true) ``` - ## Replicating the reference behaviour To replicate the figures in Section 7.3 of the above book, we can operate in a similar way by declaring the varibales to be plot and by changing the time range. For example the following code reproduce the plot of Figure 7-7. diff --git a/docs/src/world3.md b/docs/src/world3.md index f771f1c..57c0937 100644 --- a/docs/src/world3.md +++ b/docs/src/world3.md @@ -1,7 +1,6 @@ -# World 3 equations and constants +# [World 3 equations, variables, and parameters](@id eqs_vars_pars) -The pdf page is given by the book page + 16. -For the definitions, see *Appendix B: Definition File* at page 587 of [*Dynamics of growth in a finite world*][DGFW]. +In this page we list the equations, the variables and the parameters of the World3 model as described in Appendices A and B of the book *Dynamics of growth in a finite world* (1974) (our code also implement the model corresponding to each system of the entire World3 model as described in Chapter 2, 3, 4, 5, and 6 of the book, but we do not list here the equations, the variables and the parameters of each such model). ## Equations @@ -55,199 +54,354 @@ For the definitions, see *Appendix B: Definition File* at page 587 of [*Dynamics | Name | Initialization | | --- | --- | -| Population | $\mathtt{pop}(0)=1.61e9$ | -| Effective health services per capita | $\mathtt{ehspc}(0)=\mathtt{hsapc}(0)$ | -| Perceived life expectancy | $\mathtt{ple}(0) = \mathtt{le}(0)$ | -| | $\mathtt{ple1}(0) = \mathtt{le}(0)$ | -| | $\mathtt{ple2}(0) = \mathtt{le}(0)$ | -| Delayed industrial out | $\mathtt{diopc}(0) = \mathtt{iopc}(0)$ | +| Agricultural inputs | $\mathtt{ai}(0) = 5e9$ | +| Arable land | $\mathtt{al}(0) = 9e8$ | +| Average industrial output per capita | $\mathtt{aiopc}(0) = \mathtt{iopc}(0)$ | +| Capital utilization fraction | $\mathtt{cuf}(0) = 1$ | +| Delayed industrial output per capita | $\mathtt{diopc}(0) = \mathtt{iopc}(0)$ | | | $\mathtt{diopc2}(0) = \mathtt{iopc}(0)$ | | | $\mathtt{diopc1}(0) = \mathtt{iopc}(0)$ | -| | $\mathtt{frsn}(0)=0.82$ | -| | $\mathtt{aiopc}(0) = \mathtt{iopc}(0)$ | -| | $\mathtt{fcfpc}(0) = \mathtt{fcapc}(0)$ | +| Effective health services per capita | $\mathtt{ehspc}(0)=\mathtt{hsapc}(0)$ | +| Family response to social norm | $\mathtt{frsn}(0)=0.82$ | +| Fertility control facilities per capita | $\mathtt{fcfpc}(0) = \mathtt{fcapc}(0)$ | | | $\mathtt{fcfpc2}(0) = \mathtt{fcapc}(0)$ | | | $\mathtt{fcfpc1}(0) = \mathtt{fcapc}(0)$ | +| Industrial capital | $\mathtt{ic}(0)=2.1e11$ | +| Labor utilization fraction delay | $\mathtt{lufd}(0)=1.0$ | +| Land fertility | $\mathtt{lfert}(0)=600$ | +| Fraction of the population age 0-14 | $\mathtt{p1}(0)=65e7$ | +| Fraction of the population age 15-44 | $\mathtt{p2}(0)=70e7$ | +| Fraction of the population age 45-64 | $\mathtt{p3}(0)=19e7$ | +| Fraction of the population age 65+ | $\mathtt{p4}(0)=6e7$ | +| Perceived food ratio | $\mathtt{pfr}(0)=1$ | +| Population | $\mathtt{pop}(0)=1.61e9$ | +| Potentially arable land | $\mathtt{pal}(0) = 2.3e9$ | +| Perceived life expectancy | $\mathtt{ple}(0) = \mathtt{le}(0)$ | +| | $\mathtt{ple1}(0) = \mathtt{le}(0)$ | +| | $\mathtt{ple2}(0) = \mathtt{le}(0)$ | +| Persistent pollution | $\mathtt{ppol}(0) = 2.5e7$ | +| Index of persistent pollution | $\mathtt{ppolx}(0) = 1.0$ | +| Service capital | $\mathtt{sc}(0) = 1.44e11$ | +| Urban-industrial land | $\mathtt{uil}(0) = 8.2e6$ | + + +## Variable and (ODE) subsystem correspondance + +| # | Variable | Main subsystem | Other subsystems | +| --- | -------- | --------------- | ----------------- | +|1| `pop` | `population` | `land_development`, `land_erosion_urban_industrial_use`, `industrial_subsector`, `service_subsector`, `non_renewable`, `persistent_pollution`, `birth_rate`, `death_rate` | +|2| `p1` | ` population` | | +|3| `p2` | ` population` | `job_subsector` | +|4| `p3` | ` population` | `job_subsector` | +|5| `p4` | ` population` | | +|6| `d1` | ` population` | | +|7| `d2` | ` population` | | +|8| `d3` | ` population` | | +|9| `d4` | ` population` | | +|10| `m1` | ` population` | | +|11| `m2` | ` population` | | +|12| `m3` | ` population` | | +|13| `m4` | ` population` | | +|14| `mat1` | ` population` | | +|15| `mat2` | ` population` | | +|16| `mat3` | ` population` | | +|17| `dr` | `death_rate` | ` population` | +|18| `cdr` | `death_rate` | | +|19| `le` | `death_rate` | `birth_rate`,` population` | +|20| `lmf` | `death_rate` | | +|21| `hsapc` | `death_rate` | | +|22| `ehspc` | `death_rate` | | +|23| `lmhs` | `death_rate` | | +|24| `lmhs1` | `death_rate` | | +|25| `lmhs2` | `death_rate` | | +|26| `fpu` | `death_rate` | | +|27| `cmi` | `death_rate` | | +|28| `lmc` | `death_rate` | | +|29| `lmp` | `death_rate` | | +|30| `br` | `birth_rate` | ` population` | +|31| `cbr` | `birth_rate ` | | +|32| `tf` | `birth_rate` | ` population` | +|33| `mtf` | `birth_rate` | | +|34| `fm` | `birth_rate` | | +|35| `dtf` | `birth_rate` | | +|36| `cmple` | `birth_rate` | | +|37| `ple` | `birth_rate` | | +|| `ple1` | `birth_rate` | | +|| `ple2` | `birth_rate` | | +|38| `dcfs` | `birth_rate` | | +|39| `sfsn` | `birth_rate` | | +|40| `diopc` | `birth_rate` | | +|| `diopc1` | `birth_rate` | | +|| `diopc2` | `birth_rate` | | +|41| `frsn` | `birth_rate` | | +|42| `fie` | `birth_rate` | | +|43| `aiopc` | `birth_rate` | | +|44| `nfc` | `birth_rate` | | +|45| `fce` | `birth_rate` | | +|46| `fcfpc` | `birth_rate` | | +|| `fcfpc1` | `birth_rate` | | +|| `fcfpc2` | `birth_rate` | | +|47| `fcapc` | `birth_rate` | | +|48| `fsafc` | `birth_rate` | | +|49| `iopc` | `industrial_subsector` | `land_development`, `land_erosion_urban_industrial_use`, `job_subsector`, `service_subsector`, `non_renewable`, `birth_rate`, `death_rate` | 8| +|50| `io` | `industrial_subsector` | `agricultural_inputs`, `land_development`, `service_subsector`, `supplementary_equations` | 5| +|51| `icor` | `industrial_subsector` | | +|52| `ic` | `industrial_subsector` | `job_subsector` | +|53| `icdr` | `industrial_subsector` | | +|54| `alic` | `industrial_subsector` | | +|55| `icir` | `industrial_subsector` | | +|56| `fioai` | `industrial_subsector` | | +|57| `fioac` | `industrial_subsector` | | +|58| `fioacc` | `industrial_subsector` | | +|59| `fioacv` | `industrial_subsector` | | +|60| `isopc` | `service_subsector` | | +|61| `isopc1` | `service_subsector` | | +|62| `isopc2` | `service_subsector` | | +|63| `fioas` | `service_subsector` | `industrial_subsector` | +|64| `fioas1` | `service_subsector` | | +|65| `fioas2` | `service_subsector` | | +|66| `scir` | `service_subsector` | | +|67| `sc` | `service_subsector` | `job_subsector` | +|68| `scdr` | `service_subsector` | | +|69| `alsc` | `service_subsector` | | +|70| `so` | `service_subsector` | `supplementary_equations` | +|71| `sopc` | `service_subsector` | `job_subsector`, `birth_rate`, `death_rate` | 4| +|72| `scor` | `service_subsector` | | +|73| `j` | `job_subsector` | | +|74| `pjis` | `job_subsector` | | +|75| `jpicu` | `job_subsector` | | +|76| `pjss` | `job_subsector` | | +|77| `jpscu` | `job_subsector` | | +|78| `pjas` | `job_subsector` | | +|79| `jph` | `job_subsector` | | +|80| `lf` | `job_subsector` | | +|81| `luf` | `job_subsector` | | +|82| `lufd` | `job_subsector` | | +|83| `cuf` | `job_subsector` | `industrial_subsector`, `service_subsector` | +|84| `lfc` | `land_development` | | +|85| `al` | `land_development` | `agricultural_inputs`, `land_erosion_urban_industrial_use`, `job_subsector`, `persistent_pollution` | 5| +|86| `pal` | `land_development` | | +|87| `f` | `land_development` | `supplementary_equations` | +|88| `fpc` | `land_development` | `discontinuing_land_maintenance`, `death_rate` | +|89| `ifpc` | `land_development` | | +|90| `ifpc1` | `land_development` | | +|91| `ifpc2` | `land_development` | | +|92| `tai` | `land_development` | `agricultural_inputs` | +|93| `fioaa` | `land_development` | `industrial_subsector` | +|94| `fioaa1` | `land_development` | | +|95| `fioaa2` | `land_development` | | +|96| `ldr` | `land_development` | | +|97| `dcph` | `land_development` | `investment_allocation_decision` | +|98| `cai` | `agricultural_inputs` | | +|99| `ai` | `agricultural_inputs` | | +|100| `alai` | `agricultural_inputs` | `investment_allocation_decision` | +|101| `aiph` | `agricultural_inputs` | `investment_allocation_decision`, `job_subsector`, `persistent_pollution` | +|102| `lymc` | `agricultural_inputs` | `investment_allocation_decision` | +|103| `ly` | `agricultural_inputs` | `investment_allocation_decision`, `land_development`, `land_erosion_urban_industrial_use` | +|104| `lyf` | `agricultural_inputs` | | +|105| `lymap` | `agricultural_inputs` | | +|106| `lymap1` | `agricultural_inputs` | | +|107| `lymap2` | `agricultural_inputs` | | +|108| `fiald` | `agricultural_inputs` | `investment_allocation_decision` , `land_development` | +|109| `mpld` | `investment_allocation_decision` | | +|110| `mpai` | `investment_allocation_decision` | | +|111| `mlymc` | `investment_allocation_decision` | | +|112| `all` | `land_erosion_urban_industrial_use` | | +|113| `llmy` | `land_erosion_urban_industrial_use` | | +|114| `llmy1` | `land_erosion_urban_industrial_use` | | +|115| `llmy2` | `land_erosion_urban_industrial_use` | | +|116| `ler` | `land_erosion_urban_industrial_use` | `land_development` | +|117| `uilpc` | `land_erosion_urban_industrial_use` | | +|118| `uilr` | `land_erosion_urban_industrial_use` | | +|119| `lrui` | `land_erosion_urban_industrial_use` | `land_development` | +|120| `uil` | `land_erosion_urban_industrial_use` | | +|121| `lfert` | `land_fertility_degradation` | `agricultural_inputs`, `land_fertility_regeneration` | +|122| `lfdr` | `land_fertility_degradation` | | +|123| `lfd` | `land_fertility_degradation` | | +|124| `lfr` | `land_fertility_regeneration` | `land_fertility_degradation` | +|125| `lfrt` | `land_fertility_regeneration` | | +|126| `falm` | `discontinuing_land_maintenance` | `agricultural_inputs`, `land_fertility_regeneration` | +|127| `fr` | `discontinuing_land_maintenance` | | +|128| `pfr` | `discontinuing_land_maintenance` | | +|129| `nr` | `non_renewable` | | +|130| `nrur` | `non_renewable` | | +|131| `nruf` | `non_renewable` | | +|132| `pcrum` | `non_renewable` | `persistent_pollution` | +|133| `nrfr` | `non_renewable` | | +|134| `fcaor` | `non_renewable` | `industrial_subsector` | +|135| `fcaor1` | `non_renewable` | | +|136| `fcaor2` | `non_renewable` | | +|137| `ppgr` | `persistent_pollution` | | +|138| `ppgf` | `persistent_pollution` | | +|| `ppgf2` | `persistent_pollution` | | +|| `ppgf22` | `persistent_pollution` | `adaptive_technological_control_cards` | +|139| `ppgio` | `persistent_pollution` | | +|140| `ppgao` | `persistent_pollution` | | +|141| `ppapr` | `persistent_pollution` | | +|| `ppapr1` | `persistent_pollution` | | +|| `ppapr2` | `persistent_pollution` | | +|| `ppapr3` | `persistent_pollution` | | +|| `pptd` | `persistent_pollution` | | +|142| `ppol` | `persistent_pollution` | | +|143| `ppolx` | `persistent_pollution` | `land_fertility_degradation`, `pollution_damage`, `death_rate` | +|144| `ppasr` | `persistent_pollution` | | +|145| `ahlm` | `persistent_pollution` | | +|146| `ahl` | `persistent_pollution` | | +|| `ppgf221` | `adaptive_technological_control_cards` | | +|| `ppgf222` | `adaptive_technological_control_cards` | | +|| `pcti` | `adaptive_technological_control_cards` | | +|| `plmp` | `adaptive_technological_control_cards` | | +|| `plmp1` | `adaptive_technological_control_cards` | | +|| `plmp2` | `adaptive_technological_control_cards` | | +|| `pctcm` | `adaptive_technological_control_cards` | | +|| `pctir` | `adaptive_technological_control_cards` | | +|| `lmp` | `pollution_damage` | `adaptive_technological_control_cards` | +|| `lmp1` | `pollution_damage` | | +|| `lmp2` | `pollution_damage` | | +|| `lfdr` | `pollution_damage` | | +|| `lfdr1` | `pollution_damage` | | +|| `lfdr2` | `pollution_damage` | | +|147| `foa` | `supplementary_equations` | | +|148| `foi` | `supplementary_equations` | | +|149| `fos` | `supplementary_equations` | | + +## Parameters -## Variable/ODE system correspondance -| # | Variable | Main ODE system | Other ODE systems | # ODE systems | -| --- | -------- | --------------- | ----------------- | ------------- | -|1| `pop` | `Pop4.population` | `Agriculture.land_development`, `Agriculture.land_erosion_urban_industrial_use`, `Capital.industrial_subsector`, `Capital.service_subsector`, `NonRenewable.non_renewable`, `Pollution.persistent_pollution`, `Pop4.birth_rate`, `Pop4.death_rate` | 9 | -|2| `p1` | `Pop4.population` | | 1| -|3| `p2` | `Pop4.population` | `Capital.job_subsector` | 2| -|4| `p3` | `Pop4.population` | `Capital.job_subsector` | 2| -|5| `p4` | `Pop4.population` | | 1| -|6| `d1` | `Pop4.population` | | 1| -|7| `d2` | `Pop4.population` | | 1| -|8| `d3` | `Pop4.population` | | 1| -|9| `d4` | `Pop4.population` | | 1| -|10| `m1` | `Pop4.population` | | 1| -|11| `m2` | `Pop4.population` | | 1| -|12| `m3` | `Pop4.population` | | 1| -|13| `m4` | `Pop4.population` | | 1| -|14| `mat1` | `Pop4.population` | | 1| -|15| `mat2` | `Pop4.population` | | 1| -|16| `mat3` | `Pop4.population` | | 1| -|17| `dr` | `Pop4.death_rate` | `Pop4.population` | 2| -|18| `cdr` | `Pop4.death_rate` | | 1| -|19| `le` | `Pop4.death_rate` | `Pop4.birth_rate`,`Pop4.population` | 3| -|20| `lmf` | `Pop4.death_rate` | | 1| -|21| `hsapc` | `Pop4.death_rate` | | 1| -|22| `ehspc` | `Pop4.death_rate` | | 1| -|23| `lmhs` | `Pop4.death_rate` | | 1| -|24| `lmhs1` | `Pop4.death_rate` | | 1| -|25| `lmhs2` | `Pop4.death_rate` | | 1| -|26| `fpu` | `Pop4.death_rate` | | 1| -|27| `cmi` | `Pop4.death_rate` | | 1| -|28| `lmc` | `Pop4.death_rate` | | 1| -|29| `lmp` | `Pop4.death_rate` | | 1| -|30| `br` | `Pop4.birth_rate` | `Pop4.population` | 2| -|31| `cbr` | `Pop4. birth_rate ` | | 1| -|32| `tf` | `Pop4.birth_rate` | `Pop4.population` | 2| -|33| `mtf` | `Pop4.birth_rate` | | 1| -|34| `fm` | `Pop4.birth_rate` | | 1| -|35| `dtf` | `Pop4.birth_rate` | | 1| -|36| `cmple` | `Pop4.birth_rate` | | 1| -|37| `ple` | `Pop4.birth_rate` | | 1| -|| `ple1` | `Pop4.birth_rate` | | 1| -|| `ple2` | `Pop4.birth_rate` | | 1| -|38| `dcfs` | `Pop4.birth_rate` | | 1| -|39| `sfsn` | `Pop4.birth_rate` | | 1| -|40| `diopc` | `Pop4.birth_rate` | | 1| -|| `diopc1` | `Pop4.birth_rate` | | 1| -|| `diopc2` | `Pop4.birth_rate` | | 1| -|41| `frsn` | `Pop4.birth_rate` | | 1| -|42| `fie` | `Pop4.birth_rate` | | 1| -|43| `aiopc` | `Pop4.birth_rate` | | 1| -|44| `nfc` | `Pop4.birth_rate` | | 1| -|45| `fce` | `Pop4.birth_rate` | | 1| -|46| `fcfpc` | `Pop4.birth_rate` | | 1| -|| `fcfpc1` | `Pop4.birth_rate` | | 1| -|| `fcfpc2` | `Pop4.birth_rate` | | 1| -|47| `fcapc` | `Pop4.birth_rate` | | 1| -|48| `fsafc` | `Pop4.birth_rate` | | 1| -|49| `iopc` | `Capital.industrial_subsector` | `Agriculture.land_development`, `Agriculture.land_erosion_urban_industrial_use`, `Capital.job_subsector`, `Capital.service_subsector`, `NonRenewable.non_renewable`, `Pop4.birth_rate`, `Pop4.death_rate` | 8| -|50| `io` | `Capital.industrial_subsector` | `Agriculture.agricultural_inputs`, `Agriculture.land_development`, `Capital.service_subsector`, `SupplementaryEquations.supplementary_equations` | 5| -|51| `icor` | `Capital.industrial_subsector` | | 1| -|52| `ic` | `Capital.industrial_subsector` | `Capital.job_subsector` | 2| -|53| `icdr` | `Capital.industrial_subsector` | | 1| -|54| `alic` | `Capital.industrial_subsector` | | 1| -|55| `icir` | `Capital.industrial_subsector` | | 1| -|56| `fioai` | `Capital.industrial_subsector` | | 1| -|57| `fioac` | `Capital.industrial_subsector` | | 1| -|58| `fioacc` | `Capital.industrial_subsector` | | 1| -|59| `fioacv` | `Capital.industrial_subsector` | | 1| -|60| `isopc` | `Capital.service_subsector` | | 1| -|61| `isopc1` | `Capital.service_subsector` | | 1| -|62| `isopc2` | `Capital.service_subsector` | | 1| -|63| `fioas` | `Capital.service_subsector` | `Capital.industrial_subsector` | 2| -|64| `fioas1` | `Capital.service_subsector` | | 1| -|65| `fioas2` | `Capital.service_subsector` | | 1| -|66| `scir` | `Capital.service_subsector` | | 1| -|67| `sc` | `Capital.service_subsector` | `Capital.job_subsector` | 2| -|68| `scdr` | `Capital.service_subsector` | | 1| -|69| `alsc` | `Capital.service_subsector` | | 1| -|70| `so` | `Capital.service_subsector` | `SupplementaryEquations.supplementary_equations` | 2| -|71| `sopc` | `Capital.service_subsector` | `Capital.job_subsector`, `Pop4.birth_rate`, `Pop4.death_rate` | 4| -|72| `scor` | `Capital.service_subsector` | | 1| -|73| `j` | `Capital.job_subsector` | | 1| -|74| `pjis` | `Capital.job_subsector` | | 1| -|75| `jpicu` | `Capital.job_subsector` | | 1| -|76| `pjss` | `Capital.job_subsector` | | 1| -|77| `jpscu` | `Capital.job_subsector` | | 1| -|78| `pjas` | `Capital.job_subsector` | | 1| -|79| `jph` | `Capital.job_subsector` | | 1| -|80| `lf` | `Capital.job_subsector` | | 1| -|81| `luf` | `Capital.job_subsector` | | 1| -|82| `lufd` | `Capital.job_subsector` | | 1| -|83| `cuf` | `Capital.job_subsector` | `Capital.industrial_subsector`, `Capital.service_subsector` | 3| -|84| `lfc` | `Agriculture.land_development` | | 1| -|85| `al` | `Agriculture.land_development` | `Agriculture.agricultural_inputs`, `Agriculture.land_erosion_urban_industrial_use`, `Capital.job_subsector`, `Pollution.persistent_pollution` | 5| -|86| `pal` | `Agriculture.land_development` | | 1| -|87| `f` | `Agriculture.land_development` | `SupplementaryEquations.supplementary_equations` | 2| -|88| `fpc` | `Agriculture.land_development` | `Agriculture.discontinung_land_maintenance`, `Pop4.death_rate` | 3| -|89| `ifpc` | `Agriculture.land_development` | | 1| -|90| `ifpc1` | `Agriculture.land_development` | | 1| -|91| `ifpc2` | `Agriculture.land_development` | | 1| -|92| `tai` | `Agriculture.land_development` | `Agriculture.agricultural_inputs` | 2| -|93| `fioaa` | `Agriculture.land_development` | `Capital.industrial_subsector` | 2| -|94| `fioaa1` | `Agriculture.land_development` | | 1| -|95| `fioaa2` | `Agriculture.land_development` | | 1| -|96| `ldr` | `Agriculture.land_development` | | 1| -|97| `dcph` | `Agriculture.land_development` | `Agriculture.investment_allocation_decision` | 2| -|98| `cai` | `Agriculture.agricultural_inputs` | | 1| -|99| `ai` | `Agriculture.agricultural_inputs` | | 1| -|100| `alai` | `Agriculture.agricultural_inputs` | `Agriculture.investment_allocation_decision` | 2| -|101| `aiph` | `Agriculture.agricultural_inputs` | `Agriculture.investment_allocation_decision`, `Capital.job_subsector`, `Pollution.persistent_pollution` | 4| -|102| `lymc` | `Agriculture.agricultural_inputs` | `Agriculture.investment_allocation_decision` | 2| -|103| `ly` | `Agriculture.agricultural_inputs` | `Agriculture.investment_allocation_decision`, `Agriculture.land_development`, `Agriculture.land_erosion_urban_industrial_use` | 4| -|104| `lyf` | `Agriculture.agricultural_inputs` | | 1| -|105| `lymap` | `Agriculture.agricultural_inputs` | | 1| -|106| `lymap1` | `Agriculture.agricultural_inputs` | | 1| -|107| `lymap2` | `Agriculture.agricultural_inputs` | | 1| -|108| `fiald` | `Agriculture.agricultural_inputs` | `Agriculture.investment_allocation_decision` , `Agriculture.land_development` | 3| -|109| `mpld` | `Agriculture.investment_allocation_decision` | | 1| -|110| `mpai` | `Agriculture.investment_allocation_decision` | | 1| -|111| `mlymc` | `Agriculture.investment_allocation_decision` | | 1| -|112| `all` | `Agriculture.land_erosion_urban_industrial_use` | | 1| -|113| `llmy` | `Agriculture.land_erosion_urban_industrial_use` | | 1| -|114| `llmy1` | `Agriculture.land_erosion_urban_industrial_use` | | 1| -|115| `llmy2` | `Agriculture.land_erosion_urban_industrial_use` | | 1| -|116| `ler` | `Agriculture.land_erosion_urban_industrial_use` | `Agriculture.land_development` | 2| -|117| `uilpc` | `Agriculture.land_erosion_urban_industrial_use` | | 1| -|118| `uilr` | `Agriculture.land_erosion_urban_industrial_use` | | 1| -|119| `lrui` | `Agriculture.land_erosion_urban_industrial_use` | `Agriculture.land_development` | 2| -|120| `uil` | `Agriculture.land_erosion_urban_industrial_use` | | 1| -|121| `lfert` | `Agriculture.land_fertility_degradation` | `Agriculture.agricultural_inputs`, `Agriculture.land_fertility_regeneration` | 3| -|122| `lfdr` | `Agriculture.land_fertility_degradation` | | 1| -|123| `lfd` | `Agriculture.land_fertility_degradation` | | 1| -|124| `lfr` | `Agriculture.land_fertility_regeneration` | `Agriculture.land_fertility_degradation` | 2| -|125| `lfrt` | `Agriculture.land_fertility_regeneration` | | 1| -|126| `falm` | `Agriculture.discontinuing_land_maintenance` | `Agriculture.agricultural_inputs`, `Agriculture.land_fertility_regeneration` | 3| -|127| `fr` | `Agriculture.discontinuing_land_maintenance` | | 1| -|128| `pfr` | `Agriculture.discontinuing_land_maintenance` | | 1| -|129| `nr` | `NonRenewable.non_renewable` | | 1| -|130| `nrur` | `NonRenewable.non_renewable` | | 1| -|131| `nruf` | `NonRenewable.non_renewable` | | 1| -|132| `pcrum` | `NonRenewable.non_renewable` | `Pollution.persistent_pollution` | 2| -|133| `nrfr` | `NonRenewable.non_renewable` | | 1| -|134| `fcaor` | `NonRenewable.non_renewable` | `Capital.industrial_subsector` | 2| -|135| `fcaor1` | `NonRenewable.non_renewable` | | 1| -|136| `fcaor2` | `NonRenewable.non_renewable` | | 1| -|137| `ppgr` | `Pollution.persistent_pollution` | | 1| -|138| `ppgf` | `Pollution.persistent_pollution` | | 1| -|| `ppgf2` | `Pollution.persistent_pollution` | | 1| -|| `ppgf22` | `Pollution.persistent_pollution` | `Pollution.adaptive_technological_control_cards` | 2| -|139| `ppgio` | `Pollution.persistent_pollution` | | 1| -|140| `ppgao` | `Pollution.persistent_pollution` | | 1| -|141| `ppapr` | `Pollution.persistent_pollution` | | 1| -|| `ppapr1` | `Pollution.persistent_pollution` | | 1| -|| `ppapr2` | `Pollution.persistent_pollution` | | 1| -|| `ppapr3` | `Pollution.persistent_pollution` | | 1| -|| `pptd` | `Pollution.persistent_pollution` | | 1| -|142| `ppol` | `Pollution.persistent_pollution` | | 1| -|143| `ppolx` | `Pollution.persistent_pollution` | `Agriculture.land_fertility_degradation`, `Pollution.pollution_damage`, `Pop4.death_rate` | 4| -|144| `ppasr` | `Pollution.persistent_pollution` | | 1| -|145| `ahlm` | `Pollution.persistent_pollution` | | 1| -|146| `ahl` | `Pollution.persistent_pollution` | | 1| -|| `ppgf221` | `Pollution.adaptive_technological_control_cards` | | 1| -|| `ppgf222` | `Pollution.adaptive_technological_control_cards` | | 1| -|| `pcti` | `Pollution.adaptive_technological_control_cards` | | 1| -|| `plmp` | `Pollution.adaptive_technological_control_cards` | | 1| -|| `plmp1` | `Pollution.adaptive_technological_control_cards` | | 1| -|| `plmp2` | `Pollution.adaptive_technological_control_cards` | | 1| -|| `pctcm` | `Pollution.adaptive_technological_control_cards` | | 1| -|| `pctir` | `Pollution.adaptive_technological_control_cards` | | 1| -|| `lmp` | `Pollution.pollution_damage` | `Pollution.adaptive_technological_control_cards` | 2| -|| `lmp1` | `Pollution.pollution_damage` | | 1| -|| `lmp2` | `Pollution.pollution_damage` | | 1| -|| `lfdr` | `Pollution.pollution_damage` | | 1| -|| `lfdr1` | `Pollution.pollution_damage` | | 1| -|| `lfdr2` | `Pollution.pollution_damage` | | 1| -|147| `foa` | `SupplementaryEquations.supplementary_equations` | | 1| -|148| `foi` | `SupplementaryEquations.supplementary_equations` | | 1| -|149| `fos` | `SupplementaryEquations.supplementary_equations` | | 1| +| Name | Value | System | +| --- | --- | ------ | +| $\mathtt{ahl70}$ | $1.5$ | `Pollution` | +| $\mathtt{ai}$ | $5e9$ | `Agriculture` | +| $\mathtt{al}$ | $9e8$ | `Agriculture` | +| $\mathtt{alic}$ | $14$ | `NonRenewable` | +| $\mathtt{alic1}$ | $14$ | `Capital` | +| $\mathtt{alic2}$ | $14$ | `Capital` | +| $\mathtt{alsc1}$ | $20$ | `Capital` | +| $\mathtt{alsc2}$ | $20$ | `Capital` | +| $\mathtt{amti}$ | $1$ | `Pollution` | +| $\mathtt{cfood}$ | $250$ | `Population` | +| $\mathtt{cio}$ | $100$ | `Population` | +| $\mathtt{cso}$ | $150$ | `Population` | +| $\mathtt{dcfsn}$ | $4$ | `Population` | +| $\mathtt{fcest}$ | $4000$ | `Population` | +| $\mathtt{ffw}$ | $0.21$ | `Population` | +| $\mathtt{fioaa}$ | $0.12$ | `NonRenewable` | +| $\mathtt{fioac}$ | $0.43$ | `NonRenewable` | +| $\mathtt{fioac1}$ | $0.43$ | `Capital` | +| $\mathtt{fioac2}$ | $0.43$ | `Capital` | +| $\mathtt{fioas}$ | $0.12$ | `NonRenewable` | +| $\mathtt{fipm}$ | $0.001$ | `Pollution` | +| $\mathtt{frpm}$ | $0.02$ | `Pollution` | +| $\mathtt{gc}$ | $0.012$ | `NonRenewable` | +| $\mathtt{hsid}$ | $20$ | `Population` | +| $\mathtt{icor}$ | $3$ | `NonRenewable` | +| $\mathtt{icor1}$ | $3$ | `Capital` | +| $\mathtt{icor2}$ | $3$ | `Capital` | +| $\mathtt{ieat}$ | $3$ | `Population` | +| $\mathtt{iet}$ | $4000$ | `Capital` | +| $\mathtt{imef}$ | $0.1$ | `Pollution` | +| $\mathtt{imti}$ | $10$ | `Pollution` | +| $\mathtt{iopcd}$ | $400$ | `Capital` | +| $\mathtt{iphst}$ | $1940$ | `Population` | +| $\mathtt{len}$ | $28$ | `Population` | +| $\mathtt{lfert}$ | $600$ | `Agriculture` | +| $\mathtt{lfpf}$ | $0.75$ | `Capital` | +| $\mathtt{lpd}$ | $20$ | `Population` | +| $\mathtt{lt}$ | $2400$ | `Population` | +| $\mathtt{lt2}$ | $2400$ | `Population` | +| $\mathtt{lufdt}$ | $2$ | `Capital` | +| $\mathtt{mtfn}$ | $12$ | `Population` | +| $\mathtt{nri}$ | $1e12$ | `NonRenewable` | +| $\mathtt{nruf1}$ | $1$ | `NonRenewable` | +| $\mathtt{nruf2}$ | $1$ | `NonRenewable` | +| $\mathtt{pal}$ | $2.3e9$ | `Agriculture` | +| $\mathtt{pcti}$ | $1$ | `Pollution` | +| $\mathtt{pd}$ | $5$ | `Pollution` | +| $\mathtt{pet}$ | $4000$ | `Population` | +| $\mathtt{pfr}$ | $1$ | `Agriculture` | +| $\mathtt{pop2}$ | $4e9$ | `NonRenewable` | +| $\mathtt{popi}$ | $1.65e9$ | `NonRenewable` | +| $\mathtt{ppgf1}$ | $1$ | `Pollution` | +| $\mathtt{ppgf21}$ | $1$ | `Pollution` | +| $\mathtt{ppol70}$ | $1.36e8$ | `Pollution` | +| $\mathtt{pptd1}$ | $20$ | `Pollution` | +| $\mathtt{pptd2}$ | $20$ | `Pollution` | +| $\mathtt{ps}$ | $0$ | `Population` | +| $\mathtt{pt}$ | $1910$ | `Population` | +| $\mathtt{pyear}$ | $1975$ | `NonRenewable` | +| $\mathtt{pyear}$ | $1975$ | `Pollution` | +| $\mathtt{pyear}$ | $4000$ | `Capital` | +| $\mathtt{rlt}$ | $30$ | `Population` | +| $\mathtt{sad}$ | $20$ | `Population` | +| $\mathtt{scor1}$ | $1$ | `Capital` | +| $\mathtt{scor2}$ | $1$ | `Capital` | +| $\mathtt{sfpc}$ | $230$ | `Population` | +| $\mathtt{swat}$ | $0$ | `Pollution` | +| $\mathtt{tdd}$ | $10$ | `Pollution` | +| $\mathtt{uil}$ | $8.2e6$ | `Agriculture` | +| $\mathtt{zpgt}$ | $2500$ | `NonRenewable` | +| $\mathtt{zpgt}$ | $4000$ | `Population` | -## Constants +## Tables and ranges -To be copied from `parameters.jl`. +| Variable name | Table | Range | System | +| --- | --- | ------ | ------ | +| $\mathtt{ifpc1}$ | $(230.0, 480.0, 690.0, 850.0, 970.0, 1070.0, 1150.0, 1210.0, 1250.0)$ | $(0, 1600)$ | `Agriculture` | +| $\mathtt{ifpc2}$ | $(230.0, 480.0, 690.0, 850.0, 970.0, 1070.0, 1150.0, 1210.0, 1250.0)$ | $(0, 1600)$ | `Agriculture` | +| $\mathtt{fioaa1}$ | $(0.4, 0.2, 0.1, 0.025, 0.0, 0.0)$ | $(0.0, 2.5)$ | `Agriculture` | +| $\mathtt{fioaa2}$ | $(0.4, 0.2, 0.1, 0.025, 0.0, 0.0)$ | $(0.0, 2.5)$ | `Agriculture` | +| $\mathtt{dcph}$ | $(100000.0, 7400.0, 5200.0, 3500.0, 2400.0, 1500.0, 750.0, 300.0, 150.0, 75.0, 50.0)$ | $(0, 1)$ | `Agriculture` | +| $\mathtt{lymc}$ | $(1.0, 3.0, 3.8, 4.4, 4.9, 5.4, 5.7, 6.0, 6.3, 6.6, 6.9, 7.2, 7.4, 7.6, 7.8, 8.0, 8.2, 8.4, 8.6, 8.8, 9.0, 9.2, 9.4, 9.6, 9.8, 10.0)$ | $(0, 1000)$ | `Agriculture` | +| $\mathtt{lymap1}$ | $(1.0, 1.0, 0.7, 0.4)$ | $(0, 30)$ | `Agriculture` | +| $\mathtt{lymap2}$ | $(1.0, 1.0, 0.7, 0.4)$ | $(0, 30)$ | `Agriculture` | +| $\mathtt{fiald}$ | $(0.0, 0.05, 0.15, 0.3, 0.5, 0.7, 0.85, 0.95, 1.0)$ | $(0, 2)$ | `Agriculture` | +| $\mathtt{mlymc}$ | $(0.075, 0.03, 0.015, 0.011, 0.009, 0.009, 0.007, 0.006, 0.005, 0.005, 0.005, 0.005, 0.005, 0.005, 0.005, 0.005)$ | $(0, 600)$ | `Agriculture` | +| $\mathtt{llmy1}$ | $(1.2, 1.0, 0.63, 0.36, 0.16, 0.055, 0.04, 0.025, 0.015, 0.01)$ | $(0, 9)$ | `Agriculture` | +| $\mathtt{llmy2}$ | $(1.2, 1.0, 0.63, 0.36, 0.16, 0.055, 0.04, 0.025, 0.015, 0.01)$ | $(0, 9)$ | `Agriculture` | +| $\mathtt{uilpc}$ | $(0.005, 0.008, 0.015, 0.025, 0.04, 0.055, 0.07, 0.08, 0.09)$ | $(0, 1600)$ | `Agriculture` | +| $\mathtt{lfdr}$ | $(0.0, 0.1, 0.3, 0.5)$ | $(0, 30)$ | `Agriculture` | +| $\mathtt{lfrt}$ | $(20.0, 13.0, 8.0, 4.0, 2.0, 2.0)$ | $(0, 0.1)$ | `Agriculture` | +| $\mathtt{falm}$ | $(0.0, 0.04, 0.07, 0.09, 0.1)$ | $(0, 4)$ | `Agriculture` | +| $\mathtt{fioaa}$ | $(0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1)$ | $(1900, 2000)$ | `Capital` | +| $\mathtt{fioas2}$ | $(0.3, 0.2, 0.1, 0.05, 0.0)$ | $(0, 2)$ | `Capital` | +| $\mathtt{fioas1}$ | $(0.3, 0.2, 0.1, 0.05, 0.0)$ | $(0, 2)$ | `Capital` | +| $\mathtt{isopc1}$ | $(40.0, 300.0, 640.0, 1000.0, 1220.0, 1450.0, 1650.0, 1800.0, 2000.0)$ | $(0, 1600)$ | `Capital` | +| $\mathtt{isopc2}$ | $(40.0, 300.0, 640.0, 1000.0, 1220.0, 1450.0, 1650.0, 1800.0, 2000.0)$ | $(0, 1600)$ | `Capital` | +| $\mathtt{fioacv}$ | $(0.3, 0.32, 0.34, 0.36, 0.38, 0.43, 0.73, 0.77, 0.81, 0.82, 0.83)$ | $(0, 2)$ | `Capital` | +| $\mathtt{cuf}$ | $(1.0, 0.9, 0.7, 0.3, 0.1, 0.1)$ | $(1, 11)$ | `Capital` | +| $\mathtt{jpicu}$ | $(0.37, 0.18, 0.12, 0.09, 0.07, 0.06)$ | $(50, 800)$ | `Capital` | +| $\mathtt{jph}$ | $(2.0, 0.5, 0.4, 0.3, 0.27, 0.24, 0.2, 0.2)$ | $(2, 30)$ | `Capital` | +| $\mathtt{aiph}$ | $(5.0, 11.0, 21.0, 34.0, 58.0, 86.0, 123.0, 61.0, 23.0, 8.0, 3.0)$ | $(1900, 2100)$ | `Capital` | +| $\mathtt{al}$ | $(9.0, 10.0, 11.0, 13.0, 16.0, 20.0, 23.0, 24.0, 24.0, 24.0, 24.0)$ | $(1900, 2100)$ | `Capital` | +| $\mathtt{jpscu}$ | $(1.1, 0.6, 0.35, 0.2, 0.15, 0.15)$ | $(50, 800)$ | `Capital` | +| $\mathtt{pop}$ | $(1.65, 1.73, 1.8, 2.1, 2.3, 2.55, 3.0, 3.65, 4.0, 4.6, 5.15)$ | $(1900, 2000)$ | `Capital` | +| $\mathtt{fcaor}$ | $(0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05)$ | $(1900, 2000)$ | `Capital` | +| $\mathtt{pcrum}$ | $(0.0, 0.85, 2.6, 4.4, 5.4, 6.2, 6.8, 7.0, 7.0)$ | $(0, 1600)$ | `NonRenewable` | +| $\mathtt{fcaor1}$ | $(1.0, 0.9, 0.7, 0.5, 0.2, 0.1, 0.05, 0.05, 0.05, 0.05, 0.05)$ | $(0, 1)$ | `NonRenewable` | +| $\mathtt{fcaor2}$ | $(1.0, 0.9, 0.7, 0.5, 0.2, 0.1, 0.05, 0.05, 0.05, 0.05, 0.05)$ | $(0, 1)$ | `NonRenewable` | +| $\mathtt{ahlm}$ | $(1.0, 11.0, 21.0, 31.0, 41.0)$ | $(1, 1001)$ | `Pollution` | +| $\mathtt{pcrum}$ | $(17.0, 30.0, 52.0, 78.0, 138.0, 280.0, 480.0, 660.0, 700.0, 700.0, 700.0)$ | $(1900, 2100)$ | `Pollution` | +| $\mathtt{pop}$ | $(16.0, 19.0, 22.0, 31.0, 42.0, 53.0, 67.0, 86.0, 109.0, 139.0, 176.0)$ | $(1900, 2100)$ | `Pollution` | +| $\mathtt{aiph}$ | $(6.6, 11.0, 20.0, 34.0, 57.0, 97.0, 168.0, 290.0, 495.0, 845.0, 1465.0)$ | $(1900, 2100)$ | `Pollution` | +| $\mathtt{al}$ | $(9.0, 10.0, 11.0, 13.0, 16.0, 20.0, 24.0, 26.0, 27.0, 27.0, 27.0)$ | $(1900, 2100)$ | `Pollution` | +| $\mathtt{pctcm}$ | $(0.0, -0.05)$ | $(0, 0.1)$ | `Pollution` | +| $\mathtt{lmp1}$ | $(1.0, 0.99, 0.97, 0.95, 0.90, 0.85, 0.75, 0.65, 0.55, 0.40, 0.20)$ | $(0, 100)$ | `Pollution` | +| $\mathtt{lmp2}$ | $(1.0, 0.99, 0.97, 0.95, 0.90, 0.85, 0.75, 0.65, 0.55, 0.40, 0.20)$ | $(0, 100)$ | `Pollution` | +| $\mathtt{lfdr1}$ | $(0.0, 0.1, 0.3, 0.5)$ | $(0, 30)$ | `Pollution` | +| $\mathtt{lfdr2}$ | $(0.0, 0.1, 0.3, 0.5)$ | $(0, 30)$ | `Pollution` | +| $\mathtt{cmi}$ | $(0.5, 0.05, -0.1, -0.08, -0.02, 0.05, 0.1, 0.15, 0.2)$ | $(0, 1600)$ | `Population` | +| $\mathtt{fpu}$ | $(0.0, 0.2, 0.4, 0.5, 0.58, 0.65, 0.72, 0.78, 0.8)$ | $(0, 16e9)$ | `Population` | +| $\mathtt{hsapc}$ | $(0.0, 20.0, 50.0, 95.0, 140.0, 175.0, 200.0, 220.0, 230.0)$ | $(0.0, 2000.0)$ | `Population` | +| $\mathtt{lmf}$ | $(0.0, 1.0, 1.2, 1.3, 1.35, 1.4)$ | $(0.0, 5.0)$ | `Population` | +| $\mathtt{lmhs1}$ | $(1.0, 1.1, 1.4, 1.6, 1.7, 1.8)$ | $(0.0, 100.0)$ | `Population` | +| $\mathtt{lmhs2}$ | $(1.0, 1.4, 1.6, 1.8, 1.95, 2.0)$ | $(0.0, 100.0)$ | `Population` | +| $\mathtt{lmp}$ | $(1.0, 0.99, 0.97, 0.95, 0.9, 0.85, 0.75, 0.65, 0.55, 0.4, 0.2)$ | $(0.0, 100.0)$ | `Population` | +| $\mathtt{fm}$ | $(0.0, 0.2, 0.4, 0.6, 0.8, 0.9, 1.0, 1.05, 1.1)$ | $(0.0, 80.0)$ | `Population` | +| $\mathtt{cmple}$ | $(3.0, 2.1, 1.6, 1.4, 1.3, 1.2, 1.1, 1.05, 1.0)$ | $(0.0, 80.0)$ | `Population` | +| $\mathtt{sfsn}$ | $(1.25, 1.0, 0.9, 0.8, 0.75)$ | $(0.0, 800.0)$ | `Population` | +| $\mathtt{frsn}$ | $(0.5, 0.6, 0.7, 0.85, 1.0)$ | $(-0.2, 0.2)$ | `Population` | +| $\mathtt{fce}$ | $(0.75, 0.85, 0.9, 0.95, 0.98, 0.99, 1.0)$ | $(0.0, 3.0)$ | `Population` | +| $\mathtt{fsafc}$ | $(0.0, 0.005, 0.015, 0.025, 0.03, 0.035)$ | $(0.0, 10.0)$ | `Population` | +| $\mathtt{m1}$ | $(0.0567, 0.0366, 0.0243, 0.0155, 0.0082, 0.0023, 0.001)$ | $(20, 80)$ | `Population` | +| $\mathtt{m2}$ | $(0.0266, 0.0171, 0.0110, 0.0065, 0.0040, 0.0016, 0.0008)$ | $(20, 80)$ | `Population` | +| $\mathtt{m3}$ | $(0.0562, 0.0373, 0.0252, 0.0171, 0.0118, 0.0083, 0.006)$ | $(20, 80)$ | `Population` | +| $\mathtt{m4}$ | $(0.13, 0.11, 0.09, 0.07, 0.06, 0.05, 0.04)$ | $(20, 80)$ | `Population` | diff --git a/src/plotvariables.jl b/src/plotvariables.jl index 3ea19a2..1f1f8b7 100644 --- a/src/plotvariables.jl +++ b/src/plotvariables.jl @@ -19,7 +19,12 @@ function plotvariables(solution, xrange, variables::Vector{<:NTuple{3, Any}}; kw plotvariables(solution, xrange, map(t -> tuple(t..., ""), variables); kwargs...) end -function plotvariables(solution, xrange, variables::Vector{<:NTuple{4, Any}}; name="", showaxis=false, showlegend=true, linetype="lines", colored=false) +""" + `plotvariables(solution, xrange, variables::Vector{<:NTuple{4, Any}}; name="", showaxis=false, showlegend=true, linetype="lines", colored=false)` + +Plot the values of the variables in the vector `variables` obtained by the ODE system `solution` (normally, obtained by using the `solve` function in `solvesystems.jl`) in the specified `xrange` interval. For each variable, the vector `variables` includes a quadruple, containing the Julia variable, its range, and its symbolic name to be shown in the plot. +""" +function plotvariables(solution, xrange, variables::Vector{<:NTuple{4, Any}}; name="", showaxis=false, showlegend=true, linetype="lines", colored=false, save=false) numvars = length(variables) @assert 1 ≤ numvars @@ -89,5 +94,8 @@ function plotvariables(solution, xrange, variables::Vector{<:NTuple{4, Any}}; na ) end - plot(traces, Layout(layout)) + p = plot(traces, Layout(layout)) + save && savefig(p, "./" * name * ".svg") + + return p end diff --git a/src/solvesystems.jl b/src/solvesystems.jl index c7eacf7..66ddec8 100644 --- a/src/solvesystems.jl +++ b/src/solvesystems.jl @@ -1,6 +1,11 @@ using ModelingToolkit using DifferentialEquations +""" + `compose(systems::Vector{ODESystem}, connection_eqs::Vector{Equation})` + +Return the ODE system obtained by composing the ODE systems in the vector `systems` and by making use of the variable equalities in `connection_eqs`. Normally, each ODE systems in `systems` corresponds to a subsystem of a system in the World3 model, and the variable equalities specify which variables are shared between the subsystems. +""" function compose(systems::Vector{ODESystem}, connection_eqs::Vector{Equation}) @variables t @@ -10,6 +15,11 @@ function compose(systems::Vector{ODESystem}, connection_eqs::Vector{Equation}) return model end +""" + `solve(system::ODESystem, timespan; solver=Tsit5())` + +Return the solution of the `system` ODE system in the `timespan` interval (for the available different ODE system solvers, see the documentation of `DifferentialEquations.jl`). +""" function solve(system::ODESystem, timespan; solver=Tsit5()) sys = structural_simplify(system)