def fun(z):
g = np.zeros(4 * N)
for i in range(4 * N):
f = np.zeros(4 * N)
for j in range(4 * N):
if z[j] != 0:
f[i] = f[i] + M_kk[i][j] * z[j] * np.arcsinh(w_c / z[j])
else:
f[i] = f[i]
g[i] = f[i] - z[i]
return(g)
z = fsolve(fun,np.zeros(4 * N))
I want to define a function with 4*N equations. Do I put the return(g) at the right position in the end?