Beispiel #1
0
def test_reduced_dof_freq_plate():
    models = ['plate_clt_donnell_bardell',
              'cpanel_clt_donnell_bardell']
    for model in models:
        print('Test reduced_dof solver, prestress=True, model={0}'.format(model))
        p = Panel()
        p.model = model
        p.a = 1.
        p.b = 0.5
        p.r = 100.
        p.alphadeg = 0.
        p.stack = [0, 90, -45, +45]
        p.plyt = 1e-3*0.125
        p.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
        p.mu = 1.3e3
        p.m = 11
        p.n = 12
        p.Nxx = -60.
        p.Nyy = -5.
        k0 = p.calc_k0(silent=True)
        M = p.calc_kM(silent=True)
        kG0 = p.calc_kG0(silent=True)
        k0 += kG0
        eigvals, eigvecs = freq(k0, M, sparse_solver=True, reduced_dof=False, silent=True)
        reduced_false = eigvals[0]
        freq(k0, M, sparse_solver=True, reduced_dof=True, silent=True)
        reduced_true = eigvals[0]
        assert np.isclose(reduced_false, reduced_true, rtol=0.001)
Beispiel #2
0
def test_reduced_dof_freq_plate():
    models = ['plate_clt_donnell_bardell', 'cpanel_clt_donnell_bardell']
    for model in models:
        print(
            'Test reduced_dof solver, prestress=True, model={0}'.format(model))
        p = Panel()
        p.model = model
        p.a = 1.
        p.b = 0.5
        p.r = 100.
        p.alphadeg = 0.
        p.stack = [0, 90, -45, +45]
        p.plyt = 1e-3 * 0.125
        p.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
        p.mu = 1.3e3
        p.m = 11
        p.n = 12
        p.Nxx = -60.
        p.Nyy = -5.
        k0 = p.calc_k0(silent=True)
        M = p.calc_kM(silent=True)
        kG0 = p.calc_kG0(silent=True)
        k0 += kG0
        eigvals, eigvecs = freq(k0,
                                M,
                                sparse_solver=True,
                                reduced_dof=False,
                                silent=True)
        reduced_false = eigvals[0]
        freq(k0, M, sparse_solver=True, reduced_dof=True, silent=True)
        reduced_true = eigvals[0]
        assert np.isclose(reduced_false, reduced_true, rtol=0.001)
Beispiel #3
0
def test_dynamic_with_TStiff2D():
    print('Testing dynamic analysis with TStiff2D')
    spb = StiffPanelBay()
    spb.a = 2.
    spb.b = 1.
    spb.stack = [0, 90, 90, 0]
    spb.plyt = 1e-3 * 0.125
    spb.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
    spb.model = 'plate_clt_donnell_bardell'
    spb.m = 12
    spb.n = 13
    spb.mu = 1.3e3

    spb.add_panel(y1=0, y2=spb.b / 2., plyt=spb.plyt)
    spb.add_panel(y1=spb.b / 2., y2=spb.b, plyt=spb.plyt)

    bb = spb.b / 5.
    bf = bb
    stiff = spb.add_tstiff2d(ys=spb.b / 2.,
                             bf=bf,
                             bb=bb,
                             fstack=[0, 90, 90, 0] * 2,
                             fplyt=spb.plyt * 1.,
                             flaminaprop=spb.laminaprop,
                             bstack=[0, 90, 90, 0] * 1,
                             bplyt=spb.plyt * 1.,
                             blaminaprop=spb.laminaprop,
                             mb=12,
                             nb=13,
                             mf=12,
                             nf=13)

    k0 = spb.calc_k0()
    M = spb.calc_kM()
    eigvals, eigvecs = freq(k0, M, silent=True)
Beispiel #4
0
def test_freq_Stiffener2D():
    print('Testing frequency analysis for StiffPanelBay with a 2D Stiffener')
    spb = StiffPanelBay()
    spb.a = 1.
    spb.b = 0.5
    spb.stack = [0, 90, 90, 0]
    spb.plyt = 1e-3 * 0.125
    spb.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
    spb.model = 'plate_clt_donnell_bardell'
    spb.mu = 1.3e3
    spb.m = 11
    spb.n = 12

    spb.add_panel(y1=0, y2=spb.b / 2., plyt=spb.plyt)
    spb.add_panel(y1=spb.b / 2., y2=spb.b, plyt=spb.plyt)

    spb.add_bladestiff2d(ys=spb.b / 2.,
                         m1=14,
                         n1=11,
                         bf=0.08,
                         fstack=[0, 90, 90, 0] * 5,
                         fplyt=spb.plyt,
                         flaminaprop=spb.laminaprop)

    k0 = spb.calc_k0(silent=True)
    M = spb.calc_kM(silent=True)
    eigvals, eigvecs = freq(k0, M, silent=True)

    assert np.isclose(eigvals[0].real, 137.97927190657148, atol=0.01, rtol=0)
Beispiel #5
0
def test_freq_Stiffener1D():
    print('Testing frequency analysis for StiffPanelBay with a 1D Stiffener')
    spb = StiffPanelBay()
    spb.a = 2.
    spb.b = 0.5
    spb.stack = [0, 90, 90, 0]
    spb.plyt = 1e-3 * 0.125
    spb.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
    spb.model = 'plate_clt_donnell_bardell'
    spb.mu = 1.3e3
    spb.m = 15
    spb.n = 16

    spb.add_panel(y1=0, y2=spb.b / 2., plyt=spb.plyt)
    spb.add_panel(y1=spb.b / 2., y2=spb.b, plyt=spb.plyt)

    spb.add_bladestiff1d(ys=spb.b / 2.,
                         Fx=0.,
                         bf=0.08,
                         fstack=[0, 90, 90, 0] * 5,
                         fplyt=spb.plyt,
                         flaminaprop=spb.laminaprop)

    k0 = spb.calc_k0(silent=True)
    M = spb.calc_kM(silent=True)
    eigvals, eigvecs = freq(k0, M, silent=True, num_eigvalues=10)

    assert np.isclose(eigvals[0].real, 79.5906673583, atol=0.1, rtol=0)
def test_freq_Stiffener2D():
    print('Testing frequency analysis for StiffPanelBay with a 2D Stiffener')
    spb = StiffPanelBay()
    spb.a = 1.
    spb.b = 0.5
    spb.stack = [0, 90, 90, 0]
    spb.plyt = 1e-3*0.125
    spb.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
    spb.model = 'plate_clt_donnell_bardell'
    spb.mu = 1.3e3
    spb.m = 11
    spb.n = 12

    spb.add_panel(y1=0, y2=spb.b/2., plyt=spb.plyt)
    spb.add_panel(y1=spb.b/2., y2=spb.b, plyt=spb.plyt)

    spb.add_bladestiff2d(ys=spb.b/2., m1=14, n1=11, bf=0.08,
                        fstack=[0, 90, 90, 0]*5, fplyt=spb.plyt,
                        flaminaprop=spb.laminaprop)

    k0 = spb.calc_k0(silent=True)
    M = spb.calc_kM(silent=True)
    eigvals, eigvecs = freq(k0, M, silent=True)

    assert np.isclose(eigvals[0].real, 137.97927190657148, atol=0.01, rtol=0)
def test_dynamic_with_BladeStiff2D():
    print('Testing dynamic analysis with TStiff2D')
    spb = StiffPanelBay()
    spb.a = 2.
    spb.b = 1.
    spb.stack = [0, 90, 90, 0]
    spb.plyt = 1e-3*0.125
    spb.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
    spb.model = 'plate_clt_donnell_bardell'
    spb.m = 10
    spb.n = 10
    spb.mu = 1.3e3

    spb.add_panel(y1=0, y2=spb.b/2., plyt=spb.plyt)
    spb.add_panel(y1=spb.b/2., y2=spb.b, plyt=spb.plyt)

    bb = spb.b/5.
    bf = bb
    stiff = spb.add_bladestiff2d(ys=spb.b/2., bf=bf, bb=bb,
                     fstack=[0, 90, 90, 0]*2,
                     fplyt=spb.plyt*1., flaminaprop=spb.laminaprop,
                     bstack=[0, 90, 90, 0]*1,
                     bplyt=spb.plyt*1., blaminaprop=spb.laminaprop,
                     mf=10, nf=10)

    k0 = spb.calc_k0()
    M = spb.calc_kM()
    eigvals, eigvecs = freq(k0, M, silent=True)

    spb.plot_skin(eigvecs[:, 0], filename='tmp_test_bladestiff2d_dynamic_skin.png',
            colorbar=True)
    spb.plot_stiffener(eigvecs[:, 0], si=0, region='flange',
            filename='tmp_test_bladestiff2d_dynamic_stiff_flange.png', colorbar=True)

    assert np.isclose(eigvals[0], 25.865835238236173, atol=0.01, rtol=0.001)
