Find monotonic function with boundary constraints

176 Views Asked by At

I need to find a function $f(x) \in \mathbb{R}$ where $x \in [0, T]$ with the following conditions:

  • Monotonic function
  • Class $C^4$ i.e. differentiable at least 4 times
  • $f(0) = 0$
  • $f(T) = 1$
  • $\dot{f}(0) = 1$
  • $\dot{f}(T) = 1$
  • $\ddot{f}(0) = 0$
  • $\ddot{f}(T) = 0$
  • $\dddot{f}(0) = 0$
  • $\dddot{f}(T) = 0$
  • $\ddddot{f}(0) = 0$
  • $\ddddot{f}(T) = 0$

I tried with a polynomial function with high enough degree, imposing all the initial and final conditions, but it always come up non-monotonic. Any tip?

4

There are 4 best solutions below

3
On

Too long for a comment, but not a full solution.

This solution is quite complicated and only works for $T > 1$ (but should be modifiable for $T \in (0, 1)$), but it is the only one I have been able to come up. Note that for this function, the 4 above can be replaced by any other positive integer, i.e. the function is $C^{\infty}$ and $f^{(n)}(0) = f^{(n)}(L) = 0$ for all $n \in \mathbb N$, which suggest that there must be a simpler solution.

I started with $$ g_L \colon [0, L] \to [0, 1], \ x \mapsto \begin{cases} x, & \text{if } x \in \left[0, \frac{1}{2}\right), \\ \frac{1}{2}, & \text{if } x \in \left[\frac{1}{2}, L -\frac{1}{2}\right], \\ x - L + 1, & \text{if } x \in \left(L - \frac{1}{2}, L \right]. \end{cases} $$ Note that the value of $\frac{1}{2}$ is chosen pretty arbitrarily.

It looks like this (for $L = 2.2$): It clearly fulfils all above mentioned properties and is monotonically increasing, except not being differentiable at two points.

We now remedy this by "smoothing out the kinks". For the first kink (I leave the second one to you) consider $h(x) = \exp(-x^{-1}) \cdot \mathbb{1}_{x > 0}(x)$ and $p(x) := \frac{h(x)}{h(x) + h(1 - x)}$, which are in $C^{\infty}$ (but not analytical). Now consider the smoothed version $$ f_L \colon [0, L] \to [0, 1], \ x \mapsto \begin{cases} x, & \text{if } x \in \left[0, \frac{1}{4}\right), \\ \frac{1}{2} p\left(\frac{10 x + 1}{7}\right)\cdot p(5 - 5x), & \text{if } x \in \left[\frac{1}{4}, \frac{1}{2}\right), \\ \frac{1}{2}, & \text{if } x \in \left[\frac{1}{2}, L -\frac{1}{2}\right], \\ x - L + 1, & \text{if } x \in \left(L - \frac{1}{2}, L \right], \end{cases} $$ which looks like this I am not sure if $f_L$ is $C^{\infty}$ at $x = \frac{1}{4}$, but there definitely is a way to properly smoothen $g_L$ out.

3
On

Let us look for a polynomial $f$ satisfying the conditions. Let $\dot{f}=1+p$. Putting $p(x)=Ax^4(x-T)^4q(x)$ for some constant $A$, and $f(x)=\int_0^x 1+p(t)dt$, we satisfy all conditions but $f(T)=1$ and the monotonicity. The latter is satisfied iff $1+p(x)\ge 0$ for all $x\in [0,T]$.

One of the simplest choices for $q$ is to put $q\equiv 1$. Then we have $1=f(T)=T+\tfrac{AT^9}{630}$, which gives $A$. When $T\le 1$, $A\ge 0$ and all conditions are satisfied. If $A<0$ then the minimum $m=1+A\left(\tfrac T2\right)^8$ of $1+p(x)$ is attained when $x=\tfrac T2$. Then $m=\tfrac{315-187T}{128 T}$, and the conditions are satisfied when $m\ge 0$, that is when $T\le \tfrac {315}{187}$. It this range of $T$ sufficient for your needs or should we try to extend it using a more complex $q$?

A graph of $f$ for $T=\tfrac {315}{187}$:

enter image description here

0
On

This partial answers computes the optimal polynomial solutions for degrees up to $14$.

In order to work on a fixed-size interval, put $g(x)=\frac{f(Tx)}{T}$ for $x\in [0,1]$ (so that conversely, $p(t)=Tg(\frac{t}{T})$ for $t\in [0,T]$). Put also $h=g'$. Then the problem can be restated as : find a ${\cal C}^3$ map $h: [0,1]\to {\mathbb R}$ with $I(h)=\int_0^1 h(x)dx=\frac{1}{T}$ and

