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?

「Betti's theorem#Example(wikipedia)」を参考にsympyで。(その1/2)

Last updated at Posted at 2025-05-04

オリジナル

Example <

sympyで

ver0.1

・幾何学的境界条件が同じ。ユーザー定義にした方がヨカッタかも。

# ver0.1
from sympy import *
var('P,L,x,a,EI,l')
var('Q,L1,L2')
w_L  = P*L**3/(6*EI)*(3*x**2/L**2-x**3/L**3)
w_Lab= P*a**3/(6*EI)*(3*x/a-1)
# 
ΔP2=w_L  .subs({     x:L2,L:L1}).simplify()     #;print("#",ΔP2)
ΔQ1=w_Lab.subs({P:Q ,a:L2,x:L1}).simplify()     #;print("#",ΔQ1)
print("#",Eq(P*ΔQ1,Q*ΔP2))
# L2**2*P*(3*L1 - L2)/(6*EI)
# L2**2*Q*(3*L1 - L2)/(6*EI)
# True

(類題)SME 例題9.9 P160

ver 0.2

# ver 0.2
from sympy import *
var('PA,PB,a,EI,l')
δ11= PA*a**3/(3*EI)           
δ21=(δ11           +PA*a**2*(l-a)/(2*EI)).simplify() #;print(δ21)
δ12=PB*a**2/(6*EI)*(3*l-a)                           #;print(δ12)
# δ22=PA*l**3/(3*EI)           
print("#",Eq(δ12*PA,δ21*PB))
# True

ver 0.3

・ver 0.2と同じ。

# ver 0.3
from sympy import *
var('P,L,x')
var('PA,PB,a,EI,l')
w_L  = P*L**3/(6*EI)*(3*x**2/L**2-x**3/L**3)
w_Lab= P*a**3/(6*EI)*(3*x/a-1)
# 
δ2A=w_Lab.subs({P:PA,x:l})    .simplify()     ;print("#",δ2A)
δ1B=w_L  .subs({P:PB,x:a,L:l}).simplify()     ;print("#",δ1B)
print("#",Eq(δ1B*PA,δ2A*PB))
# PA*a**2*(-a + 3*l)/(6*EI)
# PB*a**2*(-a + 3*l)/(6*EI)
# True

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

(テンプレート)

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

Qiita内

wikipedia

参考文献

web

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?