I have written this function in python:
import math
def radical(a, b, k):
return (1-((a**2-b**2)/a**2)*(math.sin(math.pi*(2*k-1)/180))**2)**.5
def f(a, b):
sigma = 0
for k in range(1,180/4):
sigma = sigma + radical(a, b, k)
return 8*a*math.sin(math.pi/180)*sigma
print f(25.,35.)
When I calculate this function in Wolphramapha and Maple I will get 189.797 but with python I will get 184.91089913 What is the problem in my program?
sympy?