オリジナル
基本例題4.20 P98<「材料力学演習(20221021)一括(ver.3.3)」を勉強したい。#sympy
???タブレット等で、pdfを開く事ができないかも。???
latexで
\begin{array}{ll}
F=\dfrac{dM}{dx}\\
\end{array}
sympyで
・ver0.1
# ver0.1
# 基本例題4.20 P98
from sympy import *
from decimal import Decimal, ROUND_HALF_UP
var('FAC,x,a,MAC,FCB,P,MCB,l,RB,MC',real=True)
# var('RA,RB' ,real=True)
RA = Symbol('RA')
RB = Symbol('RB')
def myDic (myStrKey,myValue):
return {sympify(myStrKey):myValue}
def myRound1(x, d=1):
p = Decimal(str(x)).quantize(Decimal(str(1/10**d)), rounding=ROUND_HALF_UP)
p = float(p)
return p
MAC=solve(-RA*x+MAC ,MAC)[0] ;print("# MAC =",MAC)
MCB=solve(-RA*x+MC+MCB,MCB)[0] ;print("# MCB =",poly(MCB,P).args[0])
FAC=diff(MAC,x) ;print("# FAC =",FAC)
FCB=diff(MCB,x) ;print("# FCB =",FCB)
RA =solve(MCB.subs({x:l}),RA )[0] ;print("# RA =",RA)
RB =solve(RA+RB ,RB )[0] ;print("# RB =",RB) ;print()
#
rep = {l:1.0,a:0.4,MC:1000}
rep|= myDic("RA" ,myRound1(RA.subs(rep)) ) # ;print("# rep =",rep)
rep|= myDic("RB" ,myRound1(RB.subs(rep)) ) # ;print("# rep =",rep)
print("# ",rep )
#
print("# RA =",myRound1(RA .subs(rep)))
print("# RB =",myRound1(RB .subs(rep)))
print("# FAC =",myRound1(FAC.subs(rep)))
print("# FCB =",myRound1(FCB.subs(rep)))
print("# MAC =",MAC .subs(rep) )
print("# MCB =",MCB .subs(rep) )
# MAC = RA*x
# MCB = -MC + RA*x
# FAC = RA
# FCB = RA
# RA = MC/l
# RB = -MC/l
# {l: 1.0, a: 0.4, MC: 1000, RA: 1000.0}
# RA = 1000.0
# RB = -1000.0
# FAC = 1000.0
# FCB = 1000.0
# MAC = 1000.0*x
# MCB = 1000.0*x - 1000
いつもの? sympyの実行環境と 参考のおすすめです。
いつもと違うおすすめです。
参考文献
>一部に等分布荷重を受ける単純支持はり
>JSME p89
>片持ちばり 1)
>構造力学公式集 表5.1 片持ちばりの公式 p128