Exemplo n.º 1
0
    print(calc_contig_vector(ss, n_contig))

    print('*** Test for the function calc_matrix_viol_contig ***\n')
    print('Inputs:\n')
    ss = [np.array([0, 90, 90]), np.array([0, 0, 0, 0, 0, 0])]
    n_contig = 3
    print(f'ss: {ss}')
    print(f'n_contig: {n_contig}')
    print('outputs:\n')
    viola_contig = calc_matrix_viol_contig(ss, n_contig)
    print(f'viola_contig: {viola_contig}\n')

    print('*** Test for the function calc_penalty_contig_mp ***\n')
    print('Inputs:\n')
    constraints = Constraints(sym=True)
    constraints.dam_tol = True
    constraints.n_contig = 3
    ss = [np.array([0, 90, 90]), np.array([0, 0, 0, 0, 0, 0])]
    print(f'ss: {ss}')
    print('outputs:\n')
    viola_contig = calc_penalty_contig_mp(ss, constraints)
    print(f'Result: {viola_contig}\n')

    print('*** Test for the function calc_penalty_contig_ss ***\n')
    constraints = Constraints(sym=True)
    constraints.dam_tol = True
    constraints.n_contig = 3
    print('Inputs:\n')
    ss = np.array([0, 90, 90, 90, 90])
    print(f'ss: {ss}')
    print(f'n_contig: {constraints.n_contig}')
Exemplo n.º 2
0
    viola_diso = calc_n_viola_diso(mother_n_viola_diso, mother_ss, child_ss,
                                   level, n_panels, n_plies, pdl, constraints)
    print(f'viola_diso: {viola_diso}\n')

    print('*** Test for the function calc_penalty_diso_mp_0 ***\n')
    print('Inputs:\n')
    ss = [np.array([0, 90, 90]), np.array([0, 0, 0, 45, -45, 0])]
    delta_angle = 45
    print(f'ss = {ss}, delta_angle = {delta_angle}\n')
    print('outputs:\n')
    print(calc_penalty_diso_mp_0(ss, delta_angle))

    print('*** Test for the function calc_penalty_diso_mp_1 ***\n')
    print('Inputs:\n')
    constraints = Constraints(sym=True)
    constraints.dam_tol = False
    constraints.delta_angle = 45
    ss = [
        np.array([-45, 45, 90, 0, 0, 45, -45]),
        np.array([-45, 45, 90, -45, 0, 0, 45, -45]),
        np.array([-45, 45, 45, -45])
    ]
    print(f'ss = {ss}')
    print('outputs:\n')
    print(calc_penalty_diso_mp_1(ss, constraints))

    print('*** Test for the function calc_n_penalty_diso_ss ***\n')
    constraints = Constraints(sym=True)
    constraints.dam_tol = False
    constraints.delta_angle = 45
    print('Inputs:\n')