def ogden_1(self, sample=10, range=None, plot=False):
        if range is None:
            range = [-5.0, 5.0]
        m1_space = np.linspace(range[0], range[1], sample)
        a1_space = np.linspace(range[0], range[1], sample)
        param_data = []
        discarded = []

        for m in m1_space:
            for a in a1_space:
                model = Nonlinear.Ogden("Ogden 1-term", 1, [m], [a])
                model.Compute()
                l, W, dW, H, sigma, P, offset = model.Evaluate(
                    MechanicalTests.Uniaxial, [0.01, 5.])
                if np.min(H[0, 0]) > 0.0:
                    title = model.name + ' m1=' + format(
                        m, '.2f') + ' a1=' + format(a, '.2f')
                    if plot:
                        self.plot_energy(title, l, W, dW, H)
                    param_data.append([m, a])
                    print('min(H)={} > 0.0 [m1={}, a1={}]'.format(
                        np.min(H[0, 0]), m, a))
                else:
                    discarded.append([m, a])

        param_data = np.asarray(param_data)
        discarded = np.asarray(discarded)
        self.plot_space("Ogden 1-term", param_data, discarded, range)
        print('param_data = ', param_data)
        print('discarded = ', discarded)
        np.save('./data/params_included_Ogden1.npy', param_data)
        np.save('./data/params_discarded_Ogden1.npy', discarded)
        return param_data, discarded
    def mooney_rivlin(self, sample=10, range=None, plot=False):
        if range is None:
            range = [-5.0, 5.0]
        c1_space = np.linspace(range[0], range[1], sample)
        c2_space = np.linspace(range[0], range[1], sample)
        param_data = []
        discarded = []

        for c1 in c1_space:
            for c2 in c2_space:
                model = Nonlinear.MooneyRivlin("Mooney-Rivlin", c1, c2)
                model.Compute()
                l, W, dW, H, sigma, P, offset = model.Evaluate(
                    MechanicalTests.Uniaxial, [0.01, 5.])
                if np.min(H[0, 0]) > 0.0:
                    title = model.name + ' c1=' + format(
                        c1, '.2f') + ' c2=' + format(c2, '.2f')
                    if plot:
                        self.plot_energy(title, l, W, dW, H)
                    param_data.append([c1, c2])
                    print('min(H)={} > 0.0 [c1={}, c2={}]'.format(
                        np.min(H[0, 0]), c1, c2))
                else:
                    discarded.append([c1, c2])

        param_data = np.asarray(param_data)
        discarded = np.asarray(discarded)
        self.plot_space("Mooney-Rivlin", param_data, discarded, range)
        print('param_data = ', param_data)
        print('discarded = ', discarded)
        return param_data, discarded
    def neo_hookean(self, sample=10, plot=False):
        mu_space = np.linspace(-5.0, 5.0, sample)
        param_data = []
        discarded = []

        for mu in mu_space:
            model = Nonlinear.NeoHookean("Neo-Hookean", mu)
            model.Compute()
            l, W, dW, H, sigma, P, offset = model.Evaluate(
                MechanicalTests.Uniaxial, [0.01, 5.])
            if np.min(H[0, 0]) > 0.0:
                if plot:
                    self.plot_energy(
                        model.name + ' mu=' + str(format(mu, '.2f')), l, W, dW,
                        H)
                param_data.append(mu)
                print('min(H)={} > 0.0 [mu={}]'.format(np.min(H[0, 0]), mu))
            else:
                discarded.append(mu)

        param_data = np.asarray(param_data)
        discarded = np.asarray(discarded)
        print('mu_data = ', param_data)
        print('discarded = ', discarded)
        return param_data, discarded
    def ogden_2(self, sample=10, range1=None, range2=None, plot=False):
        if range1 is None:
            range1 = [-5.0, 5.0]
        if range2 is None:
            range2 = [-5.0, 5.0]
        m_space = np.linspace(range1[0], range1[1], sample)
        a_space = np.linspace(range2[0], range2[1], sample)
        param_data = []
        discarded = []

        for m1 in m_space:
            for m2 in m_space:
                for a1 in a_space:
                    for a2 in a_space:
                        if (m1 == 0. and m2 == 0.) or a1 == 0. or a2 == 0.:
                            # print('m1={} m2={} a1={} a2={}'.format(m1, m2, a1, a2))
                            continue
                        model = Nonlinear.Ogden("Ogden 2-term", 2, [m1, m2],
                                                [a1, a2])
                        model.Compute()
                        l, W, dW, H, sigma, P, offset = model.Evaluate(
                            MechanicalTests.Uniaxial, [0.01, 5.])
                        if np.min(H[0, 0]) > 0.0:
                            title = model.name + ' m=[' + format(
                                m1, '.2f') + ',' + format(
                                    m2, '.2f') + '] a=[' + format(
                                        a1, '.2f') + ',' + format(a2,
                                                                  '.2f') + ']'
                            if plot:
                                self.plot_energy(title, l, W, dW, H)
                            param_data.append([m1, m2, a1, a2])
                            print(
                                'INCLUDED:: min(H)={} > 0.0 [m1=<{},{}>, a1=<{},{}>]'
                                .format(np.min(H[0, 0]), format(m1, '.2f'),
                                        format(m2, '.2f'), format(a1, '.2f'),
                                        format(a2, '.2f')))
                        else:
                            print(
                                'DISCARDED:: min(H)={} > 0.0 [m1=<{},{}>, a1=<{},{}>]'
                                .format(np.min(H[0, 0]), format(m1, '.2f'),
                                        format(m2, '.2f'), format(a1, '.2f'),
                                        format(a2, '.2f')))
                            discarded.append([m1, m2, a1, a2])

        param_data = np.asarray(param_data)
        discarded = np.asarray(discarded)
        print('param_data = ', param_data)
        print('discarded = ', discarded)
        np.save('./data/params_included_Ogden2.npy', param_data)
        np.save('./data/params_discarded_Ogden2.npy', discarded)
        self.plot_space("Ogden 2-term",
                        param_data,
                        discarded,
                        range1=range1,
                        range2=range2)
        return param_data, discarded
    def plot_metamodel_all(self):
        # self.hyper_gen_model.select_cases_per_task()
        # GM/E [27 29 31 33 36] WM/E [26 28 30 32 34] NH/E [37] AB/E [35]
        # GM/L [8] WM/L [7] NH/L [ 0  1  4  5 12 13 14 15 16 17 18 19 21 22 24 25] AB/L [ 2  3  9 10 11 20 23]
        # GM/H [55 56 59 60 63 64 67 68 71 72] WM/H [53 54 57 58 61 62 65 66 69 70] NH/H [38 39 40 41 42 43 44 45 46 47 48 49 50 51 52] AB/H [6]
        c_h_gm, c_h_wm, c_h_nh, c_h_ab = np.asarray([71]), np.asarray(
            [58]), np.asarray([45]), np.asarray([6])
        c_all = np.concatenate((c_h_gm, c_h_wm, c_h_nh, c_h_ab), axis=0)
        # self.hyper_gen_model.plot_cases(c_h_gm)
        # self.hyper_gen_model.plot_cases(c_h_wm)
        # self.hyper_gen_model.plot_cases(c_h_nh)
        # self.hyper_gen_model.plot_cases(c_h_ab)
        # self.hyper_gen_model.plot_cases(c_all)

        kPa = Common.kPa
        # mm_l = [self.metamodel_nh, self.metamodel_mr, self.metamodel_o1_l]
        mm_l = [
            self.metamodel_nh, self.metamodel_mr, self.metamodel_o1_l,
            self.metamodel_o1_h
        ]
        mm_h = [self.metamodel_nh, self.metamodel_mr, self.metamodel_o1_h]

        print('\n\n>>>>> Neo-Hookean')
        model = Nonlinear.Budday2017a("Neo-Hookean CC [Budday2017]",
                                      0.99 * kPa, 0.29 * kPa)
        model.Compute()
        l, W, dW, H, sigma, P, offset = model.Evaluate(
            MechanicalTests.Uniaxial, [0.001, 5.0])
        self.hyper_gen_model.plot_cases_with_metamodels(
            np.asarray([53]), l, W, mm_l)

        print('\n\n>>>>> Mooney-Rivlin')
        model = Nonlinear.Budday2017b("Mooney-Rivlin BG [Budday2017]",
                                      1.27 * kPa, 0.0 * kPa, 0.57 * kPa,
                                      0.29 * kPa)
        model.Compute()
        l, W, dW, H, sigma, P, offset = model.Evaluate(
            MechanicalTests.Uniaxial, [0.001, 5.0])
        self.hyper_gen_model.plot_cases_with_metamodels(
            np.asarray([59]), l, W, mm_l)

        print('\n\n>>>>> Ogden 1-term')
        model = Nonlinear.Mihai2017a("Ogden 1-term [Mihai2017]", -0.0939 * kPa,
                                     -4.0250)
        model.Compute()
        l, W, dW, H, sigma, P, offset = model.Evaluate(
            MechanicalTests.Uniaxial, [0.001, 5.0])
        self.hyper_gen_model.plot_cases_with_metamodels(
            np.asarray([38]), l, W, mm_l)

        print('\n\n>>>>> Ogden 2-terms')
        model = Nonlinear.Budday2017e("Mod 1-term Ogden BG [Budday2017]",
                                      0.83 * kPa, -15.5, 0.65 * kPa, -32.5)
        model.Compute()
        l, W, dW, H, sigma, P, offset = model.Evaluate(
            MechanicalTests.Uniaxial, [0.001, 5.0])
        self.hyper_gen_model.plot_cases_with_metamodels(
            np.asarray([71]), l, W, mm_l)

        print('\n\n>>>>> Ogden 3-terms')
        model = Nonlinear.Mihai2015e("Ogden 3-term [Mihai2015]", 3,
                                     [-3.543 * kPa, -2.723 * kPa, 0.654 * kPa],
                                     [1, -1, 2])
        model.Compute()
        l, W, dW, H, sigma, P, offset = model.Evaluate(
            MechanicalTests.Uniaxial, [0.001, 5.0])
        self.hyper_gen_model.plot_cases_with_metamodels(
            np.asarray([44]), l, W, mm_l)

        print('\n\n>>>>> Ogden 4-terms')
        model = Nonlinear.Mihai2015e(
            "Ogden 4-term [Mihai2015]", 4,
            [-5.877 * kPa, -5.043 * kPa, 1.161 * kPa, 0.501 * kPa],
            [1, -1, 2, -2])
        model.Compute()
        l, W, dW, H, sigma, P, offset = model.Evaluate(
            MechanicalTests.Uniaxial, [0.001, 5.0])
        self.hyper_gen_model.plot_cases_with_metamodels(
            np.asarray([45]), l, W, mm_l)

        print('\n\n>>>>> Ogden 8-terms')
        model = Nonlinear.Mihai2015e("Ogden 8-term [Mihai2015]", 8, [
            -639.530 * kPa, -544.840 * kPa, 322.660 * kPa, 237.040 * kPa,
            -88.640 * kPa, -57.830 * kPa, 10.150 * kPa, 6.080 * kPa
        ], [1, -1, 2, -2, 3, -3, 4, -4])
        model.Compute()
        l, W, dW, H, sigma, P, offset = model.Evaluate(
            MechanicalTests.Uniaxial, [0.001, 5.0])
        self.hyper_gen_model.plot_cases_with_metamodels(
            np.asarray([49]), l, W, mm_l)
