TypeError: fsolve: there is a mismatch between the input and output shape of the 'func' argument 'my_function'
pueden ayudarme aqui le spongo todo el codigo que tengo
saludos y gracias de antemano
Código Python:
Ver original
def my_function(fi): from math import pi,sqrt,tan,sin,cos from numpy import array, radians m = 2.5 z = 22 beta = radians(16.) alfa = radians(20.) x = 0. c = 0.25 f = 1. fr = 0.4 rp = (m*z/cosd(beta))/2. ro = rp - m * (f + c - x) so = 2. * ro * (((pi/2. + 2.*x*tan(alfa))/z)+(tan(alfa)-alfa)) l = pi/4. * m he = (f + c) * m rc = fr * m s = x * m d = he - rc - s PA = l + (rc/cos(alfa)) + (he -rc)*tan(alfa) Gama = radians(PA/rp) Beta = radians(so / (2.*ro)) fi_e = radians(fi[0]) fi_t = radians(fi[1]) E1 = ro * (cos(Gama - Beta) + sin(Gama - Beta) * fi_e ) E2 = -ro * (sin(Gama - Beta) - cos(Gama - Beta) * fi_e ) T1 = rp - d *( l + rc/sqrt(d**2 + (rp * fi_t)**2)) T2 = rp * fi_t *( l + rc/sqrt(d**2 + (rp * fi_t)**2)) return E1 * cos(fi_e) + E2 *sin(fi_e) - T1 *cos(fi_t) + T2 * sin(fi_t) from scipy.optimize import fsolve from math import pi print fsolve(my_function, [-pi/2, 0])