Giter Site home page Giter Site logo

kangwonlee / momisp Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 3.0 1.78 MB

Mechanics of Materials in SciPy

License: Other

Jupyter Notebook 83.10% Python 16.08% Shell 0.82%
strength-of-materials mechanical-engineering solid-mechanics python numpy sympy mechanical engineering solid mechanics

momisp's Introduction

master

재료역학 SciPy 사례집
Mechanics of Materials in SciPy

주 참고문헌 : Pytel 외 저, 이주성 외 역, 재료역학 2판, 한티미디어, 2013.
Main Text: Pytel et. al, Mechanics of Materials, 2nd Ed, 2013.

설치 항목 Software to install

파이썬 프로그래밍 언어 Python Programming Language

깃 버전 관리 소프트웨어 Git Version Control Software

CUI

아래 소프트웨어를 설치 Please install following software

간단한 추천 사항 A few simple recommendations

  • 명령행에서 사용 Command line interface
  • 실습실 환경에서는 credential manager 설치 삼가
    Credential manager may not be a best choice for a computer lab
  • 아래 IDE 가운데 Microsoft Visual Studio Code 선택시 다음과 같이 생각해 볼 수 있음
    To use Microsoft Visual Studio Code among IDEs below, an administrator may consider followings
항목
Key

Value
git 기본 편집기
Default editor for Git
MS VS Code
경로 환경 조정
Adjusting Path environment
Use Git from the Windows Command Prompt
터미널 에뮬레이터
Terminal emulator
Use Windows' default console window
자격 인증 관리자 활성화
Enable Git Credential Manager
전산 실습 환경의 경우, 선택 해제
If computer lab, unselect

이후 MS vscode 에서도 한두가지 추가 설정을 실시하면 내장 터미널로 git-bash 를 사용할 수 있음
With a few additional configurations in MS vscode, one could use git-bash as the integrated terminal.

GUI

아래 가운데 택일 Choose one from below

통합 개발 환경 Integrated Development Environment

아래 가운데 택일 Choose one from below

Spyder
  • Anaconda 5.x 와 함께 설치됨.
    Anaconda 5.x includes spyder.
  • Anaconda 설치 후 설치 선택 가능
    Installation button available at the end of Anaconda installation
  • 다운로드 받아서 설치도 가능
    Possible to download and install from the website
    Setup Overview / Python Configuration Instruction
  • Windows 에서 git-bash를 내장 터미널로 사용하려면 다음과 같은 추가 설정이 필요함.[참고]
    In Windows, to use git-bash as the integrated terminal, following additional settings would enable it.[Ref]
  1. File > Preferences > Settings
  2. "terminal.integrated.shell.windows": **path to bash.exe here**

설치 동영상
Installation video

설치 동영상 Installation video

jupyter 노트북 실행시키는 법
How to start a jupyter notebook

이 저장소 는 주로 jupyter 노트북으로 만들어져 있음.
This repository is mostly written in jupyter notebook.
jupyter 노트북은 웹브라우저를 통해 프로그램 코드를 수정 실행하고 LaTex 수식을 포함한 문서 작성이 가능함.
Through a web browser, jupyter notebook enables editing & running program codes and writing documents including LaTex equations.

  • 적당한 folder 를 만듦 (예를 들어 User/Documents/SolMech/)
    Make an appropriate folder (e.g., User/Documents/SolMech/)
  • Git 또는 SourceTree 를 이용하여 위 folder 아래 이 원격 저장소를 git clone
    Using the Git or SourceTree, git clone this repository under the folder
  • cmd 또는 git bash 실행한 후 clone 된 지역 저장소 folder로 이동 (예를 들어 cd User/Documents/Solmech/)
    Start cmd or git bash and change working folder to the cloned folder (e.g. cd User/Documents/Solmech/)
  • cmd 또는 git bash 에서 각각 cd 또는 pwdclone 된 folder 인지 확인
    Check location using cd or pwd in cmd or git bash
  • jupyter notebook 실행
    Run jupyter notebook

실행 동영상
Instruction video

실행 동영상 Instruction video

알림
Acknowledgement

이 소프트웨어는 대한민국 국토교통부 건설교통과학기술진흥원 교통물류연구사업의 지원을 받았음 (18TLRP-B117133-03) This software was supported by the Korea Ministry of Land, Infrastructure, and Transportation. It was also supported by the Korean Agency for Infrastructure Technology Advancement. (18TLRP-B117133-03)

momisp's People

Contributors

