[SciPy-User] Scipy dblquad Calculation
Wed Feb 24 19:48:36 CST 2010
Warren Weckesser <warren.weckesser <at> enthought.com> writes:
> As you suspected, the problem is your use of arctan, and an appropriate
> use of arctan2 can correct it. If I change this:
> t*scipy.sin(theta +
> to this:
> t*scipy.sin(theta + scipy.arctan2(
> a**2.0*scipy.cos(theta), b**2.0*scipy.sin(theta)) )
> then the results agree.
Ah, excellent. Thank you very much for your help Warren! When I tried using
arctan2, I didn't think about breaking up tangent into its sine and cosine
components and instead kept it as tangent or cotangent in the numerator or
denominator, as appropriate.
More information about the SciPy-User