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?

「機械工学で学ぶオブジェクト指向プログラミング#(その3)はりの基本問題」様を参考に、sympyのMatrixで実行した。

Last updated at Posted at 2025-02-26

オリジナル

・#はりの基本問題(片持ち梁) モーメント荷重,集中荷重,等分布荷重

sympyのweb上での実行方法

SymPy Live Shellで
https://qiita.com/mrrclb48z/items/00dd08b0317069be9342#web%E4%B8%8A%E3%81%AE%E5%AE%9F%E8%A1%8C%E6%96%B9%E6%B3%95sympy-live-shell%E3%81%A7

sympyのMatrixで。

はりの基本問題(1)(2)(3)

# ver0.1
# [K]{F}={Q}
from sympy import *
EI, L, P = symbols('EI L P', positive=True)  # 曲げ剛性, 梁の長さ, 集中荷重
var('v1,θ1,v2,θ2')
var('Q1,M1,Q2,M2')
var('M,q')
K = (EI / L**3) * Matrix([
    [ 12  , 6*L   ,-12  , 6*L   ],
    [  6*L, 4*L**2, -6*L, 2*L**2],
    [-12  ,-6*L   , 12  ,-6*L   ],
    [  6*L, 2*L**2, -6*L, 4*L**2]
])
F = Matrix([ v1,θ1,v2,θ2 ])
# ------------------------------------------------------------------------------------------
sol=solve(Eq(K*F,Matrix(     [Q1  ,M1  ,Q2  ,M2   ])).
                        subs({v1:0,θ1:0,Q2:0,M2:M}),
                             [v2  ,θ2  ,Q1  ,M1   ]) 
print("# (1)",sol[v2]    ,"  :片持ち梁,モーメント荷重 ");print("#    ",sol[θ2]) 
# ------------------------------------------------------------------------------------------
sol=solve(Eq(K*F,Matrix(     [Q1  ,M1  ,Q2  ,M2   ])).
                        subs({v1:0,θ1:0,Q2:P,M2:0}),
                             [v2  ,θ2  ,Q1  ,M1   ]) 
print("# (2)",sol[v2]    ,"  :片持ち梁,集中荷重      ");print("#    ",sol[θ2]) 
# ------------------------------------------------------------------------------------------ 
sol=solve(Eq(K*F,Matrix(     [Q1  ,M1  ,Q2  ,M2   ])+q*L*Rational(1,12)*Matrix([6,L,6,-L])).
                        subs({v1:0,θ1:0,Q2:0,M2:0}),
                             [v2  ,θ2  ,Q1  ,M1   ])
print("# (3)",sol[v2]    ,"  :片持ち梁,等分布荷重    ");print("#    ",sol[θ2]) 
# ------------------------------------------------------------------------------------------ 
# (1) L**2*M/(2*EI)   :片持ち梁,モーメント荷重
#     L*M/EI
# (2) L**3*P/(3*EI)   :片持ち梁,集中荷重      
#     L**2*P/(2*EI)
# (3) L**4*q/(8*EI)   :片持ち梁,等分布荷重    
#     L**3*q/(6*EI)

いつもの? sympyの実行環境と 参考のおすすめです。

(テンプレート)

いつもと違うおすすめです。

「材料力学演習(20221021)一括(ver.3.3)」

・はりの有限要素法の定式化について P304
http://zairikiweb.starfree.jp/zai_enshuh/zai_enshuh_ver.3.3.pdf#page=309

Youtube

・「一級建築士【構造力学】たわみの解き方 」
でめまる構造 様
(0:00〜12:21)
https://youtu.be/mQ3q0zaaTss
>共通点があまりない。

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?