def Process():

    # output
    data_l = np.zeros((1, s))
    data_W = np.zeros((1, s))
    data_dW = np.zeros((1, s))
    data_H = np.zeros((1, s))
    data_sigma = np.zeros((1, s))
    data_P = np.zeros((1, p), dtype=bool)
    data_offset = []
    data_Y = [""]
    data_C = []
    data_A = []
    data_M = []

    # [Yousefi2013]
    # E +- 0.25
    # v +- 0.145
    model = Linear.Generic(
        "Linear pathological region growing --brain-- [Yousefi2013]", 0,
        3.0 * kPa, 0.45)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l[0, :] = l
    data_W[0, :] = W
    data_dW[0, :] = dW[0]
    data_H[0, :] = H[0, 0]
    data_sigma[0, :] = sigma[0]
    data_P[0, :] = P
    data_offset.append(offset)
    data_Y[0] = "Pathos-Yousefi2013"
    data_C.append(c)
    data_A.append(Common.NH)
    data_M.append(Common.LIN)
    stretches = model.stretches

    # [Prastawa2009]
    model = Linear.Generic(
        "Linear pathological region growing --brain-- [Prastawa2009]", 0,
        0.694 * kPa, 0.4)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Pathos-Prastawa2009")
    data_C.append(c)
    data_A.append(Common.NH)
    data_M.append(Common.LIN)

    # model = Linear.Generic("Linear pathological region growing --falx-- [Prastawa2009]", 0, 200.0 * kPa, 0.4)
    # model.Compute()
    # l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial, [0.9,1.1])
    # data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    # data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    # data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    # data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    # data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    # data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    # data_offset.append(offset)
    # data_Y.append("Pathos-falx-Prastawa2009")
    # data_C.append(c)
    # data_A.append(Common.AB)
    # data_M.append(Common.LIN)

    # [Kyriacou1999]
    # TODO MICCAI exclusion
    # model = Nonlinear.Mihai2015a("Neo-Hookean --WM-- [Kyriacou1999]", 3.0 * kPa)
    # model.Compute()
    # l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial, [0.8,1.2])
    # data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    # data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    # data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    # data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    # data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    # data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    # data_offset.append(offset)
    # data_Y.append("Pathos-WM-Kyriacou1999")
    # data_C.append(c)
    # data_A.append(Common.WM)
    # data_M.append(Common.HYP)

    # TODO MICCAI exclusion
    # model = Nonlinear.Mihai2015a("Neo-Hookean --GM-- [Kyriacou1999]", 30.0 * kPa)
    # model.Compute()
    # l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial, [0.8,1.2])
    # data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    # data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    # data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    # data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    # data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    # data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    # data_offset.append(offset)
    # data_Y.append("Pathos-GM-Kyriacou1999")
    # data_C.append(c)
    # data_A.append(Common.GM)
    # data_M.append(Common.HYP)

    # [6]
    model = Nonlinear.Mihai2015a("Neo-Hookean --Tumour-- [Kyriacou1999]",
                                 30.0 * kPa)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.8, 1.2])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Pathos-TUMOUR-Kyriacou1999")
    data_C.append(c)
    data_A.append(Common.AB)
    data_M.append(Common.HYP)

    # [Takizawa1994]
    # model = Linear.Generic("Linear pathological region growing --CSF-- [Takizawa1994]", 0, 1.0 * kPa, 0.47)
    # model.Compute()
    # l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial, [0.9,1.1])
    # data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    # data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    # data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    # data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    # data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    # data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    # data_offset.append(offset)
    # data_Y.append("Pathos-CSF-Takizawa1994")
    # data_C.append(c)
    # data_A.append(Common.AB)
    # data_M.append(Common.LIN)

    # model = Linear.Generic("Linear pathological region growing --falx-- [Takizawa1994]", 0, 100.0 * kPa, 0.47)
    # model.Compute()
    # l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial, [0.9,1.1])
    # data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    # data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    # data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    # data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    # data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    # data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    # data_offset.append(offset)
    # data_Y.append("Pathos-falx-Takizawa1994")
    # data_C.append(c)
    # data_A.append(Common.AB)
    # data_M.append(Common.LIN)

    model = Linear.Generic(
        "Linear pathological region growing --WM-- [Takizawa1994]", 0,
        4.0 * kPa, 0.47)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Pathos-WM-Takizawa1994")
    data_C.append(c)
    data_A.append(Common.WM)
    data_M.append(Common.LIN)

    model = Linear.Generic(
        "Linear pathological region growing --GM-- [Takizawa1994]", 0,
        8.0 * kPa, 0.47)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Pathos-GM-Takizawa1994")
    data_C.append(c)
    data_A.append(Common.GM)
    data_M.append(Common.LIN)

    # [Dumpuri2006,Chen2011]
    model = Linear.Generic(
        "Linear pathological region growing --tumour-- [Dumpuri2006,Chen2011]",
        0, 100.0 * kPa, 0.45)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Pathos-Tumour-Dumpuri2006")
    data_C.append(c)
    data_A.append(Common.AB)
    data_M.append(Common.LIN)

    model = Linear.Generic(
        "Linear brain-shift compensation for ablation --tumour-- [Miller2013]",
        0, 9.0 * kPa, 0.45)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("BrainShift-tumour-Miller2013")
    data_C.append(c)
    data_A.append(Common.AB)
    data_M.append(Common.LIN)

    model = Linear.Generic(
        "Linear brain-shift compensation for ablation --tumour-- [Morin2016]",
        0, 10.0 * kPa, 0.45)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("BrainShift-tumour-Morin2016")
    data_C.append(c)
    data_A.append(Common.AB)
    data_M.append(Common.LIN)

    PlotMaterial.Groups("Pathological Region Growing", stretches, data_l,
                        data_W, data_dW, data_H, data_sigma, data_Y)

    return data_l, data_W, data_dW, data_H, data_sigma, data_P, data_offset, data_Y, data_C, data_A, data_M
