Determining length of curve with polar coordinates with constant slope

68 Views Asked by At

First question on Mathematics. Please be gentle!

I have two sets of polar coordinates. A curve connects them with the radius changing at a constant rate from $radius_0$ to $radius_1$.

I need to determine:

  • Coordinates for the point on the curve $L$ distance away from the starting point. ($L=0.1$ in my situation)
  • (Optionally) The length of the entire curve

I know that, generally, the length is determined with this equation:

$$ ds = \sqrt{r^2 + \left(\frac{dr}{d\theta}\right)^2} d\theta . $$

My problem is that I'm programming a microcontroller (a very tiny processor) that can't integrate. I can solve by hand for individual coordinates, but I get stuck when trying to generalize it.

Thanks, in advance, for any help you can offer here.

Here's a visual example of a curve described by the two coordinates $(0, 0)$ and $(4\pi, 4\pi)$, where coordinates represent $(r,\theta)$. In this example, the slope is $1$ (i.e. the radius is always equal to the radians). In my specific situation, I'm guaranteed that the radius is always between $0$ and $1$.

1

There are 1 best solutions below

1
On BEST ANSWER

If we consider the case of the Archimedian spiral, what you want is to inverse the equation $$L=\frac{a}{2}\left[\theta\,\sqrt{1+\theta^2}+\log \left(\theta+\sqrt{1+\theta^2} \right)\right]$$

Let $k=\frac {2L}a$ and consider that we look for the zero of $$f(\theta)=\theta\,\sqrt{1+\theta^2}+\log \left(\theta+\sqrt{1+\theta^2} \right)-k$$ For sure, this will require a nmerical method and the problem is to find a reasonable starting point.

If we assume that $k$ is large, we can expand the function as series $$f(\theta)=\theta^2+\left(\log (2 \theta)+\frac{1}{2}\right)+\frac{1}{8 \theta^2}+O\left(\frac{1}{\theta^4}\right)-k$$

So, a very first approximation would be $\theta_0=\sqrt k$.

A much better one $$\theta^2+\left(\log (2 \theta)+\frac{1}{2}\right)=k \implies \theta_1=\sqrt{\frac{1}{2} W\left(\frac{1}{2} e^{2 k-1}\right)}$$ where $W(.)$ is Lambert function.

For example, using $k=1234$, this would give $\theta_0=35.1283$ and $\theta_1=35.0607$ while the "exact" solution is $\theta=35.0607$ (!!).

If you need to polish the root, use Newton method and the iterates will be $$\theta_{n+1}=\frac{\theta_n\,\sqrt{1+\theta_n^2}-\log \left(\theta_n+\sqrt{1+\theta_n^2} \right)+k } {2\sqrt{1+\theta_n^2} }$$ Starting with the simplest estimate $\theta_0$, the iterates would be $$\left( \begin{array}{cc} n & \theta_n \\ 0 & 35.12833614 \\ 1 & 35.06072218 \\ 2 & 35.06065703 \\ 3 & 35.06065703 \end{array} \right)$$

The second case would correspond to small values of $k$. Doing the same $$f(\theta)=2\theta+\frac{1}{3}\theta^3+O\left(t^5\right)-k$$

So, a very simple estimate would be $\theta_0=\frac k 2$. You could make it better solving the cubic equation $$\theta_1=2 \sqrt{2} \sinh \left(\frac{1}{3} \sinh ^{-1}\left(\frac{3 k}{4 \sqrt{2}}\right)\right)$$

Using $k=12.34$, , this would give $\theta_0=6.17$ and $\theta_1=2.74032$ while the "exact" solution is $\theta=3.15976$.

Edit

If you consider the case of the general Archimedian spiral $$r=a+b \theta^{\frac 1c}$$ you cannot integrate except if $a=0$. If this is the case, you will face a nightmare since $$L=b t^{\frac{1}{c}} \, _2F_1\left(-\frac{1}{2},\frac{1}{2 c};1+\frac{1}{2 c};-c^2 t^2\right)$$ where appears the gaussian hypergoemetric function and there is no hope for any approximation.