Code used in generating the examples in the paper "Learning under uncertainty -- conservation of populations and persistence of dynamic resources through adaptive switching feedback controllers".
Simulation results 1: A density-dependent population withe measurement noise
- use file NL1TroutCod_noise to run the switching system on the trout cod model that is subject to measuremnt noise.
- Outputs: Figures 2 and 3.
- Subsection: Increasing the magnitude of noise
- use file NL1Troutcod_magnoise.m to run the switching system on the trout cod model that is subject to a range of noise magnitudes and switching thresholds.
- Outputs: Figure 4.
- Subsection: Uncertainty in initial conditions
- use file NL1TroutCod_manytau_Switch2_non3D with files manytau.mat, many_s.mat and many_x.mat to run the switching system on the trout cod model with 1000 different initial tau(1), s(0) and x_i(0) in turn.
- Outputs: Figures 5--7.
Simulation results 2: An Allen-Clark model
- use file SwitchingAllenClark.m to run the switching system on the Allen-Clark population model.
- Outputs: Figure 8.
Simulation results 3: A Pielou model with exponential term
- use the file Pielou_Miaozhang.m to run the switching system on the Pielou model with exponential term for two co-existing populations.
- Outputs: Figure 9.
Simulation results 4: Comparing different constructions of the switching system
- use file NL1Troutcod100ic_staux_wOR.m with files s_ics100rnd.mat, tau_ics100rnd.mat and x_ics100rnd.mat to run the 24 switching systems on the 100 sets of initial conditions.
- Outputs: Figures 10 and Figure 11 in the main text, as well as all the figures in the Supplementary Material.