Help reconstructing two functions from their graphs

39 Views Asked by At

I am reading the paper PROPAGATOR: An Operational Cellular-Automata Based Wildfire Simulator, and there are some simple(ish) graphs here. But there is no documentation of the equations used to create these graphs. I emailed the original author, but no answer. The first one is relatively simple, while the second one seems to be a bit more complicated. How can I reconstuct the functions used to create these graphs?

1. $$ \alpha_h = f(slope) $$

enter image description here

Here I need alpha as a function of slope. The flattness around s = 0 is not crucial, but a nice to have. However, the asymptotes beginning around s = -50 and 50, occurring at alpha = -0.5 and 2 are fairly important.

2. $$ \alpha_w = f(speed_{wind}, direction_{wind}) $$

enter image description here

Obviously this one is a bit more involved. I need alpha as a function of wind speed and direction. While it involves 2 parameters, it seems that they are all variations on a theme of the bell curve, attenuated based on wind speed.

I'm a bit rusty in math and I'm not sure where to begin guessing at these formulas. Thank you!

1

There are 1 best solutions below

0
On BEST ANSWER

I doubt this will help anyone out specifically, but I spoke to a mathy friend and he helped me come up with some equations to approximate these graphs.

  1. $$0.5 + 0.75 * \frac{1}{e^{\frac{-x^{3}}{30000}} + 0.5}$$

This came after the realization that the first graph goes like: $$\frac{1}{e^x + 0.5}$$

Playing with the constants, I am relatively close to graph 1, which is close enough for what I need. In code:

const alphaSlope = (slope: number) => {
    return (
        0.5 + 0.75 * (1 / (Math.pow(Math.E, -Math.pow(slope, 3) / 30000) + 0.5))
    );
};
  1. Each graph here is a bell curve, easily approximated by $$\frac{1}{e^{direction_{wind}^2}}$$

However, this is a 2 parameter function, with wind speed shaping the amplitude, width, and floor of the curve. I found that the following coefficients work to get me close to the series of graphs in the figure:

$$(1 + 3*\frac{speed_{wind}}{100}) * \frac{1}{e^{(\frac{10^(speed_{wind}/100)}{100} * direction_{wind})^2}} + (1-\frac{speed_{wind}}{100})$$

Its a lot to look at in math format, but its more easily digested in code:

// javascript:

const alphaWind = (direction, speed) => {
    if (speed === 0) {
        return 1;
    }
    /**
     * Scaling factor, based on speed, helps determine bell amplitude and yShift
     */
    const s = speed / 100;
    /**
     * The 'floor' of the bell curve.  1 for speed = 0 km/h, drops to 0 for speed >= 100 km/h
     */
    const yShift = speed > 100 ? 1 - s : 0;
    /**
     * The amplitude of the curve. 1 for speed = 0 km/h, rises to 4+ for speed = 100 km/h
     */
    const amplitude = 1 + 3 * s;
    /**
     * The width of the bell curve, not at any specific height, determined by trial and error
     * Roughly 300 at speed = 0 km/h and 50-60 at speed = 100 km/h
     */
    const width = Math.pow(10, speed / 100) / 100;

    return amplitude / Math.pow(Math.E, (width * direction) ** 2) + yShift;
};