示例#1
0
 def test_ndim_robot_arm(self):
     self.run_test(NdimRobotArm(ndim=1))
     self.run_test(NdimRobotArm(ndim=2))
示例#2
0
            if l == 2:
                l = 0
                k += 1
            else:
                l += 1

    if plot_status:
        plt.show()

    ########### The RMTB and RMTC models are suitable for low-dimensional problems

    # Initialization of the problem
    ndim = 3
    ndoe = int(250 * ndim)
    # Define the function
    fun = NdimRobotArm(ndim=ndim)

    # Construction of the DOE
    sampling = LHS(xlimits=fun.xlimits)
    xt = sampling(ndoe)

    # Compute the output
    yt = fun(xt)
    # Compute the gradient
    for i in range(ndim):
        yd = fun(xt, kx=i)
        yt = np.concatenate((yt, yd), axis=1)

    # Construction of the validation points
    ntest = 500
    sampling = LHS(xlimits=fun.xlimits)