I need a differentiable function whose plot is a plateau and the steepness and width can be varied arbitrarily and easily

3.1k Views Asked by At

I need to model the solar radiation incident on a solar panel. I tried using $$\tanh(b*(x-a))-\tanh(b*x)$$ but it does not give me a lot of flexibility with the characteristics of the curve, namely width of the plateau and its steepness.

1

There are 1 best solutions below

0
On

I would suggest taking a normal distribution and inserting a constant value for the length of your plateau. This is the normal distribution, multiplied by a constant factor: $$f(\sigma, \mu ,h, x) = h\cdot \frac{1}{\sigma\sqrt{2\pi}} e^{ -\frac{(x-4)^2}{2\sigma^2} }$$ Now lets define $$ p(\sigma,\mu,h,x) = \begin{cases} f(\sigma,\mu,h,x) \quad \text{if }x<-\mu \\ \frac{h}{\sigma \sqrt{2\pi}} \quad \text{if }-\mu\leq x \leq \mu \\ f(\sigma,\mu,h,x) \quad \text{if }x<-\mu \\ \end{cases} $$

This function is continous on $\mathbb{R}$ and can easily be scaled. For different width you can modify $\mu$, and the height can be modified by $h$ and $\sigma$. The steepness can be varied by $\sigma$.