Numerical Solution: Minimise $d=\sqrt{x^2+y^2}$

74 Views Asked by At

I am trying to find the time of greatest solar eclipse for the forthcoming Eclipse on August 21st.

I have 2 polynomials

$$x = at^3+bt^2+ct+d \\ y = et^3+ft^2+gt+h$$

$a,b,c,d,e,f,g,h$ are constants published by NASA and $t$ is the time of the eclipse

Numeric differentiation gives

$$dx = 3at^2+2bt+c \\ dy = 3et^2+2ft+g$$

Now... the maximum eclipse is when the shadow cone is nearest to the origin on the fundamental plane which is simply when minimum of $\sqrt{x^2+y^2}$

I would like to use a method like Newton Raphson... but I have no idea how I get $d/dt$ of $\sqrt{x^2+y^2}$

Please can someone point me in the right direction. Thanks in advance

2

There are 2 best solutions below

0
On BEST ANSWER

$$\frac{\mathrm{d}}{\mathrm{d}t} \sqrt{x^2 + y^2} = \frac{1}{2\sqrt{x^2+ y^2}}\left(2x\frac{\mathrm{d}x}{\mathrm{d}t}+2y\frac{\mathrm{d}y}{\mathrm{d}t}\right)$$

1
On

Minimizing $D$ is the same as minimizing $D^2$. So, if $$x = at^3+bt^2+ct+d \qquad\text{and}\qquad y = et^3+ft^2+gt+h$$ you look for the minimum of $$D^2= \left(a^2+e^2\right)t^6+ (2 a b+2 e f)t^5+\left(2 a c+b^2+2 e g+f^2\right)t^4 +2 (a d+b c+e h+f g)t^3+\left(2 b d+c^2+2 f h+g^2\right)t^2 + (2 c d+2 g h)t+(d^2+h^2)$$ Differentiate with respect to $t$ to get a polynomial in $t^5$. Plot the derivative to get a vague idea where it cancels and start Newton iterations for polishing the root.

This will give you $t$ and then $x$ and $y$.

Edit

Looking at the numbers you kindly provided, it seems that you could ignore all terms with powers greater than $2$ which will reduce the derivative to a linear equation. The result will be very accurate.