beachdweller avatar kangwon-naver avatar kangwonlee avatar kwlee2020 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

momisp's Issues

`pytest-xdist` not succeeding with python 3.6

Traceback (most recent call last):
  File "~/miniconda/envs/test-environment/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 510, in load_setuptools_entrypoints
    plugin = ep.load()
  File "~/miniconda/envs/test-environment/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2410, in load
    self.require(*args, **kwargs)
  File "~/miniconda/envs/test-environment/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2433, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "~/miniconda/envs/test-environment/lib/python3.6/site-packages/pkg_resources/__init__.py", line 791, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pytest 3.2.1 (~/miniconda/envs/test-environment/lib/python3.6/site-packages), Requirement.parse('pytest>=3.6.0'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "~/miniconda/envs/test-environment/bin/py.test", line 11, in <module>
    sys.exit(main())
  File "~/miniconda/envs/test-environment/lib/python3.6/site-packages/_pytest/config.py", line 49, in main
    config = _prepareconfig(args, plugins)
  File "~/miniconda/envs/test-environment/lib/python3.6/site-packages/_pytest/config.py", line 168, in _prepareconfig
    pluginmanager=pluginmanager, args=args)
  File "~/miniconda/envs/test-environment/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 745, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "~/miniconda/envs/test-environment/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 339, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "~/miniconda/envs/test-environment/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 334, in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
  File "~/miniconda/envs/test-environment/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 613, in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
  File "~/miniconda/envs/test-environment/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 250, in _wrapped_call
    wrap_controller.send(call_outcome)
  File "~/miniconda/envs/test-environment/lib/python3.6/site-packages/_pytest/helpconfig.py", line 68, in pytest_cmdline_parse
    config = outcome.get_result()
  File "~/miniconda/envs/test-environment/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 279, in get_result
    raise ex[1].with_traceback(ex[2])
  File "~/miniconda/envs/test-environment/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 265, in __init__
    self.result = func()
  File "~/miniconda/envs/test-environment/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 614, in execute
    res = hook_impl.function(*args)
  File "~/miniconda/envs/test-environment/lib/python3.6/site-packages/_pytest/config.py", line 957, in pytest_cmdline_parse
    self.parse(args)
  File "~/miniconda/envs/test-environment/lib/python3.6/site-packages/_pytest/config.py", line 1121, in parse
    self._preparse(args, addopts=addopts)
  File "~/miniconda/envs/test-environment/lib/python3.6/site-packages/_pytest/config.py", line 1084, in _preparse
    self.pluginmanager.load_setuptools_entrypoints('pytest11')
  File "~/miniconda/envs/test-environment/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 515, in load_setuptools_entrypoints
    "Plugin %r could not be loaded: %s!" % (ep.name, e))
_pytest.vendored_packages.pluggy.PluginValidationError: Plugin 'xdist' could not be loaded: (pytest 3.2.1 (~/miniconda/envs/test-environment/lib/python3.6/site-packages), Requirement.parse('pytest>=3.6.0'))!
  • conda list as follows
