コード例 #1
0
 def make_row(self, momentum, h_e):
     """
     :param momentum:前桁分担曲げモーメント[N*m]
     :param h_e:桁フランジ断面重心距離[mm]
     """
     fcc = self.get_fcc()
     ms = self.get_ms(momentum, h_e)
     p = self.get_axial_force(momentum, h_e)
     a = self.get_area(self.web.thickness)
     fc = self.get_stress_force(momentum, h_e, self.web.thickness)
     sqrt = self.get_x_of_graph()  # p12グラフのx軸の値
     value = [
         self.web.y_left, self.web.y_right, self.web.thickness, momentum,
         self.thickness, self.b_bottom, self.b_height,
         int(p),
         round_sig(a),
         round_sig(fc),
         round_sig(sqrt),
         round_sig(fcc),
         round_sig(ms)
     ]
     with open('results/compression_flange.csv', 'a',
               encoding="utf-8") as f:
         writer = csv.writer(f)
         writer.writerow(value)
コード例 #2
0
def make_stiffness_row(sta):
    """csv行出力

    :param sta: Rib instance
    :return: EI_w + EI_c + EI_t
    """
    web_t = sta.web.thickness
    he = sta.he
    E = ksi2Mpa(10.3 * 1000)  # ヤング率[N/mm^2]
    area_c = sta.cflange.get_area(web_t)
    area_t = sta.tflange.get_area(web_t)
    I_w = cal_web_I(web_t, sta.hf)
    I_c = cal_flange_I(area_c, he)
    I_t = cal_flange_I(area_t, he)
    EI_w = E * I_w / 10 ** 6  # [N*m^2]
    EI_c = E * I_c / 10 ** 6  # [N*m^2]
    EI_t = E * I_t / 10 ** 6  # [N*m^2]
    value = [sta.y_left, he, web_t, I_w, EI_w, area_c, I_c,
             EI_c, area_t, I_t, EI_t, EI_w + EI_c + EI_t]
    round_value = map(lambda x: round_sig(x), value)
    with open('results/stiffness.csv', 'a', encoding="utf-8") as f:
        writer = csv.writer(f)
        writer.writerow(round_value)

    return EI_w + EI_c + EI_t
コード例 #3
0
ファイル: rib.py プロジェクト: arahatashun/wing_design
 def write_rib_row(self):
     """表の中身."""
     value = [
         self.y_left, self.y_right, self.web.thickness, self.web.division,
         self.stiffener.thickness, self.stiffener.bs1_bottom,
         self.stiffener.bs2_height, self.cflange.thickness,
         self.cflange.b_bottom, self.cflange.b_height,
         self.tflange.thickness, self.tflange.b_bottom,
         self.tflange.b_height, self.rivet_stiffener.D, self.rivet_flange.D,
         self.rivet_flange.pd_ratio, self.rivet_flange.N,
         round_sig(self.get_total_mass())
     ]
     with open('results/rib.csv', 'a', encoding="utf-8") as f:
         writer = csv.writer(f)
         writer.writerow(value)
コード例 #4
0
 def make_row(self, he):
     """
     :param writer:csv.writer()で取得されるもの
     :param he:桁フランジ断面重心距離
     """
     I_U = self.get_inertia_u(he)
     I = self.get_inertia()
     ms = self.get_ms(he)
     value = [
         self.web.y_left, self.web.y_right, self.web.thickness,
         self.web.width_b, he, self.thickness, self.bs1_bottom,
         self.bs2_height, I, I_U, ms
     ]
     with open('results/stiffener.csv', 'a', encoding="utf-8") as f:
         writer = csv.writer(f)
         round_value = map(lambda x: round_sig(x), value)
         writer.writerow(round_value)
コード例 #5
0
 def make_row(self, momentum, h_e):
     """ Make row of csv.
     :param momentum:前桁分担曲げモーメント
     :param h_e:桁フランジ断面重心距離
     """
     p = self.get_axial_force(momentum, h_e)
     a = self.get_area(self.web.thickness)
     ft = self.get_stress_force(momentum, h_e, self.web.thickness)
     ftu = self.get_f_tu()
     ms = self.get_ms(momentum, h_e)
     value = [
         self.web.y_left, self.web.y_right, self.web.thickness, momentum,
         self.thickness, self.b_bottom, self.b_height, p, a, ft, ftu, ms
     ]
     with open('results/tension_flange.csv', 'a', encoding="utf-8") as f:
         writer = csv.writer(f)
         round_value = map(lambda x: round_sig(x), value)
         writer.writerow(round_value)
コード例 #6
0
ファイル: web.py プロジェクト: arahatashun/wing_design
 def make_row(self, sf, he):
     """
     Csv output.
     :param writer:csv.writer()で取得されるもの
     :param sf:前桁の分担荷重[N]
     :param he:桁フランジ断面重心距離[mm]
     """
     fs = self.get_shear_force(sf, he)
     q_max = self.get_qmax(sf, he)
     fscr = self.get_buckling_shear_force()
     fsu = self.get_fsu()
     ms = self.get_ms(sf, he)
     value = np.array([
         self.y_left, self.y_right, self.division, self.width_b,
         self.thickness, self.height_a, q_max, fscr, fsu, fs, ms
     ]).tolist()
     round_value = map(lambda x: round_sig(x), value)
     with open('results/web.csv', 'a', encoding="utf-8") as f:
         writer = csv.writer(f)
         writer.writerow(round_value)
コード例 #7
0
def write_fatigue_row(maximum_stress):
    """
    write row of csv
    :param maximum_stress:LMT[MPa]
    """
    accumulated_loss = 0  # 累積損失
    with open('results/tension_flange_fatigue.csv', 'a',
              encoding="utf-8") as f:
        writer = csv.writer(f)
        for (lmt, n) in zip([40, 50, 60, 70, 80, 90, 100],
                            [20000, 6000, 2000, 600, 200, 60, 20]):
            stress = maximum_stress * lmt / 100
            N = read_sn_graph(stress)
            value = [lmt, stress, n, N, n / N]
            round_value = map(lambda x: round_sig(x), value)
            writer.writerow(round_value)
            accumulated_loss = accumulated_loss + n / N

    print("累積損失", accumulated_loss)
    h = 1000 / accumulated_loss
    print("平均寿命", h)
    s_f = 2
    print("安全寿命", h / s_f)