0

I'm working on a method to predict certain things to change, for this i need to create a function with the following parameters:

  • av: Average; >= 0
  • max: Maximum value; < av; can be much larger than av
  • v - Value; > 0; < max

The function needs to end up between 0 and 1 and i want to calculate a smooth curve with most increase around av. My first approach has been to first solve both problems independently, however getting both combined is where i fail as linear interpolation of course doesn't work and f(v) must be always greater than previous numbers as the v raises.

What i currently have:

$\left(\frac{v}{av}\right)^{2}$

$1-\left(\frac{max-v}{max-av}\right)^{2}$

Felix K.
  • 101
  • $\arctan x$ has maximum increase around 0, then $\arctan(x-av)$ will have maximum increase around $av$. – Ivan Kaznacheyeu Jun 06 '22 at 10:56
  • If I understand correct then requirements are the following: 1. $f(x)$ is smooth in $[0;1]$. 2. $f(x)$ is increasing. 3. $f'(x)$ is maximal at $x=av$. Then what is $max$? – Ivan Kaznacheyeu Jun 06 '22 at 11:01
  • @IvanKaznacheyeu max is the maximum value v can reach, so basically v can have 0 to max. – Felix K. Jun 06 '22 at 11:08
  • $v$ is argument of function? $[0;1]$ is not domain but codomain? 1. $f(x)$ is smooth and increasing in $[0;max]$. 2. $0\leq f(x)\leq 1$ for all $x\in[0;max]$. 3. $f'(x)$ is maximal at $x=av$, where $0<av<max$. $f(x)=\frac{\arctan(x-av)-\arctan(-av)}{\arctan(max-av)-\arctan(-av)}$. – Ivan Kaznacheyeu Jun 06 '22 at 11:14
  • @IvanKaznacheyeu That's that what i wanted, feel free to put it as answer. – Felix K. Jun 06 '22 at 14:25
  • @IvanKaznacheyeu Just found out that this works excellent on large numbers but actually is not exactly working with small numbers ( like av=0.35m; max=3.4 ), is there a way to fix it? Of course i could multiply my numbers to fix it. – Felix K. Jun 06 '22 at 16:59
  • @IvanKaznacheyeu Okay forget what i've said, i just scaled the number up so that average always is 2. – Felix K. Jun 06 '22 at 21:51

0 Answers0