LoginSignup
0
0

sympyの 「Beam (Docstrings)」を調べた。

Last updated at Posted at 2024-01-10

テスト




# 4.23 P101
from sympy import *
init_printing(use_unicode=True, wrap_line=False)
from sympy.physics.continuum_mechanics.beam import Beam
E, I  = symbols('E, I')
RA,RB = symbols('RA,RB')
b = Beam(1, E, I)
b.apply_load(1.0,0.4,-1)
b.apply_load(RA ,0.0,-1)
b.apply_load(RB ,1.0,-1)
b.load
b.solve_for_reaction_loads(RA, RB)
b.reaction_loads                      ;print("# b.reaction_loads =",b.reaction_loads)
b.load                                ;print("# b.load           =",b.load)
b.shear_force()                       ;print("# b.shear_force    =",b.shear_force())
b.bending_moment()                    ;print("# b.bending_moment =",b.bending_moment())
# 
b.plot_shear_force()  
b.plot_bending_moment()  
# b.plot_slope()
# b.plot_deflection() 

# b.reaction_loads = {RA: -3/5, RB: -2/5}
# b.load           = -3*SingularityFunction(x, 0.0, -1)/5 + 1.0*SingularityFunction(x, 0.4, -1) - 2*SingularityFunction(x, 1.0, -1)/5
# b.shear_force    = 3*SingularityFunction(x, 0.0, 0)/5 - 1.0*SingularityFunction(x, 0.4, 0) + 2*SingularityFunction(x, 1.0, 0)/5
# b.bending_moment = 3*SingularityFunction(x, 0.0, 1)/5 - 1.0*SingularityFunction(x, 0.4, 1) + 2*SingularityFunction(x, 1.0, 1)/5

・以下,結果
b.plot_shear_force()
b.plot_bending_moment()

    0.6 |......................                                 
        |                                                       
        |                                                       
        |                                                       
        |                                                       
        |                                                       
        |                                                       
        |                                                       
        |                                                       
        |                                                       
    0.1 |-------------------------------------------------------
        |                                                       
        |                                                      .
        |                                                       
        |                                                       
        |                                                       
        |                                                       
        |                                                       
        |                                                       
        |                                                       
   -0.4 |_______________________________________________________
         0                          0.5                        1
   0.24 |                      .                                
        |                    .. ..                              
        |                   /     \                             
        |                  /       ..                           
        |                 /          \                          
        |                /            ..                        
        |               /               ..                      
        |              /                  \                     
        |             /                    ..                   
        |            /                       \                  
   0.12 |-----------/-------------------------..----------------
        |          /                            ..              
        |         /                               \             
        |        /                                 ..           
        |      ..                                    ..         
        |     /                                        \        
        |    /                                          ..      
        |   /                                             \     
        |  /                                               ..   
        | /                                                  .. 
      0 |_______________________________________________________
         0                          0.5                        1

だめでした

# だめでした
# 4.23 P101
from sympy import *
init_printing(use_unicode=True, wrap_line=False)
from sympy.physics.continuum_mechanics.beam import Beam
E, I  = symbols('E,I')
RA,RB = symbols('RA,RB')
L,a   = symbols('L,a')
b = Beam(L, E, I)
b.apply_load(L  ,a  ,-1)
b.apply_load(RA ,0.0,-1)
b.apply_load(RB ,1.0,-1)
b.load
b.solve_for_reaction_loads(RA, RB)
# b.reaction_loads                      ;print("# b.reaction_loads =",b.reaction_loads)
# b.load                                ;print("# b.load           =",b.load)
# b.shear_force()                       ;print("# b.shear_force    =",b.shear_force())
# b.bending_moment()                    ;print("# b.bending_moment =",b.bending_moment())
# 
# b.plot_shear_force()  
# b.plot_bending_moment()  
# b.plot_slope()
# b.plot_deflection() 

いつもの? 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