Skip to content

Commit 4b9bd6e

Browse files
committed
Add daisyworld 2D model
1 parent 6ae1013 commit 4b9bd6e

File tree

2 files changed

+50
-4
lines changed

2 files changed

+50
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "PredefinedDynamicalSystems"
22
uuid = "31e2f376-db9e-427a-b76e-a14f56347a14"
33
repo = "https://github.com/JuliaDynamics/PredefinedDynamicalSystems.jl.git"
4-
version = "1.5"
4+
version = "1.6"
55

66
[deps]
77
DynamicalSystemsBase = "6e36e845-645a-534a-86f2-f5d4aa5a06b4"

src/continuous_famous_systems.jl

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ function chua_element_derivative(x, m0, m1)
9595
return m1 + 0.5 * (m0 - m1) * (-1 < x < 1 ? 2 : 0)
9696
end
9797

98-
99-
10098
"""
10199
```julia
102100
roessler(u0=[1, -2, 0.1]; a = 0.2, b = 0.2, c = 5.7)
@@ -2165,7 +2163,7 @@ A = 2.06, B = −2.6, C = 0.4, D = 1.0, E = 0.4
21652163
Multistable states in a predator–prey model with generalized Holling type III functional response and a strong Allee effect.
21662164
Communications in Nonlinear Science and Numerical Simulation, Volume 131, 107846
21672165
"""
2168-
function tristable_predator_prey(u0 = [0.5, 0.5]; A = 2.06, B = 2.6, C = 0.4, D = 1.0, E = 0.4)
2166+
function tristable_predator_prey(u0 = [0.5, 0.5]; A = 2.06, B = -2.6, C = 0.4, D = 1.0, E = 0.4)
21692167
function zeng_yu_2024(u, p, t)
21702168
A, B, C, D, E = p
21712169
x, y = u
@@ -2178,4 +2176,52 @@ function tristable_predator_prey(u0 = [0.5, 0.5]; A = 2.06, B = −2.6, C = 0.4,
21782176
diffeq = (abstol = 1e-9, rtol = 1e-9)
21792177
ds = CoupledODEs(zeng_yu_2024, u0, p; diffeq)
21802178
return ds
2179+
end
2180+
2181+
2182+
"""
2183+
```julia
2184+
daisyworld(u0 = [0.01, 0.01]; S = 1.0, A_b = 0.25, A_w = 0.75, A_g = 0.5, T_opt = 22.5, delta = 17.5, gamma = 0.3, q = 0.2, L = 1.0)
2185+
```
2186+
The continuous time Daisyworld model [^WatsonLovelock1983].
2187+
The model describes the coupled evolution of black and white daisy populations,
2188+
whose growth rates depend on local temperature, which is affected by planetary albedo.
2189+
2190+
Variables 1,2 are white and black daisies respectively.
2191+
2192+
Parameters:
2193+
- `S`: Solar constant (relative luminosity)
2194+
- `A_b`, `A_w`, `A_g`: Albedos of black, white daisies, and bare ground
2195+
- `T_opt`: Optimal temperature for growth (°C)
2196+
- `delta`: Width of growth temperature window
2197+
- `gamma`: Death rate
2198+
- `q`: Heat transport parameter
2199+
- `L`: Luminosity (scaling factor)
2200+
2201+
[^WatsonLovelock1983]:
2202+
Watson, A. J., & Lovelock, J. E. (1983).
2203+
Biological homeostasis of the global environment: the parable of Daisyworld.
2204+
Tellus B: Chemical and Physical Meteorology, 35(4), 284-289.
2205+
"""
2206+
function daisyworld(u0 = [0.01, 0.01]; S = 1.0, A_b = 0.25, A_w = 0.75, A_g = 0.5, T_opt = 22.5, delta = 17.5, gamma = 0.3, q = 0.2, L = 1.0)
2207+
p = [S, A_b, A_w, A_g, T_opt, delta, gamma, q, L]
2208+
return CoupledODEs(daisyworld_rule, u0, p)
2209+
end
2210+
2211+
@inbounds function daisyworld_rule(u, p, t)
2212+
a_b, a_w = u[1], u[2]
2213+
S, A_b, A_w, A_g, T_opt, delta, gamma, q, L = p
2214+
a_g = 1.0 - a_b - a_w
2215+
# Planetary albedo
2216+
A = a_b * A_b + a_w * A_w + a_g * A_g
2217+
# Local temperatures (simplified, in °C)
2218+
T_b = q * S * L * (1 - A_b) - 273.15
2219+
T_w = q * S * L * (1 - A_w) - 273.15
2220+
# Growth rates (parabolic dependence)
2221+
beta_b = max(0.0, 1.0 - ((T_opt - T_b)/delta)^2)
2222+
beta_w = max(0.0, 1.0 - ((T_opt - T_w)/delta)^2)
2223+
# ODEs
2224+
da_b = a_b * (beta_b * a_g - gamma)
2225+
da_w = a_w * (beta_w * a_g - gamma)
2226+
return SVector{2}(da_b, da_w)
21812227
end

0 commit comments

Comments
 (0)