[SciPy-User] Scipy dblquad Calculation

Scott Barlow Spectre158@gmail....
Wed Feb 24 19:48:36 CST 2010


Warren Weckesser <warren.weckesser <at> enthought.com> writes:
> 
> Scott,
> 
> 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 + 
> scipy.arctan((a**2.0/b**2.0)*(1.0/scipy.tan(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.
> 
> Warren
> 

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.

Thanks,
Scott




More information about the SciPy-User mailing list