$$h\geq 0,h(0)=h(1)=1,h^{(k)}(0)=h^{(k)}(1)=0 \ (1\leq k\leq 3) \label{1}\tag{1}$$

Then, for a given $d$, if we denote by $P_d$ the set of all polynomials $h$ of degree $d$ satisfying \eqref{1}, define $m_d$ to be the inf of $I(h)$ when $h$ varies in $P_d$. Thus, $\frac{1}{m_d}$ will be the largest value of $T$ such that there is a degree-$d$ polynomial solution on $[0,T]$.

As noted in Alex Ravsky's answer, by \eqref{1} there is a polynomial $q$ such that $h(x)=1+((x(1-x)))^4q(x)$, and $q$ has degree $d_q=d-9$.

For each $d$ in the range $[9,14]$, we find a finite $S=S_d \subseteq [0,\frac{1}{2}]$ and nonnegative coefficients $(c_s)_{s\in S}$ such that the following identity holds for any $h$ of degree $\leq d$ satisfying \eqref{1}, by linear algebra :

$$ I(h)=m_d+\sum_{s\in S_d} c_s(h(s)+h(1-s)) \label{2}\tag{2} $$

Thus \eqref{2} shows that $I(h)\geq m_d$. It will be convenient in what follows to use the shorthand $z=x(1-x)$, and $\pi_S(x)=\prod_{s\in S,1-s\in S}(x-s)$ (note that the product is on a set not a multiset, so $\frac{1}{2}$ is counted only once).

When $d=9$ or $10$, we have $m_d=\frac{187}{315}\approx 0.59,S_d=\lbrace\frac{1}{2}\rbrace,c_s=\frac{64}{315}$ and $h=\pi_S^2(1+4z)(1+16z^2)$ is an optimal solution of degree $9$ in $x$.

When $d=11$ or $12$, we have $m_d=\frac{79747}{196875} \approx 0.4,S_d=\lbrace\alpha\rbrace$ where $\alpha$ is the smallest root of $\alpha^2-\alpha-\frac{5}{22}, c_\alpha=\frac{64}{315}$ and $h=\pi_S^2p^2(4(pz)^3+3(pz)^2+2(pz)+1)$ (where $p=\frac{22}{5}$) is an optimal solution of degree $11$ in $x$.

When $d=13$ or $14$, we have $m_d=\frac{71353}{240625} \approx 0.29, S_d=\lbrace\frac{1}{2},\alpha\rbrace$ where $\alpha$ is the smallest root of $\alpha^2-\alpha-\frac{5}{26}, c_{\frac{1}{2}}=\frac{256}{2079}, c_\alpha=\frac{1485172}{6496875}$ and $h=\pi_S^2\big(\frac{2377651456}{3125}z^3 + \frac{9377472}{625}z^2 + \frac{194688}{125}z + \frac{2704}{25}\big)$ is an optimal solution of degree $13$ in $x$.

Here's what the optimal solution in degree $13$ and its derivative look like (suitably rescaled) :

enter image description here

1
On

Follows a MATHEMATICA script which generates a polynomial feasible function. Here

n = polynomial degree, xmax = L, px = found polynomial

n = 11;
xmax = 1.7;
Clear[p, x, px]
p[x_] := Sum[Subscript[a, k] x^k, {k, 1, n}]
r1 = {D[p[x], x] - 1, D[p[x], x, x] - 0, D[p[x], x, x, x] - 0, D[p[x], x, x, x, x] - 0} /. {x -> 0};
r2 = {p[x] - 1, D[p[x], x] - 1, D[p[x], x, x] - 0, D[p[x], x, x, x] - 0, D[p[x], x, x, x, x] - 0} /. {x -> xmax};
rs = Join[r1, r2];
dx = 1/(2 n);
dp = D[p[x], x];
rest = Table[dp >= 1/n, {x, dx, xmax - dx, dx}];
restrs = Join[rest, Thread[rs == 0]];
vars = Table[Subscript[a, k], {k, 1, n}];
sol = FindInstance[restrs, vars];
If[Length[sol] > 0, {px = p[x] /. sol; Plot[px, {x, 0, xmax}], dpx = D[px, x]; Plot[{dpx, 0}, {x, 0, xmax}], px}, Print["Increase n"]
]

Constraints verification

{D[px, x] - 1, D[px, x, x] - 0, D[px, x, x, x] - 0,  D[px, x, x, x, x] - 0} /. {x -> 0}
{px - 1, D[px, x] - 1, D[px, x, x] - 0, D[px, x, x, x] - 0, D[px, x, x, x, x] - 0} /. {x -> xmax}
rest /. sol