(¿£Áö´Ï¾î¸¦
À§ÇÑ) ÆÄÀ̽㠽ÃÀÛÇϱâ[10]
³»¿ë : ¿ÜºÎ¶óÀ̺귯¸®(ÆÐÅ°Áö) ´Ù·ç±â
ÂüÁ¶ : https://wikidocs.net/133199 (Á¡ÇÁÅõ ÆÄÀ̽㠿ܺζóÀ̺귯¸® ´Ù·ç±â)
0.½ÃÀÛÇϸç
¾Õ¿¡¼
¸ðµâ°ú ÆÐÅ°Áö¿¡ ´ëÇؼ ¾Ë¾ÆºÃ´Ù. math °°Àº ¸ðµâÀº ÆÄÀ̽ãÀ» ¼³Ä¡ÇÒ ¶§ °°ÀÌ ¼³Ä¡µÇ´Â builtin ¸ðµâÀ̾ú´Ù. À̹ø éÅÍ¿¡¼´Â ¿ÜºÎ ¶óÀ̺귯¸®(ÆÐÅ°Áö).
Áï ´Ù¸¥ »ç¶÷µéÀÌ ¸¸µé¾î¼ °øÀ¯ÇÑ ÆÐÅ°ÁöµéÀ» ¼³Ä¡ÇÏ°í °ü¸®ÇÏ´Â °Í¿¡ ´ëÇؼ ¾Ë¾Æº»´Ù. ÆÄÀ̽ãÀº ¸¹Àº ÆÐÅ°ÁöµéÀÌ ÀÖ´Ù.
1. ¿ÜºÎ ÆÐÅ°Áö ¼³Ä¡ ¹× Á¦°Å pip
Áö±Ý±îÁö
¿©·¯ºÐµéÀº ÆÄÀ̽ãÀÇ ±âÃʸ¦ ¹è¿ü´Ù. ÀÌÁ¦ºÎÅÍ´Â ÆÄÀ̽ãÀÇ ÁøÂ¥ °·ÂÇÑ ÆÄ¿öÀÎ ¿ÜºÎ ÆÐÅ°ÁöµéÀ» ¼³Ä¡ÇÏ°í »ç¿ëÇغ¸ÀÚ. math °°Àº builtin ÆÐÅ°Áö´Â
µû·Î ¼³Ä¡ÇÒ ÇÊ¿ä°¡ ¾ø¾ú´Ù. ¿ÜºÎ ÆÐÅ°ÁöµéÀº µû·Î ¼³Ä¡¸¦ ÇÑ ¼ö »ç¿ëÇØ¾ß ÇÑ´Ù.
ÆÄÀ̽ã¸ðµâµéÀ»
¸ð¾Æ³õÀº °÷ÀÌ ÀÖ´Ù.
https://pypi.org/
¾Æ·¡ÂÊ
Á¤º¸¸¦ º¸¸é ¾à 40¸¸°³ÀÇ ÇÁ·ÎÁ§Æ®µéÀÌ µî·Ï µÇ¾îÀÖ´Ù. ÀÌ »çÀÌÆ® ´öºÐ¿¡ ¿ì¸®´Â °£´ÜÇÏ°Ô ÆÐÅ°ÁöµéÀ» ã¾Æº¸°í ¼³Ä¡ÇÒ ¼ö ÀÖ´Ù.
ÀÌ°÷¿¡
¿Ã¶ó¿Í ÀÖ´Â ¸ðµâÀ̳ª ÆÐÅ°Áö¸¦ ¼³Ä¡ÇÏ·Á¸é ¾Æ·¡¿Í °°ÀÌ pip¸í·ÉÀ» ÀÌ¿ëÇÑ´Ù. ¿¹¸¦ µé¾î¼ ´ÜÀ§°è¸¦ ¸ÂÃçÁÖ´Â forallpeopleÀ̶ó´Â ÆÐÅ°Áö¸¦
¼³Ä¡Çغ¸ÀÚ.
±¸±Û°Ë»öÀ»
ÇÏ¸é ¼Ò½ºÄڵ带 °ü¸®ÇÏ°í °øÀ¯ÇÏ´Â »çÀÌÆ®ÀÎ ±êÇãºê »çÀÌÆ®¿Í pypi.org»çÀÌÆ®°¡ °Ë»öÀÌ µÈ´Ù. ÀÌ »çÀÌÆ®¿¡¼ ¼³¸íÀ» º¸°í »ç¿ë¹ýÀ» ÀÍÈ÷¸é µÈ´Ù.
https://github.com/connorferster/forallpeople
https://pypi.org/project/forallpeople/
¼³Ä¡´Â
anaconda propmt»óÅ¿¡¼ ¾Æ·¡¿Í °°ÀÌ ÀÔ·ÂÇÏ¸é µÈ´Ù.
(base) D:\dev\ESC>pip install forallpeople
|
»õ·Î¿î
ÆÐÅ°Áö¸¦ ¼³Ä¡ÇÑ ´ÙÀ½¿¡ Àß ¼³Ä¡µÇ¾ú´ÂÁö È®ÀÎÇÏ´Â ¹æ¹ýÀº pythonÀÎÅÍÇÁ¸®Å͸¦ ÄÑ°í importÇغ¸´Â °ÍÀÌ´Ù. ¿¡·¯ ¸Þ½ÃÁö°¡ ¾øÀ¸¸é Àß ¼³Ä¡µÈ
°ÍÀÌ´Ù.
(base) D:\dev\ESC>python
Python 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more
information.
>>>
import forallpeople
|
¼³Ä¡µÈ ÆÐÅ°Áö(¸ðµâ) È®ÀÎÇϱâ
ÀÚ½ÅÀÇ
ÄÄÇ»ÅÍ¿¡ ¼³Ä¡µÈ ÆÐÅ°Áö¸¦ È®ÀÎÇϱâ À§Çؼ´Â ¾Æ·¡¿Í °°ÀÌ pip list¸¦ ÀÔ·Â¸é ¼³Ä¡µÈ ¸ðµç ÆÐÅ°Áö(¸ðµâ)ÀÇ ¸®½ºÆ®¸¦ º¼ ¼ö ÀÖ´Ù. ¹æ±Ý Àü¿¡
¼³Ä¡ÇÑ forallpeople°ú ¹öÀüÀ» È®ÀÎÇÒ ¼ö ÀÖ´Ù.
(base) D:\dev\ESC>pip list
. . . <Áß°£»ý·«>
forallpeople
2.6.3
. . . <ÀÌÈÄ»ý·«>
|
ÆÐÅ°Áö´Â ¾îµð¿¡ ¼³Ä¡µÇ´Â °ÍÀϱî?
pip·Î
¼³Ä¡ÇÏ´Â ÆÐÅ°Áö´Â ¾îµð¿¡ ¼³Ä¡µÇ´Â °ÍÀϱî? pip show ÆÐÅ°Áö¸íÀ¸·Î ÆÐÅ°Áö¿¡ °üÇÑ ¿ä¾àÀ» º¼ ¼ö ÀÖ´Ù.
(base) D:\dev\ESC>pip show forallpeople
Name: forallpeople
Version: 2.6.3
Summary: The SI Units: "For all people, for all time"
Home-page: https://github.com/connorferster/forallpeople
Author: Connor Ferster
Author-email: connorferster@gmail.com
License:
Location: c:\programdata\anaconda3\lib\site-packages
Requires:
Required-by:
|
LocationÁ¤º¸¸¦ º¸¸é
c:\programdata\anaconda3\lib\site-packages ¿©±â¿¡ ¼³Ä¡µÈ °ÍÀ» ¾Ë ¼ö ÀÖ´Ù. ¸¸¾à ¾Æ³ªÄÜ´Ù¸¦ ¼³Ä¡ÇÏÁö ¾Ê¾Ò´Ù¸é
ÀÌ À§Ä¡°¡ ¾Æ´Ò ¼ö ÀÖ´Ù. ¿¹¸¦ µé¾î pythonÀ» Á÷Á¢ ¼³Ä¡Çß´Ù¸é ´Ù¸¥ µð·ºÅ丮¿¡ python½ÇÇàÆÄÀϵµ ÀÖÀ» °ÍÀÌ°í lib,
site-package µð·ºÅ丮°¡ ÀÖÀ» °ÍÀÌ´Ù. ¾Æ³ªÄÜ´Ù prompt¿¡¼ pip installÀ» Çϸé anacondaȯ°æ¿¡ ÆÐÅ°Áö°¡ ¼³Ä¡µÇ´Â °ÍÀÌ°í
´Ù¸¥ ȯ°æ¿¡¼ ¼³Ä¡Çϸé ÇØ´ç µð·ºÅ丮¿¡ ÆÐÅ°Áö°¡ ¼³Ä¡µÇ´Â °ÍÀÌ´Ù. ÀÌÁ¡À» ÁÖÀÇÇØ¾ß ÇÑ´Ù. ȯ°æÀÌ ¿©·¯°³°¡ µÉ ¼ö ÀÖ´Ù´Â °ÍÀÌ´Ù. ÃßÈÄ¿¡ °¡»óȯ°æÀ̶ó´Â
°ÍÀ» ¼Ò°³ÇÏ°Ú´Ù.
ÇØ´ç
site-package µð·ºÅ丮·Î °¡¼ ±¸°æÁ» Çغ¸ÀÚ. µð·ºÅ丮·Î À̵¿Çؼ dir¸í·ÉÀ» Ã常é forallpeople °ü·Ã µð·ºÅ丮°¡ µÎ°³°¡ ÀÖ´Â
°ÍÀ» È®ÀÎÇÒ ¼ö ÀÖ´Ù.
(base)
C:\ProgramData\Anaconda3\Lib\site-packages>dir
2022-09-08 ¿ÀÀü 11:34
<DIR>
forallpeople
2022-09-08 ¿ÀÀü 11:34
<DIR>
forallpeople-2.6.3.dist-info
|
site-package µð·ºÅ丮¸¦ Àß ±â¾ïÇصÎÀÚ.
¾ÕÀ¸·Î ¿ì¸®°¡ ¸¸µé ÆÐÅ°Áö¸¦ ¿©±â¿¡ À§Ä¡½ÃÄѼ importÇÒ °ÍÀÌ´Ù.
ÆÐÅ°Áö Á¦°Å
°ÍÀ̼³Ä¡µÈ
ÆÐÅ°Áö¸¦ Á¦°ÅÇÏ´Â ¸í·ÉÀº pip uninstall ÆÐÅ°ÁöÀ̸§ÀÌ´Ù.
(base) D:\dev\ESC>pip uninstall
forallpeople
|
2. ´ÜÀ§ Á¦¾î ÆÐÅ°Áö ¼Ò°³ (forallpeople)
¿£Áö´Ï¾îµéÀº
´ÜÀ§¿¡ ¹Î°¨ÇÏ´Ù. ´ÜÀ§ Á¦¾î¿ë ÆÐÅ°Áö forallpeople¸¦ ¼³Ä¡Çß°í »ç¿ë¹ýÀ» ¾Ë¾Æº¸ÀÚ. »ç¿ë¹ýÀº º¸Åë pypi.org »çÀÌÆ®³ª github
»çÀÌÆ®¸¦ ÂüÁ¶ÇÑ´Ù. ÇÁ·Î±×·¥À» ¸¸µç »ç¶÷µéÀÌ ¿Ã·Á³õÀº ¹®¼¸¦ ÂüÁ¶ÇÏ¸é µÈ´Ù. github»çÀÌÆ®¿¡ °¡º¸ÀÚ. ¼³Ä¡¹ýºÎÅÍ °£´ÜÇÑ ¼³¸í, ¿¹Á¦ µîÀÌ ¿Ã¶ó¿Í
ÀÖ´Ù.
https://github.com/connorferster/forallpeople
°£´ÜÇÑ
»ç¿ë¹ýÀ» µû¶óÇغ¸ÀÚ.
ÀÛ¿ëÇÏÁßÀ»
kN´ÜÀ§·Î, Æø°ú ³ôÀ̸¦ °¢°¢ mm´ÜÀ§·Î ÀÔ·ÂÇÏ°í ÀÀ·ÂÀ» ±¸Çغ¸ÀÚ. importÇÒ ¶§ si¶ó´Â º°ÄªÀ» ÁöÁ¤Çß´Ù. ±×¸®°í ȯ°æÀ» Á¤ÀÇÇØÁÙ ¶§
¡®structural¡¯À̶ó´Â ¿É¼ÇÀ» ÁöÁ¤Çß´Ù. top_level=True·Î ÀÔ·ÂÇϸé kNÀ¸·Î ¾µ ¼ö ÀÖ°í False·Î ÁöÁ¤Çϸé si.kNÀ¸·Î ÀÔ·ÂÇؾß
ÇÑ´Ù. ´ÜÀ§´Â ¼ýÀÚ µÚ¿¡ ½áÁÖ¸é µÈ´Ù. f=p/b/h ÀÌ·¸°Ô °è»êÇß´Ù. p,b,h¿¡ ´ÜÀ§°¡ Æ÷ÇԵǾî Àֱ⠶§¹®¿¡ °á°ú f¿¡´Â kPaÀ̶ó´Â ´ÜÀ§°¡
Æ÷ÇԵǾîÀÖ´Â °ÍÀ» ¾Ë ¼ö ÀÖ´Ù.
>>> import forallpeople as si
>>>
si.environment('structural', top_level=True)
>>>
p=10*kN
>>>
b=1000*mm
>>>
h=500*mm
>>>
f=p/b/h
>>>
f
20.000 kPa
|
±×·±µ¥
kPaÀ̶ó´Â ´ÜÀ§°¡ ´«¿¡ °Å½½¸°´Ù. ¿ì¸®´Â ÀÀ·ÂÀÇ ´ÜÀ§´Â MPa·Î ¾²°í ½Í´Ù. ÀÌ·± °æ¿ì prefix ¼Ó¼ºÀ» »ç¿ëÇÏ¸é µÈ´Ù. PaÀÌ ´ÜÀ§ ÀÌ°í
±× ¾ÕÀÇ k, M µîÀÌ prefix´Ù. prefix¸¦ ¡®M¡¯·Î ÁöÁ¤ÇØÁÖ¸é ¾Ë¾Æ¼ 20 kPaÀ» 0.020 Mpa·Î º¯°æÇØÁØ´Ù.
>>> f=f.prefix('M')
>>>
f
0.020 MPa
|
Æ÷¸ËÆÿ¡µµ
´ÜÀ§°¡ ¸ÔÈú±î? Å×½ºÆ® Çغ¸ÀÚ
>>> f"stress = {f}"
'stress
= 0.020 MPa'
|
f-string
Æ÷¸ËÆÃÀ» Àû¿ëÇß´Ù. MPaÀ̶ó´Â ´ÜÀ§¸¦ ¾²Áö ¾Ê¾Æµµ f¿¡ MPaÀÌ Æ÷ÇÔµÈ °ÍÀ» ¾Ë ¼ö ÀÖ´Ù.
ÀÚ¼¼ÇÑ
°ÍÀº ±êÇãºê»çÀÌÆ®¸¦ Âü°íÇÏÀÚ.
3. ÆÐÅ°Áö ã¾Æ¼ µ¹·Áº¸±â(´Ü¸é»ó¼ö ±¸ÇÏ´Â ÆÐÅ°Áö)
ÆÄÀ̽ãÀÇ
¹Ù´Ù¿¡´Â Á¤¸» ¸¹Àº ÆÐÅ°ÁöµéÀÌ ÀÖ´Ù. ±×³É ±¸±Û¿¡¼ ÀÚ½ÅÀÌ ¿øÇÏ´Â ±â´ÉÀ» °Ë»öÇغ¸ÀÚ. ¹°·Ð °Ë»ö¾î¿¡ pythonÀ̶ó´Â ´Ü¾î¸¦ Æ÷ÇÔÇؼ °Ë»öÇغ¸¸é
µÈ´Ù.
ÀÏ´Ü
ÆÄÀ̽ãÀ» ÇÒ ÁÙ ¾Ë°Ô µÇ¸é ¿ÀǼҽº ã¾Æº¸°í Å×½ºÆ®Çغ¸´Â °ÍÀÌ Ãë¹Ì»ýÈ°ÀÌ µÉ °ÍÀÌ´Ù. ´ëºÎºÐÀÇ ¹®¼µéÀº °£´ÜÇÏ°Ô Å×½ºÆ®ÇÒ ¼ö ÀÖ´Â ÄÚµåµéÀ» Á¦°øÇÑ´Ù.
±¸Á¶¹°ÀÇ
´Ü¸é»ó¼ö¸¦ ±¸ÇÏ´Â ÆÐÅ°Áö°¡ ºÐ¸í ÀÖÀ» °Í °°´Ù. google¿¡¼ python section property·Î °Ë»öÇغ¸ÀÚ.
¸Ç
À§¿¡ ÀÖ´Â »çÀÌÆ®¸¦ ¹æ¹®Çغ¸ÀÚ.
Documentation
— sectionproperties 2.1.3 documentation
https://sectionproperties.readthedocs.io/en/latest/
¼³Ä¡¹æ¹ýÀº
¾Æ·¡¿Í °°´Ù.
pip install sectionproperties
|
ˤ
url¿¡ Á¢±ÙÇßÀ» ´ë ³ª¿Í ÀÖ´Â Äڵ带 ½ÇÇàÇغ¸ÀÚ. Äڵ带 ±Ü¾î¼ ¿¡µðÅÍ¿¡ ºÙ¿©³Ö°í À̸§À» sprop01.py¶ó ÀúÀåÇß´Ù.
<sprop01.py>
import sectionproperties.pre.library.steel_sections as steel_sections
from
sectionproperties.analysis.section import Section
# create geometry of the cross-section
geometry = steel_sections.i_section(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8)
# generate a finite element mesh
geometry.create_mesh(mesh_sizes=[10])
# create a Section object for analysis
section = Section(geometry)
# calculate various cross-section
properties
section.calculate_geometric_properties()
section.calculate_warping_properties()
# print some of the calculated section
properties
print(section.get_area()) #
cross-section area
print(section.get_ic()) #
second moments of area about the centroidal axis
print(section.get_j()) #
torsion constant
print(section.get_As()) # shear
areas in the x & y directions
|
ÇÁ·Î±×·¥À»
½ÇÇà½ÃÅ°¸é ¾Æ·¡¿Í °°ÀÌ °á°ú°¡ ³ª¿Â´Ù. ¼Ò½ºÄÚµåÀÇ commnet¿¡ ³ª¿ÍÀִ´ë·Î ´Ü¸éÀû, ´Ü¸é2Â÷¸ð¸àÆ®, ºñƲ¸²»ó¼ö, Àü´Ü¸éÀûÀÌ´Ù.
(base) D:\dev\sectionproperties>python
sprop01.py
3231.797635498484
(23544664.294320498, 3063383.068157863, -1.862645149230957e-08)
62954.4326107353
(1842.2372040432651, 1120.1935881701659)
|
Äڵ带
»ìÆ캸¸é steel_section.i_section()À̶ó´Â ÇÔ¼ö°¡ ÀÖ´Ù. ¾Æ¸¶µµsteel_section¿¡ ¿©·¯°¡Áö Çü»óÀÇ ´Ü¸éµéÀÇ Á¦¿øÀ» ÀÔ·ÂÇÒ
¼ö ÀÖ´Â ÇÔ¼öµéÀÌ Á¤ÀÇ µÇ¾îÀÖÀ» °ÍÀÌ´Ù. i_sectionÀÇ Á¦¿øÀ» ÀÔ·ÂÇϵµ·Ï ÇÏ°í ÀÖ´Ù. ¿ì¸® 6¹ø° °Á¿¡¼ ÀÌ¿Í ºñ½ÁÇÑ ÇÔ¼ö¸¦
¸¸µé¾îº» Àû ÀÖ´Ù.
geometry = steel_sections.i_section(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8)
|
ÀÌ
ÆÐÅ°ÁöÀÇ ±â´ÉÀº ¿©±â¼ ³¡³ªÁö ¾Ê´Â´Ù. example gallery¿¡ °¡º¸ÀÚ.
https://sectionproperties.readthedocs.io/en/latest/sphinx_gallery_examples/index.html
¹º°¡
°·ÂÇÑ ±â´ÉÀÌ ÀÖ´Â °Í °°´Ù. ±×¸²µµ º¸ÀÌ°í ¾Æ·¡ÂÊ ¼¼¹ø°´Â °+ÄÜÅ©¸®Æ® ÇÕ¼º´Ü¸éµµ º¸ÀδÙ. ÀÏ´Ü À§ÂÊ ¼¼¹ø° °ÍÀ» Å×½ºÆ® Çغ¸ÀÚ. ÇØ´ç ±×¸²À»
Ŭ¸¯ÇÏ°í µé¾î°¡¸é Äڵ带 ´Ù¿î ¹ÞÀ» ¼ö ÀÖ´Ù. ÄÚµåÀÇ ±æÀÌ´Â 81ÁÙ ¹Û¿¡ ¾ÈµÈ´Ù. comment¸¦ »©°í ³ª¸é ±æÁö ¾ÊÀº ÄÚµå´Ù.
¿¹Á¦
ÆÄÀÏ À̸§Àº 03_custom.py´Ù. ½ÇÇàÀ» Çغ¸¸é ¸Þ½Ã³ª´²Áø »ýÅÂÀÇ ±×¸²Ã¢ÀÌ º¸ÀÌ°í ±×¸²Ã¢À» ´ÝÀ¸¸é °è»ê°á°ú¸¦ º¸¿©ÁÖ´Â ±×¸²Ã¢ÀÌ ¶á´Ù.
(base) D:\dev\sectionproperties>python 03_custom.py
|
<¸Þ½Ã
¿Ï·á´Ü°è>
<°è»ê ¿Ï·á´Ü°è>
¸î°¡Áö
¿ÜºÎ ÆÐÅ°Áö¸¦ ¼Ò°³Çß´Ù. pypi¿¡ µî·ÏµÈ 40¿© ¸¸°³ÀÇ ÆÐÅ°Áö Áß¿¡ ³»°¡ ÇÊ¿ä·Î ÇÏ´Â ±â´ÉÀÌ ºÐ¸í ÀÖÀ» °ÍÀÌ´Ù. ¸¸¾à ¾ø´Ù¸é ³»°¡ ÇÊ¿ä·Î ÇÏ´Â
±â´ÉÀ» ´Ù¸¥ »ç¶÷µµ ÇÊ¿ä·Î ÇÒ °ÍÀÌ´Ï ³»°¡ ¸¸µé¾î¼ µî·ÏÇÏ´Â °ÍÀº ¾î¶³±î?
pythonÀ»
¾î´ÀÁ¤µµ ÇÒ ÁÙ ¾Ë°Ô µÇ¸é ±¸±Û¸µÇؼ ³»°¡ ¿øÇÏ´Â ÆÐÅ°Áö¸¦ ã´Â °ÍÀÌ Àç¹ÌÀÖ´Ù. ½Å¼¼°è¸¦ ¸¸³ª´Â ±âºÐÀÌ´Ù.