0
0

Shrink-fitting 第10章 薄肉圧力容器 基本例題10.09 p338「材料力学演習(20221021)」をsympyでやってみたい。(英:thin wall structure)

Last updated at Posted at 2023-12-19

パイソニスタの方へ
・整数の丸めを教えて下さい。
-222.0 → -222
278.0 → 278

オリジナル

基本例題10.09 p338「材料力学演習(20221021)一括(ver.3.3)」を勉強したい。#sympy
          ???タブレット等で、pdfを開く事ができないかも。??? 

sympyで

from sympy import *
from decimal import Decimal, ROUND_HALF_UP

var('α2,ΔT,D,ΔD',real=True)
var('σt1,E1,t1' ,real=True)
var('σt2,E2,t2' ,real=True)
def myRound0(x):
    y = Decimal(str(x))
    a = y.quantize(Decimal('0'), rounding=ROUND_HALF_UP)
    return a

eq1=Eq(σt1,-E1/(1+E1*t1/(E2*t2))*ΔD/D)
eq2=Eq(σt2, E2/(1+E1*t1/(E2*t2))*ΔD*t1/ (D*t2)     )
rep={D:100,ΔD:0.25,t1:2.5,t2:2.0,E1:200*10**9,E2:200*10**9}  ;print("#",rep)
eq1=Eq(eq1.lhs,myRound0(eq1.rhs.subs(rep)/1000000))           ;print("#",eq1)
eq2=Eq(eq2.lhs,myRound0(eq2.rhs.subs(rep)/1000000))           ;print("#",eq2)
# {D: 100, ΔD: 0.25, t1: 2.5, t2: 2.0, E1: 200000000000, E2: 200000000000}
# Eq(σt1, -222.0)
# Eq(σt2, 278.0)

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

(テンプレート)

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

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