Robinlovelace / simodels

https://robinlovelace.github.io/simodels
GNU Affero General Public License v3.0
15 stars 4 forks source link

Implement basic gravity model, e.g. as `si_gravity()` #26

Open Robinlovelace opened 2 years ago

R-icntay commented 2 years ago

Happy to help!

Just to run this with @Robinlovelace , @adamdennett

This is what we would be implementing, right? The total unconstrained model?

$T_{ij} = k V_i^\mu Wj^\alpha d{ij}^-\beta$

Robinlovelace commented 2 years ago

Yes, that looks like the one!

$\mu \alpha \beta$

Can be set to 1 by default I think so it would be something like...

Robinlovelace commented 2 years ago
si_gravity = function(v, w, k = 1, mu = 1, alpha = 1, beta = 1) {
  # ...
}

Does that make sense? I may well be missing something!

adamdennett commented 2 years ago

Yeah, that will do for a basic model, although set beta to -1 rather than 1 in any initial model. K can also be calculated simply as all flows in the system / the rest of the model, but 1 as a starter is fine

Robinlovelace commented 2 years ago

Thanks Adam for this key input!