<SYSTEM_TASK:>
Given the following text problem statement, write Python code to implement the functionality described below in problem statement
<END_TASK>
<USER_TASK:>
Problem:
I am having a problem with minimization procedure. Actually, I could not create a correct objective function for my problem.
<ASSISTANT_TASK:>
Python Code:
import scipy.optimize
import numpy as np
np.random.seed(42)
a = np.random.rand(3,5)
x_true = np.array([10, 13, 5, 8, 40])
y = a.dot(x_true ** 2)
x0 = np.array([2, 3, 1, 4, 20])
def residual_ans(x, a, y):
    s = ((y - a.dot(x**2))**2).sum()
    return s
out = scipy.optimize.minimize(residual_ans, x0=x0, args=(a, y), method= 'L-BFGS-B').x
<END_TASK>