$ conda list
WARNING: The conda.compat module is deprecated and will be removed in a future release.
# packages in environment at /home/travis/miniconda/envs/test-environment:
#
# Name                    Version                   Build  Channel
apipkg                    1.5                      py36_0  
attrs                     19.1.0                   py36_1  
backcall                  0.1.0                    py36_0  
blas                      1.0                         mkl  
bleach                    3.1.0                    py36_0  
ca-certificates           2019.1.23                     0  
certifi                   2019.3.9                 py36_0  
cycler                    0.10.0                   py36_0  
dbus                      1.13.2               hc3f9b76_0  
decorator                 4.4.0                    py36_1  
defusedxml                0.5.0                    py36_1  
entrypoints               0.3                      py36_0  
execnet                   1.5.0                    py36_0  
expat                     2.2.6                he6710b0_0  
fastcache                 1.0.2            py36h14c3975_2  
fontconfig                2.12.6               h49f89f6_0  
freetype                  2.8                  hab7d2ae_1  
glib                      2.53.6               h5d9569c_2  
gmp                       6.1.2                h6c8ec71_1  
gmpy2                     2.0.8            py36h10f8cd9_2  
gst-plugins-base          1.12.4               h33fb286_0  
gstreamer                 1.12.4               hb53b477_0  
icu                       58.2                 h9c2bf20_1  
intel-openmp              2019.3                      199  
ipykernel                 5.1.0            py36h39e3cac_0  
ipython                   7.4.0            py36h39e3cac_0  
ipython_genutils          0.2.0                    py36_0  
ipywidgets                7.4.2                    py36_0  
jedi                      0.13.3                   py36_0  
jinja2                    2.10                     py36_0  
jpeg                      9b                   h024ee3a_2  
jsonschema                3.0.1                    py36_0  
jupyter                   1.0.0                    py36_7  
jupyter_client            5.2.4                    py36_0  
jupyter_console           6.0.0                    py36_0  
jupyter_core              4.4.0                    py36_0  
libedit                   3.1.20181209         hc058e9b_0  
libffi                    3.2.1                hd88cf55_4  
libgcc-ng                 8.2.0                hdf63c60_1  
libgfortran-ng            7.3.0                hdf63c60_0  
libpng                    1.6.36               hbc83047_0  
libsodium                 1.0.16               h1bed415_0  
libstdcxx-ng              8.2.0                hdf63c60_1  
libxcb                    1.13                 h1bed415_1  
libxml2                   2.9.9                he19cac6_0  
markupsafe                1.1.1            py36h7b6447c_0  
matplotlib                2.1.0            py36hba5de38_0  
mistune                   0.8.4            py36h7b6447c_0  
mkl                       2018.0.3                      1  
mkl_fft                   1.0.6            py36h7dd41cf_0  
mkl_random                1.0.1            py36h4414c95_1  
mpc                       1.1.0                h10f8cd9_1  
mpfr                      4.0.1                hdf1c602_3  
mpmath                    1.1.0                    py36_0  
nbconvert                 5.4.1                    py36_3  
nbformat                  4.4.0                    py36_0  
ncurses                   6.1                  he6710b0_1  
notebook                  5.7.8                    py36_0  
numpy                     1.13.3           py36hdbf6ddf_4  
openssl                   1.0.2r               h7b6447c_0  
pandas                    0.23.4           py36h04863e7_0  
pandoc                    2.2.3.2                       0  
pandocfilters             1.4.2                    py36_1  
parso                     0.3.4                    py36_0  
patsy                     0.5.1                    py36_0  
pcre                      8.43                 he6710b0_0  
pexpect                   4.6.0                    py36_0  
pickleshare               0.7.5                    py36_0  
pip                       19.0.3                   py36_0  
prometheus_client         0.6.0                    py36_0  
prompt_toolkit            2.0.9                    py36_0  
ptyprocess                0.6.0                    py36_0  
py                        1.8.0                    py36_0  
pygments                  2.3.1                    py36_0  
pyparsing                 2.3.1                    py36_0  
pyqt                      5.6.0            py36h22d08a2_6  
pyrsistent                0.14.11          py36h7b6447c_0  
pytest                    3.2.1            py36h11ad3bb_1  
pytest-forked             1.0.2                    py36_0  
pytest-xdist              1.26.1                   py36_0  
python                    3.6.6                h6e4f718_2  
python-dateutil           2.8.0                    py36_0  
pytz                      2018.9                   py36_0  
pyzmq                     18.0.0           py36he6710b0_0  
qt                        5.6.2               hd25b39d_14  
qtconsole                 4.4.3                    py36_0  
readline                  7.0                  h7b6447c_5  
scipy                     0.19.1           py36h9976243_3  
send2trash                1.5.0                    py36_0  
setuptools                40.8.0                   py36_0  
sip                       4.18.1           py36hf484d3e_2  
six                       1.12.0                   py36_0  
sqlite                    3.27.2               h7b6447c_0  
statsmodels               0.9.0            py36h035aef0_0  
sympy                     1.1.1                    py36_0  
terminado                 0.8.1                    py36_1  
testpath                  0.4.2                    py36_0  
tk                        8.6.8                hbc83047_0  
tornado                   6.0.2            py36h7b6447c_0  
traitlets                 4.3.2                    py36_0  
wcwidth                   0.1.7                    py36_0  
webencodings              0.5.1                    py36_1  
wheel                     0.33.1                   py36_0  
widgetsnbextension        3.4.2                    py36_0  
xz                        5.2.4                h14c3975_4  
zeromq                    4.3.1                he6710b0_3  
zlib                      1.2.11               h7b6447c_3  

Generalize beam solution

Beams with concentrated loads
Beams with distributed loads
SFD --> BMD --> EI slope --> EI deflection

Math results on ipynb

version : 1e892e8
File : Ch02_Strain/ex02.002.numpy.varying.width.ipynb
Check math result on ipynb

