Solving for x in a specific range

45 Views Asked by At

I am trying to find the minimum value, analytically, of a somewhat complicated function, and I've been struggling with it all day. It's complicated (to me) as the function is a sum of a periodic function (in $x$) and a function that is not periodic:

$$ f =\frac{\alpha}{L^2}\left[\cos^2 \left( \frac{\pi x}{L}-\frac{\pi}{2} \right) \right]^{-1} + \frac{\beta}{L^{3/2}}x^{-1/2} .$$

My approach has simply been taking the derivative and setting it to zero,

$$ \frac{df}{dx} = 0 $$

and then solving for $x$. First I considered each part individually as a sanity check. The right-hand side of the expression does not have a minimum (which makes sense), and the left-hand side does not have a global minimum, but rather periodic local minima with solutions,

$$ x = L \left( n - \frac{1}{2} \right) $$

where $n$ is the periodicity (I'm actually not sure how to solve for this, but it makes sense -- Thanks WolframAlpha). $f$ should have local minima though, and this is where I am running into some issues.

For the entire function, I can do the derivative,

$$ - \frac{\alpha}{L^3} \cot\left( \frac{\pi x}{L} \right) \csc^2\left( \frac{\pi x}{L} \right) - \frac{\beta}{L^{3/2}} \frac{1}{2x^{3/2}} = 0$$

but I am not able to solve for $x$. This makes sense as the minimum would now be different for each period, so taking the derivative of $f$ for an unspecified range would not make a ton of sense. I've been trying to think of a "work around".

I am only really interested in the range from $0$ to $L$ and there should be a minimum within that range. Just considering the range from $0$ to $L$, then the solution to the left-hand side should be,

$$ x = \frac{L}{2} $$

(this is intuitive) but I don't know how to actually solve $df/dx=0$ for $x$ in a specific range.

Any pointers would be greatly appreciated.

Jason

1

There are 1 best solutions below

1
On BEST ANSWER

Simplifying the cosine and making $\frac{\pi x}{L}=t$, we end with $$g(t)=\frac 1{L^2}\left(\alpha \csc ^2(t)+ \frac{\beta\sqrt{\pi } }{\sqrt{t}} \right)$$ Differentiating with respect to $t$ what is inside the parentheses, we then need to solve $$\frac{\sqrt{\pi } \beta }{2 t^{3/2}}+2 \alpha \cot (t) \csc ^2(t)=0$$ that is to say $$t^{3/2} \cot (t) \csc ^2(t)=k \qquad \text{with} \qquad k=-\frac{\sqrt{\pi } \beta }{4 \alpha }$$ and, according to what you wrote, you are only concerned by the range $0 \leq t \leq \pi$.

If $k >0$ and large, using Taylor expansion around $t=0$, we have $$t^{3/2} \cot (t) \csc ^2(t)=\frac{1}{t^{3/2}}-\frac{t^{5/2}}{15}+O\left(t^{9/2}\right)$$ So, a very first approximation could be $$ t\sim k^{-2/3}$$ Trying for $k=12.345$, the approximation would give $t \sim 0.187214$ while the solution given by Newton method is $0.187204$

If $k$ is small, using Taylor expansion around $t=\frac \pi 2$, we have $$t^{3/2} \cot (t) \csc ^2(t)=-\frac{\pi ^{3/2} \left(t-\frac{\pi }{2}\right)}{2 \sqrt{2}}-\frac{3}{2} \sqrt{\frac{\pi }{2}} \left(t-\frac{\pi }{2}\right)^2+O\left(\left(t-\frac{\pi}{2}\right)^3\right)$$ and using the first term only, the estimate $$t \sim \frac{\pi }{2}-\frac{2 \sqrt{2} k}{\pi ^{3/2}}$$ Trying for $k=1.2345$, the approximation would give $t \sim 0.943733$ while the solution given by Newton method is $0.844008$

Trying for $k=-1.2345$, the approximation would give $t \sim 2.19786$ while the solution given by Newton method is $1.94590$

Now, if $k <0$ and large, using Taylor expansion around $t=\pi$, we have $$t^{3/2} \cot (t) \csc ^2(t)=\frac{\pi ^{3/2}}{(t-\pi )^3}+\frac{3 \sqrt{\pi }}{2 (t-\pi )^2}+\cdots$$ and then an estimate $$t\sim \frac{\sqrt{\pi }}{\sqrt[3]{k}}+\pi$$ Trying for $k=-12.345$, the approximation would give $t \sim 2.37468$ while the solution given by Newton method is $2.46583$.

As approximations, this does not look too bad and, using them as initial guesses, Newton method would converge quite fast.