def Process():

    # output
    data_l = np.zeros((1, s))
    data_W = np.zeros((1, s))
    data_dW = np.zeros((1, s))
    data_H = np.zeros((1, s))
    data_sigma = np.zeros((1, s))
    data_P = np.zeros((1, p), dtype=bool)
    data_offset = []
    data_Y = [""]
    data_C = []
    data_A = []
    data_M = []
    ''' [Mihai2017] [38] '''
    # TODO check - too flat and fitting is bad
    # TODO Recent papers to add
    model = Nonlinear.Mihai2017a("Ogden 1-term [Mihai2017]", -0.0939 * kPa,
                                 -4.0250)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.8, 1.2])
    data_l[0, :] = l
    data_W[0, :] = W
    data_dW[0, :] = dW[0]
    data_H[0, :] = H[0, 0]
    data_sigma[0, :] = sigma[0]
    data_P[0, :] = P
    data_offset.append(offset)
    data_Y[0] = "Hyperelastic-Ogden1-Mihai2017"
    data_C.append(c)
    data_A.append(Common.NH)
    data_M.append(Common.HYP)
    stretches = model.stretches

    model = Nonlinear.Mihai2017b(
        "3-term Mooney-Rivlin: Ogden 1-term + MR 2-term [Mihai2017]",
        0.0653 * kPa, 7.1813, -3.8201 * kPa, 3.5376 * kPa)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.8, 1.2])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-MR3-Mihai2017")
    data_C.append(c)
    data_A.append(Common.NH)
    data_M.append(Common.HYP)

    # TODO check - negative
    # model = Nonlinear.Mihai2017c("3-term Ogden [Mihai2017]", 3, [-5.5090 * kPa, 2.9269 * kPa, 1.4653 * kPa], [2, -2, 4])
    # model.Compute()
    # l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial, [0.8,1.2])
    # data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    # data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    # data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    # data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    # data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    # data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    # data_offset.append(offset)
    # data_Y.append("Hyperelastic-Ogden3-Mihai2017")
    # data_C.append(c)
    # data_A.append(Common.NH)
    # data_M.append(Common.HYP)
    ''' [Mihai2015] '''
    # model = Nonlinear.Mihai2015a("Neo-Hookean [Mihai2015]", 333.28 * kPa)
    model = Nonlinear.Mihai2015a("Neo-Hookean [Mihai2015]", 0.33328 * kPa)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.6, 1.4])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-NH-Mihai2015")
    data_C.append(c)
    data_A.append(Common.NH)
    data_M.append(Common.HYP)

    # TODO check - prediction is poor
    # model = Nonlinear.Mihai2015b("Mooney-Rivlin [Mihai2015]", 0.28 * kPa, 333.0 * kPa)
    model = Nonlinear.Mihai2015b("Mooney-Rivlin [Mihai2015]", 0.28 * kPa,
                                 0.333 * kPa)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.6, 1.4])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-MR-Mihai2015")
    data_C.append(c)
    data_A.append(Common.NH)
    data_M.append(Common.HYP)

    # TODO check - fit crashes
    # model = Nonlinear.Mihai2015c("Fung [Mihai2015]", 166.64 * kPa, 2.4974)
    model = Nonlinear.Mihai2015c("Fung [Mihai2015]", 0.16664 * kPa, 2.4974)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.6, 1.4])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-Fung-Mihai2015")
    data_C.append(c)
    data_A.append(Common.NH)
    data_M.append(Common.HYP)

    # TODO check fit nan
    # model = Nonlinear.Mihai2015d("Gent [Mihai2015]", 333.28 * kPa, 0.9918)
    model = Nonlinear.Mihai2015d("Gent [Mihai2015]", 0.33328 * kPa, 0.9918)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.6, 1.4])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-Gent-Mihai2015")
    data_C.append(c)
    data_A.append(Common.NH)
    data_M.append(Common.HYP)

    # TODO check - change optimisation params
    # model = Nonlinear.Mihai2015e("Ogden 3-term [Mihai2015]", 3, [-3543 * kPa, -2723 * kPa, 654 * kPa], [1, -1, 2])
    model = Nonlinear.Mihai2015e("Ogden 3-term [Mihai2015]", 3,
                                 [-3.543 * kPa, -2.723 * kPa, 0.654 * kPa],
                                 [1, -1, 2])
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.6, 1.4])
    # l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial, [0.01, 5])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-Ogden3-Mihai2015")
    data_C.append(c)
    data_A.append(Common.NH)
    data_M.append(Common.HYP)

    # TODO check - strain curve starts from megative values (consider only narrower window)
    # model = Nonlinear.Mihai2015e("Ogden 4-term [Mihai2015]", 4, [-5877 * kPa, -5043 * kPa, 1161 * kPa, 501 * kPa], [1, -1, 2, -2])
    model = Nonlinear.Mihai2015e(
        "Ogden 4-term [Mihai2015]", 4,
        [-5.877 * kPa, -5.043 * kPa, 1.161 * kPa, 0.501 * kPa], [1, -1, 2, -2])
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.6, 1.4])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-Ogden4-Mihai2015")
    data_C.append(c)
    data_A.append(Common.NH)
    data_M.append(Common.HYP)

    # TODO check - consider only narrower window
    # model = Nonlinear.Mihai2015e("Ogden 5-term [Mihai2015]", 5, [-34399 * kPa, -18718 * kPa, 14509 * kPa, 2947 * kPa, -2349 * kPa], [1, -1, 2, -2, 3])
    model = Nonlinear.Mihai2015e("Ogden 5-term [Mihai2015]", 5, [
        -34.399 * kPa, -18.718 * kPa, 14.509 * kPa, 2.947 * kPa, -2.349 * kPa
    ], [1, -1, 2, -2, 3])
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.6, 1.4])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-Ogden5-Mihai2015")
    data_C.append(c)
    data_A.append(Common.NH)
    data_M.append(Common.HYP)

    # model = Nonlinear.Mihai2015e("Ogden 6-term [Mihai2015]", 6, [1189 * kPa, 16855 * kPa, 1444 * kPa, -10108 * kPa, -458 * kPa, 1889 * kPa], [1, -1, 2, -2, 3, -3])
    model = Nonlinear.Mihai2015e("Ogden 6-term [Mihai2015]", 6, [
        1.189 * kPa, 16.855 * kPa, 1.444 * kPa, -10.108 * kPa, -0.458 * kPa,
        1.889 * kPa
    ], [1, -1, 2, -2, 3, -3])
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.6, 1.4])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-Ogden6-Mihai2015")
    data_C.append(c)
    data_A.append(Common.NH)
    data_M.append(Common.HYP)

    # model = Nonlinear.Mihai2015e("Ogden 7-term [Mihai2015]", 7, [-187150 * kPa, -91970 * kPa, 109290 * kPa, 23200 * kPa, -33290 * kPa, -2290 * kPa, 4100 * kPa], [1, -1, 2, -2, 3, -3, 4])
    model = Nonlinear.Mihai2015e("Ogden 7-term [Mihai2015]", 7, [
        -187.150 * kPa, -91.970 * kPa, 109.290 * kPa, 23.200 * kPa,
        -33.290 * kPa, -2.290 * kPa, 4.100 * kPa
    ], [1, -1, 2, -2, 3, -3, 4])
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.6, 1.4])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-Ogden7-Mihai2015")
    data_C.append(c)
    data_A.append(Common.NH)
    data_M.append(Common.HYP)

    # TODO check - consider only window
    # model = Nonlinear.Mihai2015e("Ogden 8-term [Mihai2015]", 8, [-639530 * kPa, -544840 * kPa, 322660 * kPa, 237040 * kPa, -88640 * kPa, -57830 * kPa, 10150 * kPa, 6080 * kPa], [1, -1, 2, -2, 3, -3, 4, -4])
    model = Nonlinear.Mihai2015e("Ogden 8-term [Mihai2015]", 8, [
        -639.530 * kPa, -544.840 * kPa, 322.660 * kPa, 237.040 * kPa,
        -88.640 * kPa, -57.830 * kPa, 10.150 * kPa, 6.080 * kPa
    ], [1, -1, 2, -2, 3, -3, 4, -4])
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.6, 1.4])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-Ogden8-Mihai2015")
    data_C.append(c)
    data_A.append(Common.NH)
    data_M.append(Common.HYP)
    ''' [Laksari2012] from [Morin2017] '''
    # TODO c10=[+-0.06], c01=[+-0.05], c11=[+-0.01], K=[+-0.26]
    # model = Nonlinear.Laksari2012("Mooney Rivlin 3-term + Ogden 2-param [Laksari2012]", -1.34 * kPa, 1.83 * kPa, 0.29 * kPa, 46, 100, 0.49)   # compressible
    model = Nonlinear.Laksari2012(
        "Mooney Rivlin 3-term + Ogden 2-param [Laksari2012]", -1.01 * kPa,
        1.49 * kPa, 0.19 * kPa, 2.38, 100, 0.49)  # incompressible
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.7, 1.3])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-MR3-Laksari2012")
    data_C.append(c)
    data_A.append(Common.NH)
    data_M.append(Common.HYP)
    ''' [Schiavone2009] from [Morin2017] '''
    # TODO MICCAI assumption for tension
    model = Nonlinear.Schiavone2009("Mooney Rivlin 2-term [Schiavone2009]",
                                    0.24 * kPa, 3.42 * kPa)
    model.Compute()
    # l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial, [1.0,1.45])
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.55, 1.45])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-MR2-Schiavone2009")
    data_C.append(c)
    data_A.append(Common.NH)
    data_M.append(Common.HYP)
    ''' [Miller2002] '''
    model = Nonlinear.Miller2002("Ogden mod 1-term [Miller2002]", 0.842 * kPa,
                                 -4.7)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.7, 1.3])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-OgdenMod1-Miller2002")
    data_C.append(c)
    data_A.append(Common.NH)
    data_M.append(Common.HYP)

    # model = Nonlinear.Mihai2015e("Ogden 3-term Rubber", 3, [6300 * kPa, 1.2 * kPa, -10 * kPa], [1.3/2.0, 5.0/2.0, -2.0/2.0])
    # model.Compute()
    # # l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial, [0.8,1.2])
    # l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial, [0.001, 5])
    # data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    # data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    # data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    # data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    # data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    # data_P = np.concatenate((data_P, P.reshape(1,p)), axis=0)
    # data_offset.append(offset)
    # data_Y.append("Hyperelastic-Ogden3-Mihai2015")
    # data_C.append(c)
    # data_A.append(Common.NH)
    # data_M.append(Common.HYP)
    ''' ############################################################################################# '''
    ''' Budday NH [53]'''
    model = Nonlinear.Budday2017a("Neo-Hookean CC [Budday2017]", 0.99 * kPa,
                                  0.29 * kPa)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-NH-CC-Budday2017")
    data_C.append(c)
    data_A.append(Common.WM)
    data_M.append(Common.HYP)

    model = Nonlinear.Budday2017a("Neo-Hookean CR [Budday2017]", 1.75 * kPa,
                                  0.52 * kPa)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-NH-CR-Budday2017")
    data_C.append(c)
    data_A.append(Common.WM)
    data_M.append(Common.HYP)

    # [55]
    model = Nonlinear.Budday2017a("Neo-Hookean BG [Budday2017]", 1.37 * kPa,
                                  0.57 * kPa)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-NH-BG-Budday2017")
    data_C.append(c)
    data_A.append(Common.GM)
    data_M.append(Common.HYP)

    model = Nonlinear.Budday2017a("Neo-Hookean C [Budday2017]", 2.80 * kPa,
                                  1.22 * kPa)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-NH-C-Budday2017")
    data_C.append(c)
    data_A.append(Common.GM)
    data_M.append(Common.HYP)
    ''' Budday MR [57]'''
    model = Nonlinear.Budday2017b("Mooney-Rivlin CC [Budday2017]", 0.92 * kPa,
                                  0.0 * kPa, 0.29 * kPa, 0.13 * kPa)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-MR-CC-Budday2017")
    data_C.append(c)
    data_A.append(Common.WM)
    data_M.append(Common.HYP)

    model = Nonlinear.Budday2017b("Mooney-Rivlin CR [Budday2017]", 1.62 * kPa,
                                  0.0 * kPa, 0.52 * kPa, 0.26 * kPa)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-MR-CR-Budday2017")
    data_C.append(c)
    data_A.append(Common.WM)
    data_M.append(Common.HYP)

    # [59]
    model = Nonlinear.Budday2017b("Mooney-Rivlin BG [Budday2017]", 1.27 * kPa,
                                  0.0 * kPa, 0.57 * kPa, 0.29 * kPa)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-MR-BG-Budday2017")
    data_C.append(c)
    data_A.append(Common.GM)
    data_M.append(Common.HYP)

    model = Nonlinear.Budday2017b("Mooney-Rivlin C [Budday2017]", 2.59 * kPa,
                                  0.0 * kPa, 1.22 * kPa, 0.61 * kPa)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-MR-C-Budday2017")
    data_C.append(c)
    data_A.append(Common.GM)
    data_M.append(Common.HYP)
    ''' Budday DMR [61] '''
    model = Nonlinear.Budday2017c("Demiray CC [Budday2017]", 0.55 * kPa, 28.4,
                                  0.28 * kPa, 1.29)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-DMR-CC-Budday2017")
    data_C.append(c)
    data_A.append(Common.WM)
    data_M.append(Common.HYP)

    model = Nonlinear.Budday2017c("Demiray CR [Budday2017]", 1.05 * kPa, 24.6,
                                  0.48 * kPa, 4.37)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-DMR-CR-Budday2017")
    data_C.append(c)
    data_A.append(Common.WM)
    data_M.append(Common.HYP)

    # [63]
    model = Nonlinear.Budday2017c("Demiray BG [Budday2017]", 0.97 * kPa, 17.1,
                                  0.52 * kPa, 6.03)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-DMR-BG-Budday2017")
    data_C.append(c)
    data_A.append(Common.GM)
    data_M.append(Common.HYP)

    model = Nonlinear.Budday2017c("Demiray C [Budday2017]", 1.90 * kPa, 18.8,
                                  0.91 * kPa, 16.7)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-DMR-C-Budday2017")
    data_C.append(c)
    data_A.append(Common.GM)
    data_M.append(Common.HYP)
    ''' Budday Gnt [65] '''
    model = Nonlinear.Budday2017d("Gent CC [Budday2017]", 0.62 * kPa, 0.06,
                                  0.29 * kPa, 85.0)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-Gent-CC-Budday2017")
    data_C.append(c)
    data_A.append(Common.WM)
    data_M.append(Common.HYP)

    model = Nonlinear.Budday2017d("Gent CR [Budday2017]", 1.16 * kPa, 0.06,
                                  0.48 * kPa, 0.23)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-Gent-CR-Budday2017")
    data_C.append(c)
    data_A.append(Common.WM)
    data_M.append(Common.HYP)

    # [67]
    model = Nonlinear.Budday2017d("Gent BG [Budday2017]", 1.01 * kPa, 0.08,
                                  0.52 * kPa, 0.18)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-Gent-BG-Budday2017")
    data_C.append(c)
    data_A.append(Common.GM)
    data_M.append(Common.HYP)

    model = Nonlinear.Budday2017d("Gent C [Budday2017]", 2.01 * kPa, 0.08,
                                  0.92 * kPa, 0.08)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-Gent-C-Budday2017")
    data_C.append(c)
    data_A.append(Common.GM)
    data_M.append(Common.HYP)
    ''' Budday Ogden [69] '''
    # model = Nonlinear.Budday2017e("Mod 1-term Ogden CC [Budday2017]", 0.47 * kPa, -11.4, 0.33*kPa, -25.6)
    model = Nonlinear.Budday2017e("Mod 1-term Ogden CC [Budday2017]",
                                  0.43 * kPa, -22.8, 0.35 * kPa, -26.6)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-Ogden1-CC-Budday2017")
    data_C.append(c)
    data_A.append(Common.WM)
    data_M.append(Common.HYP)

    # model = Nonlinear.Budday2017e("Mod 1-term Ogden CR [Budday2017]", 0.86 * kPa, -19.9, 0.58 * kPa, -29.2)
    model = Nonlinear.Budday2017e("Mod 1-term Ogden CR [Budday2017]",
                                  0.85 * kPa, -20.5, 0.61 * kPa, -30.5)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-Ogden1-CR-Budday2017")
    data_C.append(c)
    data_A.append(Common.WM)
    data_M.append(Common.HYP)

    # [71]
    # model = Nonlinear.Budday2017e("Mod 1-term Ogden BG [Budday2017]", 0.84 * kPa, -12.5, 0.64 * kPa, -30.0)
    model = Nonlinear.Budday2017e("Mod 1-term Ogden BG [Budday2017]",
                                  0.83 * kPa, -15.5, 0.65 * kPa, -32.5)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-Ogden1-BG-Budday2017")
    data_C.append(c)
    data_A.append(Common.GM)
    data_M.append(Common.HYP)

    # model = Nonlinear.Budday2017e("Mod 1-term Ogden C [Budday2017]", 1.63 * kPa, -16.5, 1.16 * kPa, -38.9)
    model = Nonlinear.Budday2017e("Mod 1-term Ogden C [Budday2017]",
                                  1.61 * kPa, -16.6, 1.20 * kPa, -43.6)
    model.Compute()
    l, W, dW, H, sigma, P, offset = model.Evaluate(MechanicalTests.Uniaxial,
                                                   [0.9, 1.1])
    data_l = np.concatenate((data_l, l.reshape(1, s)), axis=0)
    data_W = np.concatenate((data_W, W.reshape(1, s)), axis=0)
    data_dW = np.concatenate((data_dW, dW[0].reshape(1, s)), axis=0)
    data_H = np.concatenate((data_H, H[0, 0].reshape(1, s)), axis=0)
    data_sigma = np.concatenate((data_sigma, sigma[0].reshape(1, s)), axis=0)
    data_P = np.concatenate((data_P, P.reshape(1, p)), axis=0)
    data_offset.append(offset)
    data_Y.append("Hyperelastic-Ogden1-C-Budday2017")
    data_C.append(c)
    data_A.append(Common.GM)
    data_M.append(Common.HYP)

    PlotMaterial.Groups("Hyperelastic Nonlinear", stretches, data_l, data_W,
                        data_dW, data_H, data_sigma, data_Y)

    return data_l, data_W, data_dW, data_H, data_sigma, data_P, data_offset, data_Y, data_C, data_A, data_M