Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You're not going to find an analytic solution to these equations because they're transcendental, containing <code>a</code> both inside and outside of a trigonometric function.</p> <p>I think the trouble you're having with numerical solutions is that the range of acceptable values for <code>a</code> is constrained by the <code>arcsin</code>. Since <code>arcsin</code> is only defined for arguments between -1 and 1 (assuming you want <code>a</code> to be real), your formulas for <code>alpha</code> and <code>beta</code> require that <code>a &gt; s/2</code> and <code>a &gt; (s-c)/2</code>.</p> <p>In Python, you can find a zero of your third equation (rewritten in the form <code>f(a) = 0</code>) using the <code>brentq</code> function:</p> <pre><code>import numpy as np from scipy.optimize import brentq s = 10014.6 c = 6339.06 mu = 398600.0 dt = 780.0 def f(a): alpha = 2*np.arcsin(np.sqrt(s/(2*a))) beta = 2*np.arcsin(np.sqrt((s-c)/(2*a))) return alpha - beta - (np.sin(alpha)-np.sin(beta)) - np.sqrt(mu/a**3)*dt a0 = max(s/2, (s-c)/2) a = brentq(f, a0, 10*a0) </code></pre> <p><strong>Edit:</strong></p> <p>To clarify the way <code>brentq(f,a,b)</code> works is that it searches for a zero of <code>f</code> on an interval <code>[a,b]</code>. Here, we know that <code>a</code> is at least <code>max(s/2, (s-c)/2)</code>. I just guessed that 10 times that was a plausible upper bound, and that worked for the given parameters. More generally, you need to make sure that <code>f</code> changes sign between <code>a</code> and <code>b</code>. You can read more about how the function works in the <a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.brentq.html" rel="nofollow">SciPy docs</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload