Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-species Klausmeier #63

Open
jpfairbanks opened this issue Aug 12, 2024 · 1 comment
Open

Multi-species Klausmeier #63

jpfairbanks opened this issue Aug 12, 2024 · 1 comment

Comments

@jpfairbanks
Copy link
Member

I worked this out for the Roe PR #62 as an example, but I think it is a nice example for the Klausmeier docs page:

# See Klausmeier Equation 2.a
Hydrodynamics = @decapode begin
  (w, consumption)::DualForm0
  dX::Form1
  (a,ν)::Constant
  ∂ₜ(w) == a - w - consumption + ν * L(dX, w)
end

# See Klausmeier Equation 2.b
Phytodynamics = @decapode begin
  (n,w)::DualForm0
  m::Constant
  consumption = w * n^2
  ∂ₜ(n) == consumption - m*n + Δ(n)
end

Superposition = @decapde begin
  total = part1 + part2
end

compose_klausmeier = @relation () begin
  phyto(N1, W, consumption1)
  phyto(N2, W, consumption2)
  superposition(consumption, consumption1, consumption2)
  hydro(consumption, W)
end

klausmeier_cospan = oapply(compose_klausmeier,
                           [Open(Phytodynamics, [:consumption, :w]), Open(Phytodynamics, [:consumption, :w])
                            Open(Hydrodynamics, [:total, :part1, :part2]),
                            Open(Hydrodynamics, [:consumption, :w])])
Klausmeier = apex(klausmeier_cospan)
@lukem12345
Copy link
Member

lukem12345 commented Aug 12, 2024

The thing to check is that this conserves mass. A particular test is this: if one were to split the density field for a plant species in half, and then duplicate it, will the expression result in the same dynamics.

Water depletion in the original model is quadratic in plant density in an area, times the water density in an area. You could implement some "normalized plant density" term. But in any regard, I would be cautious about using the term "superposition" without verifying that this indeed exhibits superpositioning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants