0

Am formulating an equation like this:

Dmax = 10000 meter (assumed max width of city)
B = 2500 (number of people in a building)

Distance1 = 10 (distance from a point in the city to B)
Distance2 = 500 (distance from a point in the city to B)
Distance3 = 0.01 (distance from a point in the city to B)
Distance4 = 0 (distance from a point in the city to B)

Dfactor = Distance / Dmax
Dfactor1 = 10/10000 = 0.001
Dfactor2 = 500/10000 = 0.05
Dfactor3 = 0.01/10000 = 0.000001
Dfactor4 = 0/10000 = 0

f = B * Dfactor
f1 = 2500 * 0.001 = 2.5
f2 = 2500 * 0.05 = 125
f3 = 2500 * 0.000001 = 0.0025
f4 = 2500 * 0 = 0

I need f (flow rate) to decrease when the distance increases. ie: people would be less likely to travel far to reach building B.

Problem is, if I use f = B / Dfactor, then there's the danger of divide by zero and there's also the danger of the numerator becoming extremely huge, like in the case of f3 if 0.000001 were in the denominator.

Is there a better way to have distance as a factor which decreases the likelihood of people 'flowing' to a building?

Nav
  • 368

1 Answers1

1

Try f = B / (Dfactor + 1)

For large values of 'Dfactor' it won't make much difference. For small values it will eliminate the chance of dividing by zero and will reduce the effect of small changes.

Effectively you are translating the curve to eliminate a singularity...

tomi
  • 9,594
  • That's really cool. To make the value of f fall more dramatically with the increase of distance, I guess I'd just have to use an e^Dfactor +1 in the denominator. – Nav Nov 28 '16 at 15:49