Beispiel #8
0
def test_Lee_and_Lee_table4():
    print('Testing Lee and Lee Table 4')
    # Lee and Lee. "Vibration analysis of anisotropic plates with eccentric
    #    stiffeners". Computers & Structures, Vol. 57, No. 1, pp. 99-105,
    #    1995.
    models = (('model4', 0.00208, 0.0060, 138.99917796302756),
              ('model5', 0.00260, 0.0075,
               175.00597239286196), ('model7', 0.00364, 0.0105, 205.433509024))
    for model, hf, bf, value in models:
        spb = StiffPanelBay()
        spb.model = 'plate_clt_donnell_bardell'
        spb.mu = 1.500e3  # plate material density in kg / m^3
        spb.laminaprop = (128.e9, 11.e9, 0.25, 4.48e9, 1.53e9, 1.53e9)
        spb.stack = [0, -45, +45, 90, 90, +45, -45, 0]
        plyt = 0.00013
        spb.plyt = plyt
        spb.a = 0.5
        spb.b = 0.250
        spb.m = 14
        spb.n = 15
        hf = hf
        bf = bf
        n = int(hf / plyt)
        fstack = [0] * (n // 4) + [90] * (n // 4) + [90] * (n //
                                                            4) + [0] * (n // 4)
        # clamping
        spb.w1rx = 0.
        spb.w2rx = 0.
        spb.w1ry = 0.
        spb.w2ry = 0.

        spb.add_panel(y1=0, y2=spb.b / 2.)
        spb.add_panel(y1=spb.b / 2., y2=spb.b)
        spb.add_bladestiff1d(mu=spb.mu,
                             ys=spb.b / 2.,
                             bb=0.,
                             bf=bf,
                             fstack=fstack,
                             fplyt=plyt,
                             flaminaprop=spb.laminaprop)
        k0 = spb.calc_k0(silent=True)
        M = spb.calc_kM(silent=True)
        eigvals, eigvecs = freq(k0, M, silent=True)

        herz = eigvals[0].real / 2 / np.pi
        assert np.isclose(herz, value, atol=0.001, rtol=0.001)
Beispiel #9
0
def test_dynamic_with_BladeStiff2D():
    print('Testing dynamic analysis with TStiff2D')
    spb = StiffPanelBay()
    spb.a = 2.
    spb.b = 1.
    spb.stack = [0, 90, 90, 0]
    spb.plyt = 1e-3 * 0.125
    spb.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
    spb.model = 'plate_clt_donnell_bardell'
    spb.m = 10
    spb.n = 10
    spb.mu = 1.3e3

    spb.add_panel(y1=0, y2=spb.b / 2., plyt=spb.plyt)
    spb.add_panel(y1=spb.b / 2., y2=spb.b, plyt=spb.plyt)

    bb = spb.b / 5.
    bf = bb
    stiff = spb.add_bladestiff2d(ys=spb.b / 2.,
                                 bf=bf,
                                 bb=bb,
                                 fstack=[0, 90, 90, 0] * 2,
                                 fplyt=spb.plyt * 1.,
                                 flaminaprop=spb.laminaprop,
                                 bstack=[0, 90, 90, 0] * 1,
                                 bplyt=spb.plyt * 1.,
                                 blaminaprop=spb.laminaprop,
                                 mf=10,
                                 nf=10)

    k0 = spb.calc_k0()
    M = spb.calc_kM()
    eigvals, eigvecs = freq(k0, M, silent=True)

    spb.plot_skin(eigvecs[:, 0],
                  filename='tmp_test_bladestiff2d_dynamic_skin.png',
                  colorbar=True)
    spb.plot_stiffener(
        eigvecs[:, 0],
        si=0,
        region='flange',
        filename='tmp_test_bladestiff2d_dynamic_stiff_flange.png',
        colorbar=True)

    assert np.isclose(eigvals[0], 25.865835238236173, atol=0.01, rtol=0.001)
Beispiel #10
0
def test_panel_freq():
    for model in [
            'plate_clt_donnell_bardell', 'plate_clt_donnell_bardell_w',
            'cpanel_clt_donnell_bardell', 'kpanel_clt_donnell_bardell'
    ]:
        for prestress in [True, False]:
            print('Frequency Analysis, prestress={0}, model={1}'.format(
                prestress, model))
            p = Panel()
            p.model = model
            p.a = 1.
            p.b = 0.5
            p.r = 1.e8
            p.alphadeg = 0.
            p.stack = [0, 90, -45, +45]
            p.plyt = 1e-3 * 0.125
            p.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
            p.mu = 1.3e3
            p.m = 11
            p.n = 12
            p.Nxx = -60.
            p.Nyy = -5.
            k0 = p.calc_k0(silent=True)
            M = p.calc_kM(silent=True)
            if prestress:
                kG0 = p.calc_kG0(silent=True)
                k0 += kG0
            eigvals, eigvecs = freq(k0,
                                    M,
                                    sparse_solver=True,
                                    reduced_dof=False,
                                    silent=True)
            if prestress:
                if '_w' in model:
                    assert np.isclose(eigvals[0], 19.9272, rtol=0.001)
                else:
                    assert np.isclose(eigvals[0], 17.85875, rtol=0.001)
            else:
                if '_w' in model:
                    assert np.isclose(eigvals[0], 40.37281, rtol=0.001)
                else:
                    assert np.isclose(eigvals[0], 39.31476, rtol=0.001)
Beispiel #11
0
def test_Lee_and_Lee_table4():
    print('Testing Lee and Lee Table 4')
    # Lee and Lee. "Vibration analysis of anisotropic plates with eccentric
    #    stiffeners". Computers & Structures, Vol. 57, No. 1, pp. 99-105,
    #    1995.
    models = (
        ('model4', 0.00208, 0.0060, 138.99917796302756),
        ('model5', 0.00260, 0.0075, 175.00597239286196),
        ('model7', 0.00364, 0.0105, 205.433509024))
    for model, hf, bf, value in models:
        spb = StiffPanelBay()
        spb.model = 'plate_clt_donnell_bardell'
        spb.mu = 1.500e3 # plate material density in kg / m^3
        spb.laminaprop = (128.e9, 11.e9, 0.25, 4.48e9, 1.53e9, 1.53e9)
        spb.stack = [0, -45, +45, 90, 90, +45, -45, 0]
        plyt = 0.00013
        spb.plyt = plyt
        spb.a = 0.5
        spb.b = 0.250
        spb.m = 14
        spb.n = 15
        hf = hf
        bf = bf
        n = int(hf/plyt)
        fstack = [0]*(n//4) + [90]*(n//4) + [90]*(n//4) + [0]*(n//4)
        # clamping
        spb.w1rx = 0.
        spb.w2rx = 0.
        spb.w1ry = 0.
        spb.w2ry = 0.

        spb.add_panel(y1=0, y2=spb.b/2.)
        spb.add_panel(y1=spb.b/2., y2=spb.b)
        spb.add_bladestiff1d(mu=spb.mu, ys=spb.b/2., bb=0., bf=bf,
                      fstack=fstack, fplyt=plyt, flaminaprop=spb.laminaprop)
        k0 = spb.calc_k0(silent=True)
        M = spb.calc_kM(silent=True)
        eigvals, eigvecs = freq(k0, M, silent=True)

        herz = eigvals[0].real/2/np.pi
        assert np.isclose(herz, value, atol=0.001, rtol=0.001)
Beispiel #12
0
def test_freq_models():
    print('Testing frequency analysis for StiffPanelBay with 2 plates')
    # From Table 4 of
    # Lee and Lee. "Vibration analysis of anisotropic plates with eccentric
    #    stiffeners". Computers & Structures, Vol. 57, No. 1, pp. 99-105,
    #    1995.
    for model in [
            'plate_clt_donnell_bardell', 'cpanel_clt_donnell_bardell',
            'kpanel_clt_donnell_bardell'
    ]:
        spb = StiffPanelBay()
        spb.a = 0.5
        spb.b = 0.250
        spb.plyt = 0.00013
        spb.laminaprop = (128.e9, 11.e9, 0.25, 4.48e9, 1.53e9, 1.53e9)
        spb.stack = [0, -45, +45, 90, 90, +45, -45, 0]
        spb.model = model
        spb.r = 1.e6
        spb.alphadeg = 0.
        spb.mu = 1.5e3
        spb.m = 9
        spb.n = 10

        # clamping
        spb.w1rx = 0.
        spb.w2rx = 0.
        spb.w1ry = 0.
        spb.w2ry = 0.

        spb.add_panel(0, spb.b / 2., plyt=spb.plyt)
        spb.add_panel(spb.b / 2., spb.b, plyt=spb.plyt)

        k0 = spb.calc_k0(silent=True)
        M = spb.calc_kM(silent=True)
        eigvals, eigvecs = freq(k0, M, silent=True)

        ref = [
            85.12907802 - 0.j, 134.16422850 - 0.j, 206.77295186 - 0.j,
            216.45992453 - 0.j, 252.24546171 - 0.j
        ]
        assert np.allclose(eigvals[:5] / 2 / np.pi, ref, atol=0.1, rtol=0)
Beispiel #13
0
def test_panel_freq():
    for model in ['plate_clt_donnell_bardell',
                  'plate_clt_donnell_bardell_w',
                  'cpanel_clt_donnell_bardell',
                  'kpanel_clt_donnell_bardell']:
        for prestress in [True, False]:
            print('Frequency Analysis, prestress={0}, model={1}'.format(
                  prestress, model))
            p = Panel()
            p.model = model
            p.a = 1.
            p.b = 0.5
            p.r = 1.e8
            p.alphadeg = 0.
            p.stack = [0, 90, -45, +45]
            p.plyt = 1e-3*0.125
            p.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
            p.mu = 1.3e3
            p.m = 11
            p.n = 12
            p.Nxx = -60.
            p.Nyy = -5.
            k0 = p.calc_k0(silent=True)
            M = p.calc_kM(silent=True)
            if prestress:
                kG0 = p.calc_kG0(silent=True)
                k0 += kG0
            eigvals, eigvecs = freq(k0, M, sparse_solver=True, reduced_dof=False, silent=True)
            if prestress:
                if '_w' in model:
                    assert np.isclose(eigvals[0], 19.9272, rtol=0.001)
                else:
                    assert np.isclose(eigvals[0], 17.85875, rtol=0.001)
            else:
                if '_w' in model:
                    assert np.isclose(eigvals[0], 40.37281, rtol=0.001)
                else:
                    assert np.isclose(eigvals[0], 39.31476, rtol=0.001)
Beispiel #14
0
def test_freq_models():
    print('Testing frequency analysis for StiffPanelBay with 2 plates')
    # From Table 4 of
    # Lee and Lee. "Vibration analysis of anisotropic plates with eccentric
    #    stiffeners". Computers & Structures, Vol. 57, No. 1, pp. 99-105,
    #    1995.
    for model in ['plate_clt_donnell_bardell',
                  'cpanel_clt_donnell_bardell',
                  'kpanel_clt_donnell_bardell']:
        spb = StiffPanelBay()
        spb.a = 0.5
        spb.b = 0.250
        spb.plyt = 0.00013
        spb.laminaprop = (128.e9, 11.e9, 0.25, 4.48e9, 1.53e9, 1.53e9)
        spb.stack = [0, -45, +45, 90, 90, +45, -45, 0]
        spb.model = model
        spb.r = 1.e6
        spb.alphadeg = 0.
        spb.mu = 1.5e3
        spb.m = 9
        spb.n = 10

        # clamping
        spb.w1rx = 0.
        spb.w2rx = 0.
        spb.w1ry = 0.
        spb.w2ry = 0.

        spb.add_panel(0, spb.b/2., plyt=spb.plyt)
        spb.add_panel(spb.b/2., spb.b, plyt=spb.plyt)

        k0 = spb.calc_k0(silent=True)
        M = spb.calc_kM(silent=True)
        eigvals, eigvecs = freq(k0, M, silent=True)

        ref = [85.12907802-0.j, 134.16422850-0.j, 206.77295186-0.j,
                216.45992453-0.j, 252.24546171-0.j]
        assert np.allclose(eigvals[:5]/2/np.pi, ref, atol=0.1, rtol=0)
Beispiel #15
0
def test_freq_Stiffener1D():
    print('Testing frequency analysis for StiffPanelBay with a 1D Stiffener')
    spb = StiffPanelBay()
    spb.a = 2.
    spb.b = 0.5
    spb.stack = [0, 90, 90, 0]
    spb.plyt = 1e-3*0.125
    spb.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
    spb.model = 'plate_clt_donnell_bardell'
    spb.mu = 1.3e3
    spb.m = 15
    spb.n = 16

    spb.add_panel(y1=0, y2=spb.b/2., plyt=spb.plyt)
    spb.add_panel(y1=spb.b/2., y2=spb.b, plyt=spb.plyt)

    spb.add_bladestiff1d(ys=spb.b/2., Fx=0., bf=0.08, fstack=[0, 90, 90, 0]*5,
            fplyt=spb.plyt, flaminaprop=spb.laminaprop)

    k0 = spb.calc_k0(silent=True)
    M = spb.calc_kM(silent=True)
    eigvals, eigvecs = freq(k0, M, silent=True, num_eigvalues=10)

    assert np.isclose(eigvals[0].real, 79.5906673583, atol=0.1, rtol=0)
def tstiff2d_1stiff_freq(a, b, ys, bb, bf, defect_a, mu, plyt, laminaprop,
        stack_skin, stack_base, stack_flange,
        r=None, m=8, n=8, mb=None, nb=None, mf=None, nf=None):
    r"""Frequency T-Stiffened Panel with possible defect at middle

    For more details about each parameter and the aerodynamic formulation see
    Ref. [castro2016FlutterPanel]_ .

    For more details about the theory involved on the assembly of panels, see
    [castro2017AssemblyModels]_.

    The panel assembly looks like::

        skin
         _________ _____ _________
        |         |     |         |
        |         |     |         |
        |   p01   | p02 |   p03   |
        |         |     |         |
        |_________|_____|_________|
        |   p04   | p05 |   p06   |
        |_________|_____|_________|
        |         |     |         |
        |         |     |         |
        |   p07   | p08 |   p09   |
        |         |     |         |
        |         |     |         |
        |_________|_____|_________|

                  base            flange
                   _____           _____
                  |     |         |     |
                  |     |         |     |
                  | p10 |         | p11 |
                  |     |         |     |
                  |_____|         |_____|
                  | p12 |         | p13 |
                  |_____|         |_____|
                  |     |         |     |
                  |     |         |     |
                  | p14 |         | p15 |
                  |     |         |     |
                  |     |         |     |
                  |_____|         |_____|

    Parameters
    ----------

    a : float
        Total length of the assembly (along `x`).
    b : float
        Total width of the assembly (along `y`).
    ys : float
        Position of the stiffener along `y`.
    bb : float
        Stiffener's base width.
    bf : float
        Stiffener's flange width.
    defect_a : float
        Debonding defect/assembly length ratio.
    mu : float
        Material density.
    plyt : float
        Ply thickness.
    laminaprop : list or tuple
        Orthotropic lamina properties: `E_1, E_2, \nu_{12}, G_{12}, G_{13}, G_{23}`.
    stack_skin : list or tuple
        Stacking sequence for the skin.
    stack_base : list or tuple
        Stacking sequence for the stiffener's base.
    stack_flange : list or tuple
        Stacking sequence for the stiffener's flange.
    r : float or None, optional
        Radius of the stiffened panel.
    m, n : int, optional
        Number of terms of the approximation function for the skin.
    mb, nb : int, optional
        Number of terms of the approximation function for the stiffener's base.
    mf, nf : int, optional
        Number of terms of the approximation function for the stiffener's
        flange.

    Examples
    --------

    The following example is one of the test cases:

    .. literalinclude:: ../../../../../compmech/panel/assembly/tests/test_tstiff2d_assembly.py
        :pyobject: test_tstiff2d_1stiff_freq


    """
    defect = defect_a * a
    has_defect = True if defect > 0 else False
    defect = 0.33*a if defect == 0 else defect # to avoid weird domains
    aup = (a - defect)/2.
    alow = (a - defect)/2.
    bleft = b - ys - bb/2.
    bright = ys - bb/2.
    mb = m if mb is None else mb
    nb = n if nb is None else nb
    mf = m if mf is None else mf
    nf = n if nf is None else nf
    # skin panels
    p01 = Panel(group='skin', x0=alow+defect, y0=ys+bb/2., a=aup, b=bleft, r=r, m=m, n=n, plyt=plyt, stack=stack_skin, laminaprop=laminaprop, mu=mu)
    p02 = Panel(group='skin', x0=alow+defect, y0=ys-bb/2., a=aup, b=bb, r=r, m=m, n=n, plyt=plyt, stack=stack_skin, laminaprop=laminaprop, mu=mu)
    p03 = Panel(group='skin', x0=alow+defect, y0=0,        a=aup, b=bright, r=r, m=m, n=n, plyt=plyt, stack=stack_skin, laminaprop=laminaprop, mu=mu)
    # defect
    p04 = Panel(group='skin', x0=alow, y0=ys+bb/2., a=defect, b=bleft, r=r, m=m, n=n, plyt=plyt, stack=stack_skin, laminaprop=laminaprop, mu=mu)
    p05 = Panel(group='skin', x0=alow, y0=ys-bb/2., a=defect, b=bb, r=r, m=m, n=n, plyt=plyt, stack=stack_skin, laminaprop=laminaprop, mu=mu)
    p06 = Panel(group='skin', x0=alow, y0=0,        a=defect, b=bright, r=r, m=m, n=n, plyt=plyt, stack=stack_skin, laminaprop=laminaprop, mu=mu)
    #
    p07 = Panel(group='skin', x0=0, y0=ys+bb/2., a=alow, b=bleft, r=r, m=m, n=n, plyt=plyt, stack=stack_skin, laminaprop=laminaprop, mu=mu)
    p08 = Panel(group='skin', x0=0, y0=ys-bb/2., a=alow, b=bb, r=r, m=m, n=n, plyt=plyt, stack=stack_skin, laminaprop=laminaprop, mu=mu)
    p09 = Panel(group='skin', x0=0, y0=0,        a=alow, b=bright, r=r, m=m, n=n, plyt=plyt, stack=stack_skin, laminaprop=laminaprop, mu=mu)

    # stiffeners
    p10 = Panel(group='base', x0=alow+defect, y0=ys-bb/2., a=aup, b=bb, r=r, m=mb, n=nb, plyt=plyt, stack=stack_base, laminaprop=laminaprop, mu=mu)
    p11 = Panel(group='flange', x0=alow+defect, y0=0,        a=aup, b=bf, m=mf, n=nf, plyt=plyt, stack=stack_flange, laminaprop=laminaprop, mu=mu)
    # defect
    p12 = Panel(group='base', x0=alow, y0=ys-bb/2., a=defect, b=bb, r=r, m=mb, n=nb, plyt=plyt, stack=stack_base, laminaprop=laminaprop, mu=mu)
    p13 = Panel(group='flange', x0=alow, y0=0,        a=defect, b=bf, m=mf, n=nf, plyt=plyt, stack=stack_flange, laminaprop=laminaprop, mu=mu)
    #
    p14 = Panel(group='base', x0=0, y0=ys-bb/2., a=alow, b=bb, r=r, m=mb, n=nb, plyt=plyt, stack=stack_base, laminaprop=laminaprop, mu=mu)
    p15 = Panel(group='flange', x0=0, y0=0,        a=alow, b=bf, m=mf, n=nf, plyt=plyt, stack=stack_flange, laminaprop=laminaprop, mu=mu)

    # boundary conditions
    p01.u1tx = 1 ; p01.u1rx = 1 ; p01.u2tx = 0 ; p01.u2rx = 1
    p01.v1tx = 1 ; p01.v1rx = 1 ; p01.v2tx = 0 ; p01.v2rx = 1
    p01.w1tx = 1 ; p01.w1rx = 1 ; p01.w2tx = 0 ; p01.w2rx = 1
    p01.u1ty = 1 ; p01.u1ry = 1 ; p01.u2ty = 0 ; p01.u2ry = 1
    p01.v1ty = 1 ; p01.v1ry = 1 ; p01.v2ty = 0 ; p01.v2ry = 1
    p01.w1ty = 1 ; p01.w1ry = 1 ; p01.w2ty = 0 ; p01.w2ry = 1

    p02.u1tx = 1 ; p02.u1rx = 1 ; p02.u2tx = 0 ; p02.u2rx = 1
    p02.v1tx = 1 ; p02.v1rx = 1 ; p02.v2tx = 0 ; p02.v2rx = 1
    p02.w1tx = 1 ; p02.w1rx = 1 ; p02.w2tx = 0 ; p02.w2rx = 1
    p02.u1ty = 1 ; p02.u1ry = 1 ; p02.u2ty = 1 ; p02.u2ry = 1
    p02.v1ty = 1 ; p02.v1ry = 1 ; p02.v2ty = 1 ; p02.v2ry = 1
    p02.w1ty = 1 ; p02.w1ry = 1 ; p02.w2ty = 1 ; p02.w2ry = 1

    p03.u1tx = 1 ; p03.u1rx = 1 ; p03.u2tx = 0 ; p03.u2rx = 1
    p03.v1tx = 1 ; p03.v1rx = 1 ; p03.v2tx = 0 ; p03.v2rx = 1
    p03.w1tx = 1 ; p03.w1rx = 1 ; p03.w2tx = 0 ; p03.w2rx = 1
    p03.u1ty = 0 ; p03.u1ry = 1 ; p03.u2ty = 1 ; p03.u2ry = 1
    p03.v1ty = 0 ; p03.v1ry = 1 ; p03.v2ty = 1 ; p03.v2ry = 1
    p03.w1ty = 0 ; p03.w1ry = 1 ; p03.w2ty = 1 ; p03.w2ry = 1

    p04.u1tx = 1 ; p04.u1rx = 1 ; p04.u2tx = 1 ; p04.u2rx = 1
    p04.v1tx = 1 ; p04.v1rx = 1 ; p04.v2tx = 1 ; p04.v2rx = 1
    p04.w1tx = 1 ; p04.w1rx = 1 ; p04.w2tx = 1 ; p04.w2rx = 1
    p04.u1ty = 1 ; p04.u1ry = 1 ; p04.u2ty = 0 ; p04.u2ry = 1
    p04.v1ty = 1 ; p04.v1ry = 1 ; p04.v2ty = 0 ; p04.v2ry = 1
    p04.w1ty = 1 ; p04.w1ry = 1 ; p04.w2ty = 0 ; p04.w2ry = 1

    p05.u1tx = 1 ; p05.u1rx = 1 ; p05.u2tx = 1 ; p05.u2rx = 1
    p05.v1tx = 1 ; p05.v1rx = 1 ; p05.v2tx = 1 ; p05.v2rx = 1
    p05.w1tx = 1 ; p05.w1rx = 1 ; p05.w2tx = 1 ; p05.w2rx = 1
    p05.u1ty = 1 ; p05.u1ry = 1 ; p05.u2ty = 1 ; p05.u2ry = 1
    p05.v1ty = 1 ; p05.v1ry = 1 ; p05.v2ty = 1 ; p05.v2ry = 1
    p05.w1ty = 1 ; p05.w1ry = 1 ; p05.w2ty = 1 ; p05.w2ry = 1

    p06.u1tx = 1 ; p06.u1rx = 1 ; p06.u2tx = 1 ; p06.u2rx = 1
    p06.v1tx = 1 ; p06.v1rx = 1 ; p06.v2tx = 1 ; p06.v2rx = 1
    p06.w1tx = 1 ; p06.w1rx = 1 ; p06.w2tx = 1 ; p06.w2rx = 1
    p06.u1ty = 0 ; p06.u1ry = 1 ; p06.u2ty = 1 ; p06.u2ry = 1
    p06.v1ty = 0 ; p06.v1ry = 1 ; p06.v2ty = 1 ; p06.v2ry = 1
    p06.w1ty = 0 ; p06.w1ry = 1 ; p06.w2ty = 1 ; p06.w2ry = 1

    p07.u1tx = 0 ; p07.u1rx = 1 ; p07.u2tx = 1 ; p07.u2rx = 1
    p07.v1tx = 0 ; p07.v1rx = 1 ; p07.v2tx = 1 ; p07.v2rx = 1
    p07.w1tx = 0 ; p07.w1rx = 1 ; p07.w2tx = 1 ; p07.w2rx = 1
    p07.u1ty = 1 ; p07.u1ry = 1 ; p07.u2ty = 0 ; p07.u2ry = 1
    p07.v1ty = 1 ; p07.v1ry = 1 ; p07.v2ty = 0 ; p07.v2ry = 1
    p07.w1ty = 1 ; p07.w1ry = 1 ; p07.w2ty = 0 ; p07.w2ry = 1

    p08.u1tx = 0 ; p08.u1rx = 1 ; p08.u2tx = 1 ; p08.u2rx = 1
    p08.v1tx = 0 ; p08.v1rx = 1 ; p08.v2tx = 1 ; p08.v2rx = 1
    p08.w1tx = 0 ; p08.w1rx = 1 ; p08.w2tx = 1 ; p08.w2rx = 1
    p08.u1ty = 1 ; p08.u1ry = 1 ; p08.u2ty = 1 ; p08.u2ry = 1
    p08.v1ty = 1 ; p08.v1ry = 1 ; p08.v2ty = 1 ; p08.v2ry = 1
    p08.w1ty = 1 ; p08.w1ry = 1 ; p08.w2ty = 1 ; p08.w2ry = 1

    p09.u1tx = 0 ; p09.u1rx = 1 ; p09.u2tx = 1 ; p09.u2rx = 1
    p09.v1tx = 0 ; p09.v1rx = 1 ; p09.v2tx = 1 ; p09.v2rx = 1
    p09.w1tx = 0 ; p09.w1rx = 1 ; p09.w2tx = 1 ; p09.w2rx = 1
    p09.u1ty = 0 ; p09.u1ry = 1 ; p09.u2ty = 1 ; p09.u2ry = 1
    p09.v1ty = 0 ; p09.v1ry = 1 ; p09.v2ty = 1 ; p09.v2ry = 1
    p09.w1ty = 0 ; p09.w1ry = 1 ; p09.w2ty = 1 ; p09.w2ry = 1

    # base up
    p10.u1tx = 1 ; p10.u1rx = 1 ; p10.u2tx = 1 ; p10.u2rx = 1
    p10.v1tx = 1 ; p10.v1rx = 1 ; p10.v2tx = 1 ; p10.v2rx = 1
    p10.w1tx = 1 ; p10.w1rx = 1 ; p10.w2tx = 1 ; p10.w2rx = 1
    p10.u1ty = 1 ; p10.u1ry = 1 ; p10.u2ty = 1 ; p10.u2ry = 1
    p10.v1ty = 1 ; p10.v1ry = 1 ; p10.v2ty = 1 ; p10.v2ry = 1
    p10.w1ty = 1 ; p10.w1ry = 1 ; p10.w2ty = 1 ; p10.w2ry = 1

    # flange up
    p11.u1tx = 1 ; p11.u1rx = 1 ; p11.u2tx = 0 ; p11.u2rx = 1
    p11.v1tx = 1 ; p11.v1rx = 1 ; p11.v2tx = 0 ; p11.v2rx = 1
    p11.w1tx = 1 ; p11.w1rx = 1 ; p11.w2tx = 0 ; p11.w2rx = 1
    p11.u1ty = 1 ; p11.u1ry = 1 ; p11.u2ty = 1 ; p11.u2ry = 1
    p11.v1ty = 1 ; p11.v1ry = 1 ; p11.v2ty = 1 ; p11.v2ry = 1
    p11.w1ty = 1 ; p11.w1ry = 1 ; p11.w2ty = 1 ; p11.w2ry = 1

    # base mid
    p12.u1tx = 1 ; p12.u1rx = 1 ; p12.u2tx = 1 ; p12.u2rx = 1
    p12.v1tx = 1 ; p12.v1rx = 1 ; p12.v2tx = 1 ; p12.v2rx = 1
    p12.w1tx = 1 ; p12.w1rx = 1 ; p12.w2tx = 1 ; p12.w2rx = 1
    p12.u1ty = 1 ; p12.u1ry = 1 ; p12.u2ty = 1 ; p12.u2ry = 1
    p12.v1ty = 1 ; p12.v1ry = 1 ; p12.v2ty = 1 ; p12.v2ry = 1
    p12.w1ty = 1 ; p12.w1ry = 1 ; p12.w2ty = 1 ; p12.w2ry = 1

    # flange mid
    p13.u1tx = 1 ; p13.u1rx = 1 ; p13.u2tx = 1 ; p13.u2rx = 1
    p13.v1tx = 1 ; p13.v1rx = 1 ; p13.v2tx = 1 ; p13.v2rx = 1
    p13.w1tx = 1 ; p13.w1rx = 1 ; p13.w2tx = 1 ; p13.w2rx = 1
    p13.u1ty = 1 ; p13.u1ry = 1 ; p13.u2ty = 1 ; p13.u2ry = 1
    p13.v1ty = 1 ; p13.v1ry = 1 ; p13.v2ty = 1 ; p13.v2ry = 1
    p13.w1ty = 1 ; p13.w1ry = 1 ; p13.w2ty = 1 ; p13.w2ry = 1

    # base low
    p14.u1tx = 1 ; p14.u1rx = 1 ; p14.u2tx = 1 ; p14.u2rx = 1
    p14.v1tx = 1 ; p14.v1rx = 1 ; p14.v2tx = 1 ; p14.v2rx = 1
    p14.w1tx = 1 ; p14.w1rx = 1 ; p14.w2tx = 1 ; p14.w2rx = 1
    p14.u1ty = 1 ; p14.u1ry = 1 ; p14.u2ty = 1 ; p14.u2ry = 1
    p14.v1ty = 1 ; p14.v1ry = 1 ; p14.v2ty = 1 ; p14.v2ry = 1
    p14.w1ty = 1 ; p14.w1ry = 1 ; p14.w2ty = 1 ; p14.w2ry = 1

    # flange low
    p15.u1tx = 0 ; p15.u1rx = 1 ; p15.u2tx = 1 ; p15.u2rx = 1
    p15.v1tx = 0 ; p15.v1rx = 1 ; p15.v2tx = 1 ; p15.v2rx = 1
    p15.w1tx = 0 ; p15.w1rx = 1 ; p15.w2tx = 1 ; p15.w2rx = 1
    p15.u1ty = 1 ; p15.u1ry = 1 ; p15.u2ty = 1 ; p15.u2ry = 1
    p15.v1ty = 1 ; p15.v1ry = 1 ; p15.v2ty = 1 ; p15.v2ry = 1
    p15.w1ty = 1 ; p15.w1ry = 1 ; p15.w2ty = 1 ; p15.w2ry = 1

    conn = [
        # skin-skin
        dict(p1=p01, p2=p02, func='SSycte', ycte1=0, ycte2=p02.b),
        dict(p1=p01, p2=p04, func='SSxcte', xcte1=0, xcte2=p04.a),
        dict(p1=p02, p2=p03, func='SSycte', ycte1=0, ycte2=p03.b),
        dict(p1=p02, p2=p05, func='SSxcte', xcte1=0, xcte2=p05.a),
        dict(p1=p03, p2=p06, func='SSxcte', xcte1=0, xcte2=p06.a),
        dict(p1=p04, p2=p05, func='SSycte', ycte1=0, ycte2=p05.b),
        dict(p1=p04, p2=p07, func='SSxcte', xcte1=0, xcte2=p07.a),
        dict(p1=p05, p2=p06, func='SSycte', ycte1=0, ycte2=p06.b),
        dict(p1=p05, p2=p08, func='SSxcte', xcte1=0, xcte2=p08.a),
        dict(p1=p06, p2=p09, func='SSxcte', xcte1=0, xcte2=p09.a),
        dict(p1=p07, p2=p08, func='SSycte', ycte1=0, ycte2=p08.b),
        dict(p1=p08, p2=p09, func='SSycte', ycte1=0, ycte2=p09.b),

        # skin-base
        dict(p1=p02, p2=p10, func='SB'),
        dict(p1=p05, p2=p12, func='SB', has_defect=has_defect), # defect
        dict(p1=p08, p2=p14, func='SB'),

        # base-base
        dict(p1=p10, p2=p12, func='SSxcte', xcte1=0, xcte2=p12.a),
        dict(p1=p12, p2=p14, func='SSxcte', xcte1=0, xcte2=p14.a),

        # base-flange
        dict(p1=p10, p2=p11, func='BFycte', ycte1=p10.b/2., ycte2=0),
        dict(p1=p12, p2=p13, func='BFycte', ycte1=p12.b/2., ycte2=0),
        dict(p1=p14, p2=p15, func='BFycte', ycte1=p14.b/2., ycte2=0),

        # flange-flange
        dict(p1=p11, p2=p13, func='SSxcte', xcte1=0, xcte2=p13.a),
        dict(p1=p13, p2=p15, func='SSxcte', xcte1=0, xcte2=p15.a),
        ]

    panels = [p01, p02, p03, p04, p05, p06, p07, p08, p09,
            p10, p11, p12, p13, p14, p15]
    skin = [p01, p02, p03, p04, p05, p06, p07, p08, p09]
    base = [p10, p12, p14]
    flange = [p11, p13, p15]

    assy = PanelAssembly(panels)

    size = assy.get_size()

    valid_conn = []
    for connecti in conn:
        if connecti.get('has_defect'):
            continue
        valid_conn.append(connecti)

    k0 = assy.calc_k0(conn=valid_conn)
    kM = assy.calc_kM()

    eigvals, eigvecs = freq(k0, kM, tol=0, sparse_solver=True, silent=True,
             sort=True, reduced_dof=False,
             num_eigvalues=25, num_eigvalues_print=5)

    return assy, eigvals, eigvecs
def tstiff2d_1stiff_flutter(a, b, ys, bb, bf, defect_a, mu, plyt,
        laminaprop, stack_skin, stack_base, stack_flange,
        air_speed=None, rho_air=None, Mach=None, speed_sound=None, flow='x',
        Nxx_skin=None, Nxx_base=None, Nxx_flange=None, run_static_case=True,
        r=None, m=8, n=8, mb=None, nb=None, mf=None, nf=None):
    r"""Flutter of T-Stiffened Panel with possible defect at middle

    For more details about each parameter and the aerodynamic formulation see
    Ref. [castro2016FlutterPanel]_ .


    The panel assembly looks like::

        skin
         _________ _____ _________
        |         |     |         |
        |         |     |         |
        |   p01   | p02 |   p03   |
        |         |     |         |
        |_________|_____|_________|
        |   p04   | p05 |   p06   |      /\  x
        |_________|_____|_________|       |
        |         |     |         |       |
        |         |     |         |       |
        |   p07   | p08 |   p09   |
        |         |     |         |
        |         |     |         |
        |_________|_____|_________|
               loaded edge

                  base            flange
                   _____           _____
                  |     |         |     |
                  |     |         |     |
                  | p10 |         | p11 |
                  |     |         |     |
                  |_____|         |_____|
                  | p12 |         | p13 |
                  |_____|         |_____|
                  |     |         |     |
                  |     |         |     |
                  | p14 |         | p15 |
                  |     |         |     |
                  |     |         |     |
                  |_____|         |_____|
               loaded edge     loaded edge

    Parameters
    ----------

    a : float
        Total length of the assembly (along `x`).
    b : float
        Total width of the assembly (along `y`).
    ys : float
        Position of the stiffener along `y`.
    bb : float
        Stiffener's base width.
    bf : float
        Stiffener's flange width.
    defect_a : float
        Debonding defect/assembly length ratio.
    mu : float
        Material density.
    plyt : float
        Ply thickness.
    laminaprop : list or tuple
        Orthotropic lamina properties: `E_1, E_2, \nu_{12}, G_{12}, G_{13}, G_{23}`.
    stack_skin : list or tuple
        Stacking sequence for the skin.
    stack_base : list or tuple
        Stacking sequence for the stiffener's base.
    stack_flange : list or tuple
        Stacking sequence for the stiffener's flange.
    air_speed : float
        Airflow speed.
    rho_air : float
        Air density.
    Mach : float
        Mach number.
    speed_sound : float
        Speed of sound.
    flow : "x" or "y"
        Direction of airflow.
    Nxx_skin : float
        Skin load distributed at the assembly edge at `x=0`.
    Nxx_base : float
        Stiffener's base load distributed at the assembly edge at `x=0`.
    Nxx_flange : float
        Stiffener's flange load distributed at the assembly edge at `x=0`.
    run_static_case : bool, optional
        If True a static analysis is run before the linear buckling analysis
        to compute the real membrane stress state along the domain, otherwise
        it is assumed constant values of `N_{xx}` for all components.
    r : float or None, optional
        Radius of the stiffened panel.
    m, n : int, optional
        Number of terms of the approximation function for the skin.
    mb, nb : int, optional
        Number of terms of the approximation function for the stiffener's base.
    mf, nf : int, optional
        Number of terms of the approximation function for the stiffener's
        flange.

    Examples
    --------

    The following example is one of the test cases:

    .. literalinclude:: ../../../../../compmech/panel/assembly/tests/test_tstiff2d_assembly.py
        :pyobject: test_tstiff2d_1stiff_flutter

    """
    defect = defect_a * a
    has_defect = True if defect > 0 else False
    defect = 0.33*a if defect == 0 else defect # to avoid weird domains
    aup = (a - defect)/2.
    alow = (a - defect)/2.
    bleft = b - ys - bb/2.
    bright = ys - bb/2.
    mb = m if mb is None else mb
    nb = n if nb is None else nb
    mf = m if mf is None else mf
    nf = n if nf is None else nf
    # skin panels
    p01 = Panel(group='skin', Nxx=Nxx_skin, x0=alow+defect, y0=ys+bb/2., a=aup, b=bleft, r=r, m=m, n=n, plyt=plyt, stack=stack_skin, laminaprop=laminaprop, mu=mu, rho_air=rho_air, speed_sound=speed_sound, Mach=Mach, V=air_speed, flow=flow)
    p02 = Panel(group='skin', Nxx=Nxx_skin, x0=alow+defect, y0=ys-bb/2., a=aup, b=bb, r=r, m=m, n=n, plyt=plyt, stack=stack_skin, laminaprop=laminaprop, mu=mu, rho_air=rho_air, speed_sound=speed_sound, Mach=Mach, V=air_speed, flow=flow)
    p03 = Panel(group='skin', Nxx=Nxx_skin, x0=alow+defect, y0=0, a=aup, b=bright, r=r, m=m, n=n, plyt=plyt, stack=stack_skin, laminaprop=laminaprop, mu=mu, rho_air=rho_air, speed_sound=speed_sound, Mach=Mach, V=air_speed, flow=flow)
    # defect
    p04 = Panel(group='skin', Nxx=Nxx_skin, x0=alow, y0=ys+bb/2., a=defect, b=bleft, r=r, m=m, n=n, plyt=plyt, stack=stack_skin, laminaprop=laminaprop, mu=mu, rho_air=rho_air, speed_sound=speed_sound, Mach=Mach, V=air_speed, flow=flow)
    p05 = Panel(group='skin', Nxx=Nxx_skin, x0=alow, y0=ys-bb/2., a=defect, b=bb, r=r, m=m, n=n, plyt=plyt, stack=stack_skin, laminaprop=laminaprop, mu=mu, rho_air=rho_air, speed_sound=speed_sound, Mach=Mach, V=air_speed, flow=flow)
    p06 = Panel(group='skin', Nxx=Nxx_skin, x0=alow, y0=0, a=defect, b=bright, r=r, m=m, n=n, plyt=plyt, stack=stack_skin, laminaprop=laminaprop, mu=mu, rho_air=rho_air, speed_sound=speed_sound, Mach=Mach, V=air_speed, flow=flow)
    #
    p07 = Panel(group='skin', Nxx=Nxx_skin, x0=0, y0=ys+bb/2., a=alow, b=bleft, r=r, m=m, n=n, plyt=plyt, stack=stack_skin, laminaprop=laminaprop, mu=mu, rho_air=rho_air, speed_sound=speed_sound, Mach=Mach, V=air_speed, flow=flow)
    p08 = Panel(group='skin', Nxx=Nxx_skin, x0=0, y0=ys-bb/2., a=alow, b=bb, r=r, m=m, n=n, plyt=plyt, stack=stack_skin, laminaprop=laminaprop, mu=mu, rho_air=rho_air, speed_sound=speed_sound, Mach=Mach, V=air_speed, flow=flow)
    p09 = Panel(group='skin', Nxx=Nxx_skin, x0=0, y0=0, a=alow, b=bright, r=r, m=m, n=n, plyt=plyt, stack=stack_skin, laminaprop=laminaprop, mu=mu, rho_air=rho_air, speed_sound=speed_sound, Mach=Mach, V=air_speed, flow=flow)

    # stiffeners
    p10 = Panel(group='base', Nxx=Nxx_base, x0=alow+defect, y0=ys-bb/2., a=aup, b=bb, r=r, m=mb, n=nb, plyt=plyt, stack=stack_base, laminaprop=laminaprop, mu=mu)
    p11 = Panel(group='flange', Nxx=Nxx_flange, x0=alow+defect, y0=0,        a=aup, b=bf, m=mf, n=nf, plyt=plyt, stack=stack_flange, laminaprop=laminaprop, mu=mu)
    # defect
    p12 = Panel(group='base', Nxx=Nxx_base, x0=alow, y0=ys-bb/2., a=defect, b=bb, r=r, m=mb, n=nb, plyt=plyt, stack=stack_base, laminaprop=laminaprop, mu=mu)
    p13 = Panel(group='flange', Nxx=Nxx_flange, x0=alow, y0=0,        a=defect, b=bf, m=mf, n=nf, plyt=plyt, stack=stack_flange, laminaprop=laminaprop, mu=mu)
    #
    p14 = Panel(group='base', Nxx=Nxx_base, x0=0, y0=ys-bb/2., a=alow, b=bb, r=r, m=mb, n=nb, plyt=plyt, stack=stack_base, laminaprop=laminaprop, mu=mu)
    p15 = Panel(group='flange', Nxx=Nxx_flange, x0=0, y0=0,        a=alow, b=bf, m=mf, n=nf, plyt=plyt, stack=stack_flange, laminaprop=laminaprop, mu=mu)

    # boundary conditions
    p01.u1tx = 1 ; p01.u1rx = 1 ; p01.u2tx = 0 ; p01.u2rx = 1
    p01.v1tx = 1 ; p01.v1rx = 1 ; p01.v2tx = 0 ; p01.v2rx = 1
    p01.w1tx = 1 ; p01.w1rx = 1 ; p01.w2tx = 0 ; p01.w2rx = 1
    p01.u1ty = 1 ; p01.u1ry = 1 ; p01.u2ty = 1 ; p01.u2ry = 1
    p01.v1ty = 1 ; p01.v1ry = 1 ; p01.v2ty = 0 ; p01.v2ry = 1
    p01.w1ty = 1 ; p01.w1ry = 1 ; p01.w2ty = 0 ; p01.w2ry = 1

    p02.u1tx = 1 ; p02.u1rx = 1 ; p02.u2tx = 0 ; p02.u2rx = 1
    p02.v1tx = 1 ; p02.v1rx = 1 ; p02.v2tx = 0 ; p02.v2rx = 1
    p02.w1tx = 1 ; p02.w1rx = 1 ; p02.w2tx = 0 ; p02.w2rx = 1
    p02.u1ty = 1 ; p02.u1ry = 1 ; p02.u2ty = 1 ; p02.u2ry = 1
    p02.v1ty = 1 ; p02.v1ry = 1 ; p02.v2ty = 1 ; p02.v2ry = 1
    p02.w1ty = 1 ; p02.w1ry = 1 ; p02.w2ty = 1 ; p02.w2ry = 1

    p03.u1tx = 1 ; p03.u1rx = 1 ; p03.u2tx = 0 ; p03.u2rx = 1
    p03.v1tx = 1 ; p03.v1rx = 1 ; p03.v2tx = 0 ; p03.v2rx = 1
    p03.w1tx = 1 ; p03.w1rx = 1 ; p03.w2tx = 0 ; p03.w2rx = 1
    p03.u1ty = 1 ; p03.u1ry = 1 ; p03.u2ty = 1 ; p03.u2ry = 1
    p03.v1ty = 0 ; p03.v1ry = 1 ; p03.v2ty = 1 ; p03.v2ry = 1
    p03.w1ty = 0 ; p03.w1ry = 1 ; p03.w2ty = 1 ; p03.w2ry = 1

    p04.u1tx = 1 ; p04.u1rx = 1 ; p04.u2tx = 1 ; p04.u2rx = 1
    p04.v1tx = 1 ; p04.v1rx = 1 ; p04.v2tx = 1 ; p04.v2rx = 1
    p04.w1tx = 1 ; p04.w1rx = 1 ; p04.w2tx = 1 ; p04.w2rx = 1
    p04.u1ty = 1 ; p04.u1ry = 1 ; p04.u2ty = 1 ; p04.u2ry = 1
    p04.v1ty = 1 ; p04.v1ry = 1 ; p04.v2ty = 0 ; p04.v2ry = 1
    p04.w1ty = 1 ; p04.w1ry = 1 ; p04.w2ty = 0 ; p04.w2ry = 1

    p05.u1tx = 1 ; p05.u1rx = 1 ; p05.u2tx = 1 ; p05.u2rx = 1
    p05.v1tx = 1 ; p05.v1rx = 1 ; p05.v2tx = 1 ; p05.v2rx = 1
    p05.w1tx = 1 ; p05.w1rx = 1 ; p05.w2tx = 1 ; p05.w2rx = 1
    p05.u1ty = 1 ; p05.u1ry = 1 ; p05.u2ty = 1 ; p05.u2ry = 1
    p05.v1ty = 1 ; p05.v1ry = 1 ; p05.v2ty = 1 ; p05.v2ry = 1
    p05.w1ty = 1 ; p05.w1ry = 1 ; p05.w2ty = 1 ; p05.w2ry = 1

    p06.u1tx = 1 ; p06.u1rx = 1 ; p06.u2tx = 1 ; p06.u2rx = 1
    p06.v1tx = 1 ; p06.v1rx = 1 ; p06.v2tx = 1 ; p06.v2rx = 1
    p06.w1tx = 1 ; p06.w1rx = 1 ; p06.w2tx = 1 ; p06.w2rx = 1
    p06.u1ty = 1 ; p06.u1ry = 1 ; p06.u2ty = 1 ; p06.u2ry = 1
    p06.v1ty = 0 ; p06.v1ry = 1 ; p06.v2ty = 1 ; p06.v2ry = 1
    p06.w1ty = 0 ; p06.w1ry = 1 ; p06.w2ty = 1 ; p06.w2ry = 1

    p07.u1tx = 1 ; p07.u1rx = 1 ; p07.u2tx = 1 ; p07.u2rx = 1
    p07.v1tx = 0 ; p07.v1rx = 1 ; p07.v2tx = 1 ; p07.v2rx = 1
    p07.w1tx = 0 ; p07.w1rx = 1 ; p07.w2tx = 1 ; p07.w2rx = 1
    p07.u1ty = 1 ; p07.u1ry = 1 ; p07.u2ty = 1 ; p07.u2ry = 1
    p07.v1ty = 1 ; p07.v1ry = 1 ; p07.v2ty = 0 ; p07.v2ry = 1
    p07.w1ty = 1 ; p07.w1ry = 1 ; p07.w2ty = 0 ; p07.w2ry = 1

    p08.u1tx = 1 ; p08.u1rx = 1 ; p08.u2tx = 1 ; p08.u2rx = 1
    p08.v1tx = 0 ; p08.v1rx = 1 ; p08.v2tx = 1 ; p08.v2rx = 1
    p08.w1tx = 0 ; p08.w1rx = 1 ; p08.w2tx = 1 ; p08.w2rx = 1
    p08.u1ty = 1 ; p08.u1ry = 1 ; p08.u2ty = 1 ; p08.u2ry = 1
    p08.v1ty = 1 ; p08.v1ry = 1 ; p08.v2ty = 1 ; p08.v2ry = 1
    p08.w1ty = 1 ; p08.w1ry = 1 ; p08.w2ty = 1 ; p08.w2ry = 1

    p09.u1tx = 1 ; p09.u1rx = 1 ; p09.u2tx = 1 ; p09.u2rx = 1
    p09.v1tx = 0 ; p09.v1rx = 1 ; p09.v2tx = 1 ; p09.v2rx = 1
    p09.w1tx = 0 ; p09.w1rx = 1 ; p09.w2tx = 1 ; p09.w2rx = 1
    p09.u1ty = 1 ; p09.u1ry = 1 ; p09.u2ty = 1 ; p09.u2ry = 1
    p09.v1ty = 0 ; p09.v1ry = 1 ; p09.v2ty = 1 ; p09.v2ry = 1
    p09.w1ty = 0 ; p09.w1ry = 1 ; p09.w2ty = 1 ; p09.w2ry = 1

    # base up
    p10.u1tx = 1 ; p10.u1rx = 1 ; p10.u2tx = 1 ; p10.u2rx = 1
    p10.v1tx = 1 ; p10.v1rx = 1 ; p10.v2tx = 1 ; p10.v2rx = 1
    p10.w1tx = 1 ; p10.w1rx = 1 ; p10.w2tx = 1 ; p10.w2rx = 1
    p10.u1ty = 1 ; p10.u1ry = 1 ; p10.u2ty = 1 ; p10.u2ry = 1
    p10.v1ty = 1 ; p10.v1ry = 1 ; p10.v2ty = 1 ; p10.v2ry = 1
    p10.w1ty = 1 ; p10.w1ry = 1 ; p10.w2ty = 1 ; p10.w2ry = 1

    # flange up
    p11.u1tx = 1 ; p11.u1rx = 1 ; p11.u2tx = 0 ; p11.u2rx = 1
    p11.v1tx = 1 ; p11.v1rx = 1 ; p11.v2tx = 0 ; p11.v2rx = 1
    p11.w1tx = 1 ; p11.w1rx = 1 ; p11.w2tx = 0 ; p11.w2rx = 1
    p11.u1ty = 1 ; p11.u1ry = 1 ; p11.u2ty = 1 ; p11.u2ry = 1
    p11.v1ty = 1 ; p11.v1ry = 1 ; p11.v2ty = 1 ; p11.v2ry = 1
    p11.w1ty = 1 ; p11.w1ry = 1 ; p11.w2ty = 1 ; p11.w2ry = 1

    # base mid
    p12.u1tx = 1 ; p12.u1rx = 1 ; p12.u2tx = 1 ; p12.u2rx = 1
    p12.v1tx = 1 ; p12.v1rx = 1 ; p12.v2tx = 1 ; p12.v2rx = 1
    p12.w1tx = 1 ; p12.w1rx = 1 ; p12.w2tx = 1 ; p12.w2rx = 1
    p12.u1ty = 1 ; p12.u1ry = 1 ; p12.u2ty = 1 ; p12.u2ry = 1
    p12.v1ty = 1 ; p12.v1ry = 1 ; p12.v2ty = 1 ; p12.v2ry = 1
    p12.w1ty = 1 ; p12.w1ry = 1 ; p12.w2ty = 1 ; p12.w2ry = 1

    # flange mid
    p13.u1tx = 1 ; p13.u1rx = 1 ; p13.u2tx = 1 ; p13.u2rx = 1
    p13.v1tx = 1 ; p13.v1rx = 1 ; p13.v2tx = 1 ; p13.v2rx = 1
    p13.w1tx = 1 ; p13.w1rx = 1 ; p13.w2tx = 1 ; p13.w2rx = 1
    p13.u1ty = 1 ; p13.u1ry = 1 ; p13.u2ty = 1 ; p13.u2ry = 1
    p13.v1ty = 1 ; p13.v1ry = 1 ; p13.v2ty = 1 ; p13.v2ry = 1
    p13.w1ty = 1 ; p13.w1ry = 1 ; p13.w2ty = 1 ; p13.w2ry = 1

    # base low
    p14.u1tx = 1 ; p14.u1rx = 1 ; p14.u2tx = 1 ; p14.u2rx = 1
    p14.v1tx = 1 ; p14.v1rx = 1 ; p14.v2tx = 1 ; p14.v2rx = 1
    p14.w1tx = 1 ; p14.w1rx = 1 ; p14.w2tx = 1 ; p14.w2rx = 1
    p14.u1ty = 1 ; p14.u1ry = 1 ; p14.u2ty = 1 ; p14.u2ry = 1
    p14.v1ty = 1 ; p14.v1ry = 1 ; p14.v2ty = 1 ; p14.v2ry = 1
    p14.w1ty = 1 ; p14.w1ry = 1 ; p14.w2ty = 1 ; p14.w2ry = 1

    # flange low
    p15.u1tx = 1 ; p15.u1rx = 1 ; p15.u2tx = 1 ; p15.u2rx = 1
    p15.v1tx = 0 ; p15.v1rx = 1 ; p15.v2tx = 1 ; p15.v2rx = 1
    p15.w1tx = 0 ; p15.w1rx = 1 ; p15.w2tx = 1 ; p15.w2rx = 1
    p15.u1ty = 1 ; p15.u1ry = 1 ; p15.u2ty = 1 ; p15.u2ry = 1
    p15.v1ty = 1 ; p15.v1ry = 1 ; p15.v2ty = 1 ; p15.v2ry = 1
    p15.w1ty = 1 ; p15.w1ry = 1 ; p15.w2ty = 1 ; p15.w2ry = 1

    conn = [
        # skin-skin
        dict(p1=p01, p2=p02, func='SSycte', ycte1=0, ycte2=p02.b),
        dict(p1=p01, p2=p04, func='SSxcte', xcte1=0, xcte2=p04.a),
        dict(p1=p02, p2=p03, func='SSycte', ycte1=0, ycte2=p03.b),
        dict(p1=p02, p2=p05, func='SSxcte', xcte1=0, xcte2=p05.a),
        dict(p1=p03, p2=p06, func='SSxcte', xcte1=0, xcte2=p06.a),
        dict(p1=p04, p2=p05, func='SSycte', ycte1=0, ycte2=p05.b),
        dict(p1=p04, p2=p07, func='SSxcte', xcte1=0, xcte2=p07.a),
        dict(p1=p05, p2=p06, func='SSycte', ycte1=0, ycte2=p06.b),
        dict(p1=p05, p2=p08, func='SSxcte', xcte1=0, xcte2=p08.a),
        dict(p1=p06, p2=p09, func='SSxcte', xcte1=0, xcte2=p09.a),
        dict(p1=p07, p2=p08, func='SSycte', ycte1=0, ycte2=p08.b),
        dict(p1=p08, p2=p09, func='SSycte', ycte1=0, ycte2=p09.b),

        # skin-base
        dict(p1=p02, p2=p10, func='SB'),
        dict(p1=p05, p2=p12, func='SB', has_defect=has_defect), # defect
        dict(p1=p08, p2=p14, func='SB'),

        # base-base
        dict(p1=p10, p2=p12, func='SSxcte', xcte1=0, xcte2=p12.a),
        dict(p1=p12, p2=p14, func='SSxcte', xcte1=0, xcte2=p14.a),

        # base-flange
        dict(p1=p10, p2=p11, func='BFycte', ycte1=p10.b/2., ycte2=0),
        dict(p1=p12, p2=p13, func='BFycte', ycte1=p12.b/2., ycte2=0),
        dict(p1=p14, p2=p15, func='BFycte', ycte1=p14.b/2., ycte2=0),

        # flange-flange
        dict(p1=p11, p2=p13, func='SSxcte', xcte1=0, xcte2=p13.a),
        dict(p1=p13, p2=p15, func='SSxcte', xcte1=0, xcte2=p15.a),
        ]

    panels = [p01, p02, p03, p04, p05, p06, p07, p08, p09,
            p10, p11, p12, p13, p14, p15]
    skin = [p01, p02, p03, p04, p05, p06, p07, p08, p09]

    assy = PanelAssembly(panels)

    size = assy.get_size()

    valid_conn = []
    for connecti in conn:
        if connecti.get('has_defect'): # connecting if there is no defect
            continue
        valid_conn.append(connecti)

    k0 = assy.calc_k0(valid_conn)
    c = None
    if (run_static_case and not
            (Nxx_skin is None and Nxx_base is None and Nxx_flange is None)):
        fext = np.zeros(size)
        for p in [p07, p08, p09, p14, p15]:
            Nforces = 100
            fx = p.Nxx*p.b/(Nforces-1.)
            for i in range(Nforces):
                y = i*p.b/(Nforces-1.)
                if i == 0 or i == (Nforces - 1):
                    p.add_force(0, y, fx/2., 0, 0)
                else:
                    p.add_force(0, y, fx, 0, 0)
            fext[p.col_start: p.col_end] = p.calc_fext(silent=True)

        incs, cs = static(k0, -fext, silent=True)
        c = cs[0]

    kM = assy.calc_kM()
    kG = assy.calc_kG0(c=c)

    kA = 0
    for p in skin:
        # TODO the current approach has somewhat hiden settings
        #     check this strategy:
        #     - define module aerodynamics
        #     - function calc_kA inside a module piston_theory
        #     - pass piston_theory parameters and compute kA
        kA += p.calc_kA(size=size, row0=p.row_start, col0=p.col_start, silent=True, finalize=False)

    assert np.any(np.isnan(kA.data)) == False
    assert np.any(np.isinf(kA.data)) == False
    kA = csr_matrix(make_skew_symmetric(kA))

    eigvals, eigvecs = freq((k0 + kG + kA), kM, tol=0, sparse_solver=True, silent=True,
             sort=True, reduced_dof=False,
             num_eigvalues=25, num_eigvalues_print=5)

    if run_static_case:
        return assy, c, eigvals, eigvecs
    else:
        return assy, eigvals, eigvecs
Beispiel #18
0
def tstiff2d_1stiff_freq(a,
                         b,
                         ys,
                         bb,
                         bf,
                         defect_a,
                         mu,
                         plyt,
                         laminaprop,
                         stack_skin,
                         stack_base,
                         stack_flange,
                         r=None,
                         m=8,
                         n=8,
                         mb=None,
                         nb=None,
                         mf=None,
                         nf=None):
    r"""Frequency T-Stiffened Panel with possible defect at middle

    For more details about each parameter and the aerodynamic formulation see
    Ref. [castro2016FlutterPanel]_ .

    For more details about the theory involved on the assembly of panels, see
    [castro2017AssemblyModels]_.

    The panel assembly looks like::

        skin
         _________ _____ _________
        |         |     |         |
        |         |     |         |
        |   p01   | p02 |   p03   |
        |         |     |         |
        |_________|_____|_________|
        |   p04   | p05 |   p06   |
        |_________|_____|_________|
        |         |     |         |
        |         |     |         |
        |   p07   | p08 |   p09   |
        |         |     |         |
        |         |     |         |
        |_________|_____|_________|

                  base            flange
                   _____           _____
                  |     |         |     |
                  |     |         |     |
                  | p10 |         | p11 |
                  |     |         |     |
                  |_____|         |_____|
                  | p12 |         | p13 |
                  |_____|         |_____|
                  |     |         |     |
                  |     |         |     |
                  | p14 |         | p15 |
                  |     |         |     |
                  |     |         |     |
                  |_____|         |_____|

    Parameters
    ----------

    a : float
        Total length of the assembly (along `x`).
    b : float
        Total width of the assembly (along `y`).
    ys : float
        Position of the stiffener along `y`.
    bb : float
        Stiffener's base width.
    bf : float
        Stiffener's flange width.
    defect_a : float
        Debonding defect/assembly length ratio.
    mu : float
        Material density.
    plyt : float
        Ply thickness.
    laminaprop : list or tuple
        Orthotropic lamina properties: `E_1, E_2, \nu_{12}, G_{12}, G_{13}, G_{23}`.
    stack_skin : list or tuple
        Stacking sequence for the skin.
    stack_base : list or tuple
        Stacking sequence for the stiffener's base.
    stack_flange : list or tuple
        Stacking sequence for the stiffener's flange.
    r : float or None, optional
        Radius of the stiffened panel.
    m, n : int, optional
        Number of terms of the approximation function for the skin.
    mb, nb : int, optional
        Number of terms of the approximation function for the stiffener's base.
    mf, nf : int, optional
        Number of terms of the approximation function for the stiffener's
        flange.

    Examples
    --------

    The following example is one of the test cases:

    .. literalinclude:: ../../../../../compmech/panel/assembly/tests/test_tstiff2d_assembly.py
        :pyobject: test_tstiff2d_1stiff_freq


    """
    defect = defect_a * a
    has_defect = True if defect > 0 else False
    defect = 0.33 * a if defect == 0 else defect  # to avoid weird domains
    aup = (a - defect) / 2.
    alow = (a - defect) / 2.
    bleft = b - ys - bb / 2.
    bright = ys - bb / 2.
    mb = m if mb is None else mb
    nb = n if nb is None else nb
    mf = m if mf is None else mf
    nf = n if nf is None else nf
    # skin panels
    p01 = Panel(group='skin',
                x0=alow + defect,
                y0=ys + bb / 2.,
                a=aup,
                b=bleft,
                r=r,
                m=m,
                n=n,
                plyt=plyt,
                stack=stack_skin,
                laminaprop=laminaprop,
                mu=mu)
    p02 = Panel(group='skin',
                x0=alow + defect,
                y0=ys - bb / 2.,
                a=aup,
                b=bb,
                r=r,
                m=m,
                n=n,
                plyt=plyt,
                stack=stack_skin,
                laminaprop=laminaprop,
                mu=mu)
    p03 = Panel(group='skin',
                x0=alow + defect,
                y0=0,
                a=aup,
                b=bright,
                r=r,
                m=m,
                n=n,
                plyt=plyt,
                stack=stack_skin,
                laminaprop=laminaprop,
                mu=mu)
    # defect
    p04 = Panel(group='skin',
                x0=alow,
                y0=ys + bb / 2.,
                a=defect,
                b=bleft,
                r=r,
                m=m,
                n=n,
                plyt=plyt,
                stack=stack_skin,
                laminaprop=laminaprop,
                mu=mu)
    p05 = Panel(group='skin',
                x0=alow,
                y0=ys - bb / 2.,
                a=defect,
                b=bb,
                r=r,
                m=m,
                n=n,
                plyt=plyt,
                stack=stack_skin,
                laminaprop=laminaprop,
                mu=mu)
    p06 = Panel(group='skin',
                x0=alow,
                y0=0,
                a=defect,
                b=bright,
                r=r,
                m=m,
                n=n,
                plyt=plyt,
                stack=stack_skin,
                laminaprop=laminaprop,
                mu=mu)
    #
    p07 = Panel(group='skin',
                x0=0,
                y0=ys + bb / 2.,
                a=alow,
                b=bleft,
                r=r,
                m=m,
                n=n,
                plyt=plyt,
                stack=stack_skin,
                laminaprop=laminaprop,
                mu=mu)
    p08 = Panel(group='skin',
                x0=0,
                y0=ys - bb / 2.,
                a=alow,
                b=bb,
                r=r,
                m=m,
                n=n,
                plyt=plyt,
                stack=stack_skin,
                laminaprop=laminaprop,
                mu=mu)
    p09 = Panel(group='skin',
                x0=0,
                y0=0,
                a=alow,
                b=bright,
                r=r,
                m=m,
                n=n,
                plyt=plyt,
                stack=stack_skin,
                laminaprop=laminaprop,
                mu=mu)

    # stiffeners
    p10 = Panel(group='base',
                x0=alow + defect,
                y0=ys - bb / 2.,
                a=aup,
                b=bb,
                r=r,
                m=mb,
                n=nb,
                plyt=plyt,
                stack=stack_base,
                laminaprop=laminaprop,
                mu=mu)
    p11 = Panel(group='flange',
                x0=alow + defect,
                y0=0,
                a=aup,
                b=bf,
                m=mf,
                n=nf,
                plyt=plyt,
                stack=stack_flange,
                laminaprop=laminaprop,
                mu=mu)
    # defect
    p12 = Panel(group='base',
                x0=alow,
                y0=ys - bb / 2.,
                a=defect,
                b=bb,
                r=r,
                m=mb,
                n=nb,
                plyt=plyt,
                stack=stack_base,
                laminaprop=laminaprop,
                mu=mu)
    p13 = Panel(group='flange',
                x0=alow,
                y0=0,
                a=defect,
                b=bf,
                m=mf,
                n=nf,
                plyt=plyt,
                stack=stack_flange,
                laminaprop=laminaprop,
                mu=mu)
    #
    p14 = Panel(group='base',
                x0=0,
                y0=ys - bb / 2.,
                a=alow,
                b=bb,
                r=r,
                m=mb,
                n=nb,
                plyt=plyt,
                stack=stack_base,
                laminaprop=laminaprop,
                mu=mu)
    p15 = Panel(group='flange',
                x0=0,
                y0=0,
                a=alow,
                b=bf,
                m=mf,
                n=nf,
                plyt=plyt,
                stack=stack_flange,
                laminaprop=laminaprop,
                mu=mu)

    # boundary conditions
    p01.u1tx = 1
    p01.u1rx = 1
    p01.u2tx = 0
    p01.u2rx = 1
    p01.v1tx = 1
    p01.v1rx = 1
    p01.v2tx = 0
    p01.v2rx = 1
    p01.w1tx = 1
    p01.w1rx = 1
    p01.w2tx = 0
    p01.w2rx = 1
    p01.u1ty = 1
    p01.u1ry = 1
    p01.u2ty = 0
    p01.u2ry = 1
    p01.v1ty = 1
    p01.v1ry = 1
    p01.v2ty = 0
    p01.v2ry = 1
    p01.w1ty = 1
    p01.w1ry = 1
    p01.w2ty = 0
    p01.w2ry = 1

    p02.u1tx = 1
    p02.u1rx = 1
    p02.u2tx = 0
    p02.u2rx = 1
    p02.v1tx = 1
    p02.v1rx = 1
    p02.v2tx = 0
    p02.v2rx = 1
    p02.w1tx = 1
    p02.w1rx = 1
    p02.w2tx = 0
    p02.w2rx = 1
    p02.u1ty = 1
    p02.u1ry = 1
    p02.u2ty = 1
    p02.u2ry = 1
    p02.v1ty = 1
    p02.v1ry = 1
    p02.v2ty = 1
    p02.v2ry = 1
    p02.w1ty = 1
    p02.w1ry = 1
    p02.w2ty = 1
    p02.w2ry = 1

    p03.u1tx = 1
    p03.u1rx = 1
    p03.u2tx = 0
    p03.u2rx = 1
    p03.v1tx = 1
    p03.v1rx = 1
    p03.v2tx = 0
    p03.v2rx = 1
    p03.w1tx = 1
    p03.w1rx = 1
    p03.w2tx = 0
    p03.w2rx = 1
    p03.u1ty = 0
    p03.u1ry = 1
    p03.u2ty = 1
    p03.u2ry = 1
    p03.v1ty = 0
    p03.v1ry = 1
    p03.v2ty = 1
    p03.v2ry = 1
    p03.w1ty = 0
    p03.w1ry = 1
    p03.w2ty = 1
    p03.w2ry = 1

    p04.u1tx = 1
    p04.u1rx = 1
    p04.u2tx = 1
    p04.u2rx = 1
    p04.v1tx = 1
    p04.v1rx = 1
    p04.v2tx = 1
    p04.v2rx = 1
    p04.w1tx = 1
    p04.w1rx = 1
    p04.w2tx = 1
    p04.w2rx = 1
    p04.u1ty = 1
    p04.u1ry = 1
    p04.u2ty = 0
    p04.u2ry = 1
    p04.v1ty = 1
    p04.v1ry = 1
    p04.v2ty = 0
    p04.v2ry = 1
    p04.w1ty = 1
    p04.w1ry = 1
    p04.w2ty = 0
    p04.w2ry = 1

    p05.u1tx = 1
    p05.u1rx = 1
    p05.u2tx = 1
    p05.u2rx = 1
    p05.v1tx = 1
    p05.v1rx = 1
    p05.v2tx = 1
    p05.v2rx = 1
    p05.w1tx = 1
    p05.w1rx = 1
    p05.w2tx = 1
    p05.w2rx = 1
    p05.u1ty = 1
    p05.u1ry = 1
    p05.u2ty = 1
    p05.u2ry = 1
    p05.v1ty = 1
    p05.v1ry = 1
    p05.v2ty = 1
    p05.v2ry = 1
    p05.w1ty = 1
    p05.w1ry = 1
    p05.w2ty = 1
    p05.w2ry = 1

    p06.u1tx = 1
    p06.u1rx = 1
    p06.u2tx = 1
    p06.u2rx = 1
    p06.v1tx = 1
    p06.v1rx = 1
    p06.v2tx = 1
    p06.v2rx = 1
    p06.w1tx = 1
    p06.w1rx = 1
    p06.w2tx = 1
    p06.w2rx = 1
    p06.u1ty = 0
    p06.u1ry = 1
    p06.u2ty = 1
    p06.u2ry = 1
    p06.v1ty = 0
    p06.v1ry = 1
    p06.v2ty = 1
    p06.v2ry = 1
    p06.w1ty = 0
    p06.w1ry = 1
    p06.w2ty = 1
    p06.w2ry = 1

    p07.u1tx = 0
    p07.u1rx = 1
    p07.u2tx = 1
    p07.u2rx = 1
    p07.v1tx = 0
    p07.v1rx = 1
    p07.v2tx = 1
    p07.v2rx = 1
    p07.w1tx = 0
    p07.w1rx = 1
    p07.w2tx = 1
    p07.w2rx = 1
    p07.u1ty = 1
    p07.u1ry = 1
    p07.u2ty = 0
    p07.u2ry = 1
    p07.v1ty = 1
    p07.v1ry = 1
    p07.v2ty = 0
    p07.v2ry = 1
    p07.w1ty = 1
    p07.w1ry = 1
    p07.w2ty = 0
    p07.w2ry = 1

    p08.u1tx = 0
    p08.u1rx = 1
    p08.u2tx = 1
    p08.u2rx = 1
    p08.v1tx = 0
    p08.v1rx = 1
    p08.v2tx = 1
    p08.v2rx = 1
    p08.w1tx = 0
    p08.w1rx = 1
    p08.w2tx = 1
    p08.w2rx = 1
    p08.u1ty = 1
    p08.u1ry = 1
    p08.u2ty = 1
    p08.u2ry = 1
    p08.v1ty = 1
    p08.v1ry = 1
    p08.v2ty = 1
    p08.v2ry = 1
    p08.w1ty = 1
    p08.w1ry = 1
    p08.w2ty = 1
    p08.w2ry = 1

    p09.u1tx = 0
    p09.u1rx = 1
    p09.u2tx = 1
    p09.u2rx = 1
    p09.v1tx = 0
    p09.v1rx = 1
    p09.v2tx = 1
    p09.v2rx = 1
    p09.w1tx = 0
    p09.w1rx = 1
    p09.w2tx = 1
    p09.w2rx = 1
    p09.u1ty = 0
    p09.u1ry = 1
    p09.u2ty = 1
    p09.u2ry = 1
    p09.v1ty = 0
    p09.v1ry = 1
    p09.v2ty = 1
    p09.v2ry = 1
    p09.w1ty = 0
    p09.w1ry = 1
    p09.w2ty = 1
    p09.w2ry = 1

    # base up
    p10.u1tx = 1
    p10.u1rx = 1
    p10.u2tx = 1
    p10.u2rx = 1
    p10.v1tx = 1
    p10.v1rx = 1
    p10.v2tx = 1
    p10.v2rx = 1
    p10.w1tx = 1
    p10.w1rx = 1
    p10.w2tx = 1
    p10.w2rx = 1
    p10.u1ty = 1
    p10.u1ry = 1
    p10.u2ty = 1
    p10.u2ry = 1
    p10.v1ty = 1
    p10.v1ry = 1
    p10.v2ty = 1
    p10.v2ry = 1
    p10.w1ty = 1
    p10.w1ry = 1
    p10.w2ty = 1
    p10.w2ry = 1

    # flange up
    p11.u1tx = 1
    p11.u1rx = 1
    p11.u2tx = 0
    p11.u2rx = 1
    p11.v1tx = 1
    p11.v1rx = 1
    p11.v2tx = 0
    p11.v2rx = 1
    p11.w1tx = 1
    p11.w1rx = 1
    p11.w2tx = 0
    p11.w2rx = 1
    p11.u1ty = 1
    p11.u1ry = 1
    p11.u2ty = 1
    p11.u2ry = 1
    p11.v1ty = 1
    p11.v1ry = 1
    p11.v2ty = 1
    p11.v2ry = 1
    p11.w1ty = 1
    p11.w1ry = 1
    p11.w2ty = 1
    p11.w2ry = 1

    # base mid
    p12.u1tx = 1
    p12.u1rx = 1
    p12.u2tx = 1
    p12.u2rx = 1
    p12.v1tx = 1
    p12.v1rx = 1
    p12.v2tx = 1
    p12.v2rx = 1
    p12.w1tx = 1
    p12.w1rx = 1
    p12.w2tx = 1
    p12.w2rx = 1
    p12.u1ty = 1
    p12.u1ry = 1
    p12.u2ty = 1
    p12.u2ry = 1
    p12.v1ty = 1
    p12.v1ry = 1
    p12.v2ty = 1
    p12.v2ry = 1
    p12.w1ty = 1
    p12.w1ry = 1
    p12.w2ty = 1
    p12.w2ry = 1

    # flange mid
    p13.u1tx = 1
    p13.u1rx = 1
    p13.u2tx = 1
    p13.u2rx = 1
    p13.v1tx = 1
    p13.v1rx = 1
    p13.v2tx = 1
    p13.v2rx = 1
    p13.w1tx = 1
    p13.w1rx = 1
    p13.w2tx = 1
    p13.w2rx = 1
    p13.u1ty = 1
    p13.u1ry = 1
    p13.u2ty = 1
    p13.u2ry = 1
    p13.v1ty = 1
    p13.v1ry = 1
    p13.v2ty = 1
    p13.v2ry = 1
    p13.w1ty = 1
    p13.w1ry = 1
    p13.w2ty = 1
    p13.w2ry = 1

    # base low
    p14.u1tx = 1
    p14.u1rx = 1
    p14.u2tx = 1
    p14.u2rx = 1
    p14.v1tx = 1
    p14.v1rx = 1
    p14.v2tx = 1
    p14.v2rx = 1
    p14.w1tx = 1
    p14.w1rx = 1
    p14.w2tx = 1
    p14.w2rx = 1
    p14.u1ty = 1
    p14.u1ry = 1
    p14.u2ty = 1
    p14.u2ry = 1
    p14.v1ty = 1
    p14.v1ry = 1
    p14.v2ty = 1
    p14.v2ry = 1
    p14.w1ty = 1
    p14.w1ry = 1
    p14.w2ty = 1
    p14.w2ry = 1

    # flange low
    p15.u1tx = 0
    p15.u1rx = 1
    p15.u2tx = 1
    p15.u2rx = 1
    p15.v1tx = 0
    p15.v1rx = 1
    p15.v2tx = 1
    p15.v2rx = 1
    p15.w1tx = 0
    p15.w1rx = 1
    p15.w2tx = 1
    p15.w2rx = 1
    p15.u1ty = 1
    p15.u1ry = 1
    p15.u2ty = 1
    p15.u2ry = 1
    p15.v1ty = 1
    p15.v1ry = 1
    p15.v2ty = 1
    p15.v2ry = 1
    p15.w1ty = 1
    p15.w1ry = 1
    p15.w2ty = 1
    p15.w2ry = 1

    conn = [
        # skin-skin
        dict(p1=p01, p2=p02, func='SSycte', ycte1=0, ycte2=p02.b),
        dict(p1=p01, p2=p04, func='SSxcte', xcte1=0, xcte2=p04.a),
        dict(p1=p02, p2=p03, func='SSycte', ycte1=0, ycte2=p03.b),
        dict(p1=p02, p2=p05, func='SSxcte', xcte1=0, xcte2=p05.a),
        dict(p1=p03, p2=p06, func='SSxcte', xcte1=0, xcte2=p06.a),
        dict(p1=p04, p2=p05, func='SSycte', ycte1=0, ycte2=p05.b),
        dict(p1=p04, p2=p07, func='SSxcte', xcte1=0, xcte2=p07.a),
        dict(p1=p05, p2=p06, func='SSycte', ycte1=0, ycte2=p06.b),
        dict(p1=p05, p2=p08, func='SSxcte', xcte1=0, xcte2=p08.a),
        dict(p1=p06, p2=p09, func='SSxcte', xcte1=0, xcte2=p09.a),
        dict(p1=p07, p2=p08, func='SSycte', ycte1=0, ycte2=p08.b),
        dict(p1=p08, p2=p09, func='SSycte', ycte1=0, ycte2=p09.b),

        # skin-base
        dict(p1=p02, p2=p10, func='SB'),
        dict(p1=p05, p2=p12, func='SB', has_defect=has_defect),  # defect
        dict(p1=p08, p2=p14, func='SB'),

        # base-base
        dict(p1=p10, p2=p12, func='SSxcte', xcte1=0, xcte2=p12.a),
        dict(p1=p12, p2=p14, func='SSxcte', xcte1=0, xcte2=p14.a),

        # base-flange
        dict(p1=p10, p2=p11, func='BFycte', ycte1=p10.b / 2., ycte2=0),
        dict(p1=p12, p2=p13, func='BFycte', ycte1=p12.b / 2., ycte2=0),
        dict(p1=p14, p2=p15, func='BFycte', ycte1=p14.b / 2., ycte2=0),

        # flange-flange
        dict(p1=p11, p2=p13, func='SSxcte', xcte1=0, xcte2=p13.a),
        dict(p1=p13, p2=p15, func='SSxcte', xcte1=0, xcte2=p15.a),
    ]

    panels = [
        p01, p02, p03, p04, p05, p06, p07, p08, p09, p10, p11, p12, p13, p14,
        p15
    ]
    skin = [p01, p02, p03, p04, p05, p06, p07, p08, p09]
    base = [p10, p12, p14]
    flange = [p11, p13, p15]

    assy = PanelAssembly(panels)

    size = assy.get_size()

    valid_conn = []
    for connecti in conn:
        if connecti.get('has_defect'):
            continue
        valid_conn.append(connecti)

    k0 = assy.calc_k0(conn=valid_conn)
    kM = assy.calc_kM()

    eigvals, eigvecs = freq(k0,
                            kM,
                            tol=0,
                            sparse_solver=True,
                            silent=True,
                            sort=True,
                            reduced_dof=False,
                            num_eigvalues=25,
                            num_eigvalues_print=5)

    return assy, eigvals, eigvecs
Beispiel #19
0
def test_4panels_kt_kr():
    """Compare result of 4 assembled panels with single-domain results

    The panel assembly looks like::

         _________ _____
        |         |     |
        |         |     |
        |   p01   | p02 |
        |         |     |
        |_________|_____|
        |   p03   | p04 |
        |         |     |
        |         |     |
        |         |     |
        |         |     |
        |         |     |
        |_________|_____|

    """
    print('Testing validity of the default kt and kr values')

    plyt = 1.e-3 * 0.125
    laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
    stack = [0, 45, -45, 90, -45, 45, 0]
    lam = laminate.read_stack(stack=stack, plyt=plyt, laminaprop=laminaprop)

    mu = 1.3e3

    r = 10.
    m = 8
    n = 8

    a1 = 1.5
    a2 = 1.5
    a3 = 2.5
    a4 = 2.5
    b1 = 1.5
    b2 = 0.5
    b3 = 1.5
    b4 = 0.5

    A11 = lam.ABD[0, 0]
    A22 = lam.ABD[1, 1]
    D11 = lam.ABD[3, 3]
    D22 = lam.ABD[4, 4]

    p01 = Panel(group='panels',
                x0=a3,
                y0=b2,
                a=a1,
                b=b1,
                r=r,
                m=m,
                n=n,
                plyt=plyt,
                stack=stack,
                laminaprop=laminaprop,
                mu=mu)
    p02 = Panel(group='panels',
                x0=a3,
                y0=0,
                a=a2,
                b=b2,
                r=r,
                m=m,
                n=n,
                plyt=plyt,
                stack=stack,
                laminaprop=laminaprop,
                mu=mu)
    p03 = Panel(group='panels',
                x0=0,
                y0=b2,
                a=a3,
                b=b3,
                r=r,
                m=m,
                n=n,
                plyt=plyt,
                stack=stack,
                laminaprop=laminaprop,
                mu=mu)
    p04 = Panel(group='panels',
                x0=0,
                y0=0,
                a=a4,
                b=b4,
                r=r,
                m=m,
                n=n,
                plyt=plyt,
                stack=stack,
                laminaprop=laminaprop,
                mu=mu)

    kt13, kr13 = connections.calc_kt_kr(p01, p03, 'xcte')
    kt24, kr24 = connections.calc_kt_kr(p02, p04, 'xcte')
    kt12, kr12 = connections.calc_kt_kr(p01, p02, 'ycte')
    kt34, kr34 = connections.calc_kt_kr(p03, p04, 'ycte')

    # boundary conditions
    p01.u1tx = 1
    p01.u1rx = 1
    p01.u2tx = 0
    p01.u2rx = 1
    p01.v1tx = 1
    p01.v1rx = 1
    p01.v2tx = 0
    p01.v2rx = 1
    p01.w1tx = 1
    p01.w1rx = 1
    p01.w2tx = 0
    p01.w2rx = 1
    p01.u1ty = 1
    p01.u1ry = 1
    p01.u2ty = 0
    p01.u2ry = 1
    p01.v1ty = 1
    p01.v1ry = 1
    p01.v2ty = 0
    p01.v2ry = 1
    p01.w1ty = 1
    p01.w1ry = 1
    p01.w2ty = 0
    p01.w2ry = 1

    p02.u1tx = 1
    p02.u1rx = 1
    p02.u2tx = 0
    p02.u2rx = 1
    p02.v1tx = 1
    p02.v1rx = 1
    p02.v2tx = 0
    p02.v2rx = 1
    p02.w1tx = 1
    p02.w1rx = 1
    p02.w2tx = 0
    p02.w2rx = 1
    p02.u1ty = 0
    p02.u1ry = 1
    p02.u2ty = 1
    p02.u2ry = 1
    p02.v1ty = 0
    p02.v1ry = 1
    p02.v2ty = 1
    p02.v2ry = 1
    p02.w1ty = 0
    p02.w1ry = 1
    p02.w2ty = 1
    p02.w2ry = 1

    p03.u1tx = 0
    p03.u1rx = 1
    p03.u2tx = 1
    p03.u2rx = 1
    p03.v1tx = 0
    p03.v1rx = 1
    p03.v2tx = 1
    p03.v2rx = 1
    p03.w1tx = 0
    p03.w1rx = 1
    p03.w2tx = 1
    p03.w2rx = 1
    p03.u1ty = 1
    p03.u1ry = 1
    p03.u2ty = 0
    p03.u2ry = 1
    p03.v1ty = 1
    p03.v1ry = 1
    p03.v2ty = 0
    p03.v2ry = 1
    p03.w1ty = 1
    p03.w1ry = 1
    p03.w2ty = 0
    p03.w2ry = 1

    p04.u1tx = 0
    p04.u1rx = 1
    p04.u2tx = 1
    p04.u2rx = 1
    p04.v1tx = 0
    p04.v1rx = 1
    p04.v2tx = 1
    p04.v2rx = 1
    p04.w1tx = 0
    p04.w1rx = 1
    p04.w2tx = 1
    p04.w2rx = 1
    p04.u1ty = 0
    p04.u1ry = 1
    p04.u2ty = 1
    p04.u2ry = 1
    p04.v1ty = 0
    p04.v1ry = 1
    p04.v2ty = 1
    p04.v2ry = 1
    p04.w1ty = 0
    p04.w1ry = 1
    p04.w2ty = 1
    p04.w2ry = 1

    conndict = [
        dict(p1=p01,
             p2=p02,
             func='SSycte',
             ycte1=0,
             ycte2=p02.b,
             kt=kt12,
             kr=kr12),
        dict(p1=p01,
             p2=p03,
             func='SSxcte',
             xcte1=0,
             xcte2=p03.a,
             kt=kt13,
             kr=kr13),
        dict(p1=p02,
             p2=p04,
             func='SSxcte',
             xcte1=0,
             xcte2=p04.a,
             kt=kt24,
             kr=kr24),
        dict(p1=p03,
             p2=p04,
             func='SSycte',
             ycte1=0,
             ycte2=p04.b,
             kt=kt34,
             kr=kr34),
    ]

    panels = [p01, p02, p03, p04]

    size = sum([3 * p.m * p.n for p in panels])

    k0 = 0
    kM = 0

    row0 = 0
    col0 = 0
    for p in panels:
        k0 += p.calc_k0(row0=row0,
                        col0=col0,
                        size=size,
                        silent=True,
                        finalize=False)
        kM += p.calc_kM(row0=row0,
                        col0=col0,
                        size=size,
                        silent=True,
                        finalize=False)
        p.row_start = row0
        p.col_start = col0
        row0 += 3 * p.m * p.n
        col0 += 3 * p.m * p.n
        p.row_end = row0
        p.col_end = col0

    for conn in conndict:
        if conn.get('has_deffect'):  # connecting if there is no deffect
            continue
        p1 = conn['p1']
        p2 = conn['p2']
        if conn['func'] == 'SSycte':
            k0 += connections.kCSSycte.fkCSSycte11(conn['kt'],
                                                   conn['kr'],
                                                   p1,
                                                   conn['ycte1'],
                                                   size,
                                                   p1.row_start,
                                                   col0=p1.col_start)
            k0 += connections.kCSSycte.fkCSSycte12(conn['kt'],
                                                   conn['kr'],
                                                   p1,
                                                   p2,
                                                   conn['ycte1'],
                                                   conn['ycte2'],
                                                   size,
                                                   p1.row_start,
                                                   col0=p2.col_start)
            k0 += connections.kCSSycte.fkCSSycte22(conn['kt'],
                                                   conn['kr'],
                                                   p1,
                                                   p2,
                                                   conn['ycte2'],
                                                   size,
                                                   p2.row_start,
                                                   col0=p2.col_start)
        elif conn['func'] == 'SSxcte':
            k0 += connections.kCSSxcte.fkCSSxcte11(conn['kt'],
                                                   conn['kr'],
                                                   p1,
                                                   conn['xcte1'],
                                                   size,
                                                   p1.row_start,
                                                   col0=p1.col_start)
            k0 += connections.kCSSxcte.fkCSSxcte12(conn['kt'],
                                                   conn['kr'],
                                                   p1,
                                                   p2,
                                                   conn['xcte1'],
                                                   conn['xcte2'],
                                                   size,
                                                   p1.row_start,
                                                   col0=p2.col_start)
            k0 += connections.kCSSxcte.fkCSSxcte22(conn['kt'],
                                                   conn['kr'],
                                                   p1,
                                                   p2,
                                                   conn['xcte2'],
                                                   size,
                                                   p2.row_start,
                                                   col0=p2.col_start)

    assert np.any(np.isnan(k0.data)) == False
    assert np.any(np.isinf(k0.data)) == False
    k0 = csr_matrix(make_symmetric(k0))
    assert np.any(np.isnan(kM.data)) == False
    assert np.any(np.isinf(kM.data)) == False
    kM = csr_matrix(make_symmetric(kM))

    eigvals, eigvecs = freq(k0,
                            kM,
                            tol=0,
                            sparse_solver=True,
                            silent=True,
                            sort=True,
                            reduced_dof=False,
                            num_eigvalues=25,
                            num_eigvalues_print=5)

    # Results for single panel
    m = 15
    n = 15
    singlepanel = Panel(a=(a1 + a3),
                        b=(b1 + b2),
                        r=r,
                        m=m,
                        n=n,
                        plyt=plyt,
                        stack=stack,
                        laminaprop=laminaprop,
                        mu=mu)
    singlepanel.freq(silent=True)

    assert np.isclose(eigvals[0], singlepanel.eigvals[0], atol=0.01, rtol=0.01)
Beispiel #20
0
def test_4panels_kt_kr():
    """Compare result of 4 assembled panels with single-domain results

    The panel assembly looks like::

         _________ _____
        |         |     |
        |         |     |
        |   p01   | p02 |
        |         |     |
        |_________|_____|
        |   p03   | p04 |
        |         |     |
        |         |     |
        |         |     |
        |         |     |
        |         |     |
        |_________|_____|

    """
    print('Testing validity of the default kt and kr values')

    plyt = 1.e-3 * 0.125
    laminaprop=(142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
    stack=[0, 45, -45, 90, -45, 45, 0]
    lam = laminate.read_stack(stack=stack, plyt=plyt, laminaprop=laminaprop)

    mu=1.3e3

    r = 10.
    m = 8
    n = 8

    a1 = 1.5
    a2 = 1.5
    a3 = 2.5
    a4 = 2.5
    b1 = 1.5
    b2 = 0.5
    b3 = 1.5
    b4 = 0.5

    A11 = lam.ABD[0, 0]
    A22 = lam.ABD[1, 1]
    D11 = lam.ABD[3, 3]
    D22 = lam.ABD[4, 4]

    p01 = Panel(group='panels', x0=a3, y0=b2, a=a1, b=b1, r=r, m=m, n=n, plyt=plyt, stack=stack, laminaprop=laminaprop, mu=mu)
    p02 = Panel(group='panels', x0=a3, y0=0, a=a2, b=b2, r=r, m=m, n=n, plyt=plyt, stack=stack, laminaprop=laminaprop, mu=mu)
    p03 = Panel(group='panels', x0=0, y0=b2, a=a3, b=b3, r=r, m=m, n=n, plyt=plyt, stack=stack, laminaprop=laminaprop, mu=mu)
    p04 = Panel(group='panels', x0=0, y0=0, a=a4, b=b4, r=r, m=m, n=n, plyt=plyt, stack=stack, laminaprop=laminaprop, mu=mu)

    kt13, kr13 = connections.calc_kt_kr(p01, p03, 'xcte')
    kt24, kr24 = connections.calc_kt_kr(p02, p04, 'xcte')
    kt12, kr12 = connections.calc_kt_kr(p01, p02, 'ycte')
    kt34, kr34 = connections.calc_kt_kr(p03, p04, 'ycte')

    # boundary conditions
    p01.u1tx = 1 ; p01.u1rx = 1 ; p01.u2tx = 0 ; p01.u2rx = 1
    p01.v1tx = 1 ; p01.v1rx = 1 ; p01.v2tx = 0 ; p01.v2rx = 1
    p01.w1tx = 1 ; p01.w1rx = 1 ; p01.w2tx = 0 ; p01.w2rx = 1
    p01.u1ty = 1 ; p01.u1ry = 1 ; p01.u2ty = 0 ; p01.u2ry = 1
    p01.v1ty = 1 ; p01.v1ry = 1 ; p01.v2ty = 0 ; p01.v2ry = 1
    p01.w1ty = 1 ; p01.w1ry = 1 ; p01.w2ty = 0 ; p01.w2ry = 1

    p02.u1tx = 1 ; p02.u1rx = 1 ; p02.u2tx = 0 ; p02.u2rx = 1
    p02.v1tx = 1 ; p02.v1rx = 1 ; p02.v2tx = 0 ; p02.v2rx = 1
    p02.w1tx = 1 ; p02.w1rx = 1 ; p02.w2tx = 0 ; p02.w2rx = 1
    p02.u1ty = 0 ; p02.u1ry = 1 ; p02.u2ty = 1 ; p02.u2ry = 1
    p02.v1ty = 0 ; p02.v1ry = 1 ; p02.v2ty = 1 ; p02.v2ry = 1
    p02.w1ty = 0 ; p02.w1ry = 1 ; p02.w2ty = 1 ; p02.w2ry = 1

    p03.u1tx = 0 ; p03.u1rx = 1 ; p03.u2tx = 1 ; p03.u2rx = 1
    p03.v1tx = 0 ; p03.v1rx = 1 ; p03.v2tx = 1 ; p03.v2rx = 1
    p03.w1tx = 0 ; p03.w1rx = 1 ; p03.w2tx = 1 ; p03.w2rx = 1
    p03.u1ty = 1 ; p03.u1ry = 1 ; p03.u2ty = 0 ; p03.u2ry = 1
    p03.v1ty = 1 ; p03.v1ry = 1 ; p03.v2ty = 0 ; p03.v2ry = 1
    p03.w1ty = 1 ; p03.w1ry = 1 ; p03.w2ty = 0 ; p03.w2ry = 1

    p04.u1tx = 0 ; p04.u1rx = 1 ; p04.u2tx = 1 ; p04.u2rx = 1
    p04.v1tx = 0 ; p04.v1rx = 1 ; p04.v2tx = 1 ; p04.v2rx = 1
    p04.w1tx = 0 ; p04.w1rx = 1 ; p04.w2tx = 1 ; p04.w2rx = 1
    p04.u1ty = 0 ; p04.u1ry = 1 ; p04.u2ty = 1 ; p04.u2ry = 1
    p04.v1ty = 0 ; p04.v1ry = 1 ; p04.v2ty = 1 ; p04.v2ry = 1
    p04.w1ty = 0 ; p04.w1ry = 1 ; p04.w2ty = 1 ; p04.w2ry = 1

    conndict = [
        dict(p1=p01, p2=p02, func='SSycte', ycte1=0, ycte2=p02.b, kt=kt12, kr=kr12),
        dict(p1=p01, p2=p03, func='SSxcte', xcte1=0, xcte2=p03.a, kt=kt13, kr=kr13),
        dict(p1=p02, p2=p04, func='SSxcte', xcte1=0, xcte2=p04.a, kt=kt24, kr=kr24),
        dict(p1=p03, p2=p04, func='SSycte', ycte1=0, ycte2=p04.b, kt=kt34, kr=kr34),
        ]

    panels = [p01, p02, p03, p04]

    size = sum([3*p.m*p.n for p in panels])

    k0 = 0
    kM = 0

    row0 = 0
    col0 = 0
    for p in panels:
        k0 += p.calc_k0(row0=row0, col0=col0, size=size, silent=True, finalize=False)
        kM += p.calc_kM(row0=row0, col0=col0, size=size, silent=True, finalize=False)
        p.row_start = row0
        p.col_start = col0
        row0 += 3*p.m*p.n
        col0 += 3*p.m*p.n
        p.row_end = row0
        p.col_end = col0

    for conn in conndict:
        if conn.get('has_deffect'): # connecting if there is no deffect
            continue
        p1 = conn['p1']
        p2 = conn['p2']
        if conn['func'] == 'SSycte':
            k0 += connections.kCSSycte.fkCSSycte11(
                    conn['kt'], conn['kr'], p1, conn['ycte1'],
                    size, p1.row_start, col0=p1.col_start)
            k0 += connections.kCSSycte.fkCSSycte12(
                    conn['kt'], conn['kr'], p1, p2, conn['ycte1'], conn['ycte2'],
                    size, p1.row_start, col0=p2.col_start)
            k0 += connections.kCSSycte.fkCSSycte22(
                    conn['kt'], conn['kr'], p1, p2, conn['ycte2'],
                    size, p2.row_start, col0=p2.col_start)
        elif conn['func'] == 'SSxcte':
            k0 += connections.kCSSxcte.fkCSSxcte11(
                    conn['kt'], conn['kr'], p1, conn['xcte1'],
                    size, p1.row_start, col0=p1.col_start)
            k0 += connections.kCSSxcte.fkCSSxcte12(
                    conn['kt'], conn['kr'], p1, p2, conn['xcte1'], conn['xcte2'],
                    size, p1.row_start, col0=p2.col_start)
            k0 += connections.kCSSxcte.fkCSSxcte22(
                    conn['kt'], conn['kr'], p1, p2, conn['xcte2'],
                    size, p2.row_start, col0=p2.col_start)

    assert np.any(np.isnan(k0.data)) == False
    assert np.any(np.isinf(k0.data)) == False
    k0 = csr_matrix(make_symmetric(k0))
    assert np.any(np.isnan(kM.data)) == False
    assert np.any(np.isinf(kM.data)) == False
    kM = csr_matrix(make_symmetric(kM))

    eigvals, eigvecs = freq(k0, kM, tol=0, sparse_solver=True, silent=True,
             sort=True, reduced_dof=False,
             num_eigvalues=25, num_eigvalues_print=5)

    # Results for single panel
    m = 15
    n = 15
    singlepanel = Panel(a=(a1+a3), b=(b1+b2), r=r, m=m, n=n, plyt=plyt, stack=stack, laminaprop=laminaprop, mu=mu)
    singlepanel.freq(silent=True)

    assert np.isclose(eigvals[0], singlepanel.eigvals[0], atol=0.01, rtol=0.01)