tutil.c: change default size distribution parameter for powerlaw - granular - granular dynamics simulation
(HTM) git clone git://src.adamsgaard.dk/granular
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit d39c304d632258fd9a5bd0f381b669952ca98642
(DIR) parent 607fe3c83b742cd3a6c0d8574c973ec24a4ed991
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Thu, 18 Mar 2021 12:47:38 +0100
util.c: change default size distribution parameter for powerlaw
Diffstat:
M util.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/util.c b/util.c
t@@ -99,8 +99,9 @@ random_value_uniform(double min, double max)
}
double
-random_value_powerlaw(double power, double min, double max)
+random_value_powerlaw(double min, double max)
{
+ double power = -1.8;
return pow((pow(max, power + 1.0) - pow(min, power + 1.0)) * random()
+ pow(min, power + 1.0), 1.0 / (power + 1.0));
}