import IPython.display as disp
disp.display(disp.Math(r'$$'
                       r'\begin{align}'
                       r'\delta &= %f(m) \\'
                       r'       &= %f(mm)'
                       r'\end{align}'
                       r'$$' % (delta_m, delta_m*1000)))

Colab :

momisp-colab-02 002

Local Jupyter Notebook :

02-002-expected

How to cache `brew`?

  • If using brew for osx, how to cache?
  • Would it make cache larger? (pip alone 500MB)

Plot stress distributions

Possible to add shear stress distribution for ex05.010.

Bending normal stress distribution looks quite good.

Merge incremental plot cells

  • Some cells incrementally build up the plots; plt.show() would finalize the plot
  • (Since when?) Now each cell present a plot and start anew in the next cell
  • Ch02
  • Ch03 cffe18f
  • ex04.002 c7368cd
  • ex04.003
  • ex04.005
  • ex04.006
  • Ch05 875a37d
  • Ch06 9fc9850
  • Ch07
  • Ch08
  • Ch10
  • Ch12

unit conversion factors

Add these as the second cell?

  • Pa -> MPa : 1e-6
  • mm -> m : 1e-3
  • m -> mm : 1e3
  • m^2 -> mm^2 : 1e6
  • deg -> rad : pi / 180
  • rad -> deg : 180 / pi

Faster build

Current status

  • According to the conclusion of Schuchert10 min seems to be a good goal
  • On a desktop, running the test takes less than 5 min
  • On Travis-CI, one job on linux or osx takes less than 10 min but on windows more than 20 min
platform without cache with cache
linux 20 min 10 min
osx 20 min 10 min
windows 25 min 50 min
  • Total 4:19:51 (1:14:47 by parallel)
  • Maybe 7.5 times time saving desirable
  • Also, cache size is quite big (~ 6GB)
  • Is docker a practical solution?

Too many environments?

  • Currently running on {linux, osx, windows} × python {3.5, 3.6, 3.7, 3.71, nightly}
  • Total 15 combinations
  • Reduce to a smaller number?
  • Run on osx & windows only?
  • Run on two last releases of Anaconda?
  • Recently, the Anaconda installation included some confusions

Detailed build time analysis

  linux   osx   windows  
3.5 0:06:05 2.81% 0:12:52 5.94% 0:21:52 10.09%
3.6 0:08:01 3.70% 0:11:40 5.38% 0:24:51 11.46%
3.7 0:07:37 3.51% 0:11:02 5.09% 0:24:03 11.10%
3.7.1 0:08:10 3.77% 0:11:23 5.25% 0:23:49 10.99%
nightly 0:08:16 3.81% 0:12:22 5.71% 0:24:42 11.40%
subtotal 0:38:09 17.60% 0:59:19 27.37% 1:59:17 55.03%
             
      total   3:36:45  
os linux linux windows
python 3.5 3.6 3.5
total time 0:06:05 0:08:01 0:21:52
git clone 0:00:00 0:00:00 0:00:02
gti submodule update 0:00:00 0:00:00 0:00:02
cache loading 0:00:26 0:00:32 0:00:07
openssl     0:00:55
conda install     0:02:58
conda update 0:00:05 0:00:06 0:00:31
conda info 0:00:00 0:00:00 0:00:00
env create     0:08:10
env update 0:00:06 0:00:07 0:00:06
test 0:04:28 0:06:34 0:08:10
cache update 0:00:04 0:00:05 0:00:12
       
sum 0:05:09 0:07:24 0:21:13
       
before test 0:01:33 0:01:22 0:13:30
test 0:04:28 0:06:34 0:08:10
after test 0:00:04 0:00:05 0:00:12

Docker

  • Todorov describes accelerating Travis-CI using Docker
  • Could be faster
  • Need authentication settings or open the container

Section property DB

  • p. 602~603 properties of metals
  • p. 604~609 properties of H sections
  • p. 610 properties of I sections
  • p. 611 properties of channel sections
  • p. 612~615 properties of angle sections

improve assert lines

If a parameter changes, value-checking asserts would fail.

How to check the architecture?

symbolic? numeric?

sympy? numpy + matplotlib?

sympy calls *.subs(substitution_dictionary) (possibly too) many times

stress distribution accuracy

Some distributions show discontinuous stress distribution but can that be real? (804ad6c)

  • ex05.003 two h : should be more smoother
  • ex05.004 concentrated moment : Concentrated moment is ideal. Discontinuity sort of expected.
  • ex05.007 : shear plane width around flange ~ web joint could be controversial?
  • ex05.010 shear stress

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.