# Motion Model
    motion_model = MotionModel(0.58, 1)

    # Tile for plotting
    independent_1 = np.tile(frequency, (len(duty_cycle), 1))
    independent_1 = np.transpose(independent_1)
    independent_2 = np.tile(duty_cycle, (len(frequency), 1))

    # Metrics
    rmse_ankle_angle = []
    above_0 = []
    rmse_toe_height = []

    for i in range(len(independent_1)):
        for j in range(len(independent_1[0])):
            motion_model.set_activation(frequency[i], duty_cycle[j], scaling,
                                        non_linearity, shape)
            motion_model.simulate(mode="rk45")
            rmse_ankle_angle.append(motion_model.compare_ankle_angle())
            above_0.append(motion_model.compare_toe_height()[0])
            rmse_toe_height.append(motion_model.compare_toe_height()[1])

    rmse_ankle_angle = np.array(rmse_ankle_angle)
    above_0 = np.array(above_0)
    rmse_toe_height = np.array(rmse_toe_height)

    rmse_ankle_angle_plot = np.reshape(
        rmse_ankle_angle, (len(independent_1), len(independent_1[0])))
    above_0_plot = np.reshape(above_0,
                              (len(independent_1), len(independent_1[0])))
    rmse_toe_height_plot = np.reshape(
        rmse_toe_height, (len(independent_1), len(independent_1[0])))
Beispiel #2
0
    # Motion Model
    motion_model = MotionModel(0.58, 1)

    # Tile for plotting
    independent_1 = np.tile(non_linearity, (len(shape_), 1))
    independent_1 = np.transpose(independent_1)
    independent_2 = np.tile(shape_, (len(non_linearity), 1))

    # Metrics
    rmse_ankle_angle = []
    above_0 = []
    rmse_toe_height = []

    for i in range(len(independent_1)):
        for j in range(len(independent_1[0])):
            motion_model.set_activation(frequency, duty_cycle, scaling,
                                        non_linearity[i], shape[shape_[j]])
            motion_model.simulate(mode="rk45")
            rmse_ankle_angle.append(motion_model.compare_ankle_angle())
            above_0.append(motion_model.compare_toe_height()[0])
            rmse_toe_height.append(motion_model.compare_toe_height()[1])

    rmse_ankle_angle = np.array(rmse_ankle_angle)
    above_0 = np.array(above_0)
    rmse_toe_height = np.array(rmse_toe_height)

    rmse_ankle_angle_plot = np.reshape(
        rmse_ankle_angle, (len(independent_1), len(independent_1[0])))
    above_0_plot = np.reshape(above_0,
                              (len(independent_1), len(independent_1[0])))
    rmse_toe_height_plot = np.reshape(
        rmse_toe_height, (len(independent_1), len(independent_1[0])))