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?

材料力学「ラーメン構造 いろいろ」sympyで。

Last updated at Posted at 2025-06-23

・作図は未です。

sympyで

鉄棒の部材

・2元連立方程式

# ver0.1
from sympy import *
var('P,N,l,MR,EI,h')
θ1     =P*l**2/(16*EI)+MR*l/(2*EI);  δ =P*l**3/(48*EI)+MR*l**2/(8*EI)
θ2     =N*h**2/( 2*EI)-MR*h/(  EI);  y2=N*h**3/(3*EI) -MR*h**2/(2*EI)
rep_NMR=solve([Eq(θ1,θ2),Eq(y2,0)],[N,MR])                            #;print(sol_NMR)
δ      =δ.subs(rep_NMR).simplify()
print("#",rep_NMR)
print("#",      δ)
print("#",round(δ.subs({h:1,l:1.5,P:20*9.8,EI:4000})*10**3,2))
# {MR: -P*l**2/(4*h + 8*l), N: -3*P*l**2/(8*h**2 + 16*h*l)}
# P*l**3*(2*h + l)/(96*EI*(h + 2*l))
# 1.51

・6元連立方程式
 ver0.1と同じです。

# ver0.2
from sympy import *
var('P,N,l,MR,EI,h')
var('θ1,θ2,δ,y2')
equ_θ1=Eq(θ1,P*l**2/(16*EI)+MR*l/(2*EI));equ_δ =Eq(δ ,P*l**3/(48*EI)+MR*l**2/(8*EI))
equ_θ2=Eq(θ2,N*h**2/( 2*EI)-MR*h/(  EI)); equ_y2=Eq(y2,N*h**3/(3*EI) -MR*h**2/(2*EI))
sol   =solve([equ_θ1,equ_δ , \
              equ_θ2,equ_y2, \
              Eq(θ1,θ2),Eq(y2,0)], \
             [N,MR,θ1,θ2,δ,y2])                
print("#",sol)
print("#",round(sol[δ].subs({h:1,l:1.5,P:20*9.8,EI:4000})*10**3,2))
# {MR: -P*l**2/(4*h + 8*l), N: -3*P*l**2/(8*h**2 + 16*h*l), y2: 0, δ: (2*P*h*l**3 + P*l**4)/(96*EI*h + 192*EI*l), θ1: P*h*l**2/(16*EI*h + 32*EI*l), θ2: P*h*l**2/(16*EI*h + 32*EI*l)}
# 1.51

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

(テンプレート)

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

Qiita内

文献

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?