python - ValueError: operands could not be broadcast together with shapes (51,51) (100,) -


im trying assigment, error: valueerror: operands not broadcast shapes (51,51) (100,)

def get_velocity(strength, xs, ys, x, y,):  u = strength /(2*np.pi)*(x-xs)/((x-xs)**2 +(y-ys)**2) v = strength /(2*np.pi)*(y-ys)/((x-xs)**2 +(y-ys)**2)  return u, v 

i want use function given points

x_naca0012 = np.loadtxt('naca0012_x.txt')  y_naca0012 = np.loadtxt('naca0012_y.txt')  strength_naca0012 = np.loadtxt('naca0012_sigma.txt') 

using function:

u_naca0012, v_naca0012 = get_velocity(strength_naca0012, x_naca0012, y_naca0012, x, y) 

here goes wrong, search error , find not matching arrays, checked lengths of each array , match (100). noticed 50th element of naca0012_y positive value , 51th element negative value. think messes there.


Comments

Popular posts from this blog

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

laravel - Undefined property: Illuminate\Pagination\LengthAwarePaginator::$id (View: F:\project\resources\views\admin\carousels\index.blade.php) -