0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

梁のたわみと応力計算ツール

Posted at

# Pythonコード:構造解析(片持ちはり + 集中荷重)
# =======================================================
#  2025-03-24
# 梁の構造計算プログラム / Beam Structural Calculation
# =======================================================

# -------------------------------------------------------
# 【Step 1】梁の種類を選択 / Select Beam Type
# -------------------------------------------------------

print("【Step1】梁の種類を選択 / Select Beam Type")
beam_type = "片持ち梁 + 集中荷重 / Cantilever Beam with Point Load"
print("選択された梁:", beam_type)
print()

# ------------------------------
# Step 2: 断面の種類を選択 / Cross-section Type
# ------------------------------
print("【Step2】断面の種類を選択 / Select Cross-section Type")
section_type = "四角形 / Rectangular"
print("断面形状:", section_type)
print()

# ------------------------------
# Step 3: 材料を選択 / Material
# ------------------------------
print("【Step3】材料を選択します / Select Material")
material = "Fe(鉄 / Iron)"
E = 205000  # MPa
density = 7.86e-6  # kg/mm^3
print("材質:", material)
print("ヤング率 E:", E, "MPa")
print("密度 ρ:", density, "kg/mm³")
print()

# ------------------------------
# Step 4: 入力値 / Input Values
# ------------------------------
print("【Step4】各数値を代入します / Input Beam and Section Info")
L = 200      # mm
F = 200      # N
F_kgf = F / 9.80665  # kgfに変換(参考値)
b = 20       # mm
h = 30       # mm

print("↓はりの情報 / Beam Info")
print("はりの長さ L:", L, "mm")
print("荷重 F:", F, "N (", round(F_kgf, 3), "kgf )")
print()
print("↓断面の情報 / Cross-section Info")
print("幅 b:", b, "mm")
print("高さ h:", h, "mm")

# ------------------------------
# 断面特性の計算 / Section Properties
# ------------------------------
A = b * h                    # mm^2
I = (b * h**3) / 12          # mm^4
Z = (b * h**2) / 6           # mm^3

print()
print("↓断面の計算結果 / Calculated Section Properties")
print("断面積 A = b × h =", A, "mm²")
print("断面二次モーメント I = (b × h³) / 12 =", I, "mm⁴")
print("断面係数 Z = (b × h²) / 6 =", Z, "mm³")
print()

# ------------------------------
# 荷重によるたわみ δ1 / Deflection by Load
# ------------------------------
δ1 = (F * L**3) / (3 * E * I)  # mm

# 自重による荷重 w = ρ × g × A
g = 9.80665  # m/s²
w = density * g * A  # N/mm
δ2 = (w * L**4) / (8 * E * I)  # mm

δ_total = δ1 + δ2

# 応力
σ = (F * L) / Z  # MPa

# 重量
volume = A * L  # mm³
mass = volume * density  # kg
weight_kgf = mass * g / 9.80665  # kgf

# ------------------------------
# 結果の表示 / Display Results
# ------------------------------
print("【計算式】")
print("・たわみ量:")
print(" δ1 = (F×L³)/(3×E×I) =", round(δ1, 3), "mm")
print(" δ2 = (w×L⁴)/(8×E×I) =", round(δ2, 3), "mm (w = {:.4f} N/mm)".format(w))
print(" δ = δ1 + δ2 =", round(δ_total, 3), "mm")
print("・応力:")
print(" σ = (F×L)/Z =", round(σ, 3), "MPa")
print()

print("■計算結果:たわみ量 / Deflection")
print("荷重によるたわみ δ1:", round(δ1, 3), "mm")
print("自重によるたわみ δ2:", round(δ2, 3), "mm")
print("たわみ合計 δ:", round(δ_total, 3), "mm")
print()

print("■計算結果:応力 / Stress")
print("最大応力 σ:", round(σ, 3), "MPa")
print()

print("■計算結果:重量 / Weight")
print("はりの重量:", round(weight_kgf, 3), "kgf")

実行結果:

【Step1】梁の種類を選択 / Select Beam Type
選択された梁: 片持ち梁 + 集中荷重 / Cantilever Beam with Point Load

【Step2】断面の種類を選択 / Select Cross-section Type
断面形状: 四角形 / Rectangular

【Step3】材料を選択します / Select Material
材質: Fe(鉄 / Iron)
ヤング率 E: 205000 MPa
密度 ρ: 7.86e-06 kg/mm³

【Step4】各数値を代入します / Input Beam and Section Info
↓はりの情報 / Beam Info
はりの長さ L: 200 mm
荷重 F: 200 N ( 20.394 kgf )

↓断面の情報 / Cross-section Info
幅 b: 20 mm
高さ h: 30 mm

↓断面の計算結果 / Calculated Section Properties
断面積 A = b × h = 600 mm²
断面二次モーメント I = (b × h³) / 12 = 45000.0 mm⁴
断面係数 Z = (b × h²) / 6 = 3000.0 mm³

【計算式】
・たわみ量:
 δ1 = (F×L³)/(3×E×I) = 0.058 mm
 δ2 = (w×L⁴)/(8×E×I) = 0.001 mm (w = 0.0462 N/mm)
 δ = δ1 + δ2 = 0.059 mm
・応力:
 σ = (F×L)/Z = 13.333 MPa

■計算結果:たわみ量 / Deflection
荷重によるたわみ δ1: 0.058 mm
自重によるたわみ δ2: 0.001 mm
たわみ合計 δ: 0.059 mm

■計算結果:応力 / Stress
最大応力 σ: 13.333 MPa

■計算結果:重量 / Weight
はりの重量: 0.943 kgf

材料・形状・荷重・計算量まとめ表 / Summary of Quantities

区分 / Category 項目 / Item 値 / Value 単位 / Unit 感覚的な説明 / Description
🔹 材料特性 / Material Properties 材質 / Material Fe(鉄 / Iron) - 一般的な構造用鋼材
ヤング率 E / Young's Modulus 205000 MPa 硬くて変形しにくい(剛性が高い)
密度 ρ / Density 7.86×10⁻⁶ kg/mm³ 鉄の標準密度、やや重い金属
🔹 はり情報 / Beam Info はりの長さ L / Beam Length 200 mm 20cm、定規くらいの長さ
荷重 F / Applied Load 200(20.394 kgf) N(kgf) ペットボトル約20本分の重さが片側にかかる
🔹 断面情報 / Cross-section Info 幅 b / Width 20 mm 指2本分くらいの幅
高さ h / Height 30 mm 約3cm、消しゴムくらいの高さ
断面積 A = b×h 600 mm² 面積は名刺の1/3くらい
断面二次モーメント I = (b×h³)/12 45000 mm⁴ 曲げに対する抵抗指標(大きいほど変形しにくい)
断面係数 Z = (b×h²)/6 3000 mm³ 応力の発生度合いに関係
🔹 たわみ / Deflection 荷重によるたわみ δ₁ 0.058 mm 髪の毛くらいの変形(目視ではわからない)
自重によるたわみ δ₂ 0.001 mm 非常に小さい、自重の影響はわずか
合計たわみ δ = δ₁ + δ₂ 0.059 mm 全体で髪の毛と同等、非常に変形が少ない
🔹 応力 / Stress 最大応力 σ = (F×L)/Z 13.333 MPa 鉄の耐力(200 MPa)の6%程度、余裕のある安全設計
🔹 重量 / Weight はりの質量による重量(kgf) 0.943 kgf ペットボトル2本分程度で片手で楽に持てる重さ
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?