damyarou

python, GMT などのプログラム

macOS Big Sur インストール

2020年11月13日 MacBook Pro (Retina, 13-inch, Mid 2014) 今日11月13日、気がついたらMacbookにアップデートの知らせが。なんだろうと思ったらBig Surのアップデートの通知でした。新しもの好きな私は、早速アップデートを実行。流石にメインで使っているiM…

iPad Air 4 のためのグッズ

iPad Air 4のためのグッズが少し揃ってきたので紹介します。こうして並べてみると、結構お金かけているなあ。iPad Airでやりたいことは、主に手書きメモとpdf文書のチェック(赤書き・マーキング)なので、今の所キーボードの購入予定は無しです。キーボード…

iPad Air 4 購入

iPad Air 4 注文 2020年11月1日、iPad Air 10.9インチを、Apple pencil とともに注文しました。iPad Air は、ストレージ64GB、スカイブルーのWi-Fiモデルです。Amazon か Apple store か、どちらに注文するか迷いましたが、Amazon では入荷が不安定のような…

Stability analysis of large dam non-overflow section

Code is shown below. # Concrete gravity dam stability analysis import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as tick #global variants wc=23.5 # unit weight of concrete (kN/m3) ww=10.0 # unit weight of water (k…

Discharge capacity of spillway

Ishii-Fujimoto's formulas are shown below which is described in the Collection of Hydraulic Formulas (JSCE, 1985). For parabolic crest shape, the value of can be obtained as follow. import numpy as np def calc_q(): nsl=np.array([0.85, 0.85…

Hydraulic jump type energy dissipator

import numpy as np def main(): g=9.8 q=42.0 h0=554.1-321.0 v1=26.5 b=4.0 d1=np.round(q/b/v1,decimals=3) fr=np.round(v1/np.sqrt(g*d1),decimals=3) d1d2=np.round(1/2*(np.sqrt(1+8*fr**2)-1),decimals=3) d2=np.round(d1*d1d2,decimals=3) print('v1…

Normal depth of steep channel

(known) discharge (known) width of rectangular open channe (known) Manning's roughness coefficient (known) gradient of channel invert (unknown) normal depth The critical depth of steep channel is calculated as following equation. # normal …

Soil pressure coefficient considering earthquake by Mononobe-Okabe

Active soil pressure coefficient considering earthquake by Mononobe-Okabe can be obtained by following equation. (USACE EM 1110-2-2100 Appendix G) import numpy as np kh=0.077 # horizontal seismic coefficient #kh=0 # horizontal seismic coef…

Python: calculation of required plate thickness of exposed type penstock against buckling pressure by Brent method

A critical buckling pressure of exposed type penstocks can be obtained by following equation. critical buckling pressure of penstock plate thickness excluding corrosion allowance design external diameter elastic modulus of penstock (=206,0…

Non-uniform flow analysis by Python: calculation of water surface frofile of settling basin

A program to calculate water surface profile of settling basin which has an open channel with varied width and varied invert level. Since the condition is subcritical flow, the calculation will be carried out from downstream section to ups…

Python : Calculation of normal depth of open channel with rectangular cross section by 'scipy.optimize.brentq'

Calculation program of normal depth of open channel with rectangular cross sectionby Brent's method is introduced in this post. Basic equations for normal depth calculation of open channel with rectangular cross section are shown below. (k…

Jupyter の ipynb ファイルの中身を見たい

2020.09.20投稿 必要性 Jupyter notebook 上でコードを書いていて、「あのとき作った Jupyter のコードをコピーしたい!」ということがよくある。その ipynb ファイルが、たまたま今開いている Jupyter のディレクトリの下にあればいいのだが、そうでない場…

LG 27インチ4Kディスプレイ購入

9月7日注文、9月8日到着で、LGの27inch 4K display を購入しました。¥57,980也。ちょっと奮発しすぎたか。 4月より在宅勤務しています。会社に行くのは月に2〜3回ですかね。 しかし7月よりお客さんから設計の仕事をいただき、今はかなり忙しい。ま…

Python 逆調整池運用解析修正版(Flood Routine)

逆調整池運用解析プログラムの修正版 関数FLOODの中の収束計算で、前回貯水池水位のみを既知としていたが、本来貯水池水位と放流量はペアなので、前回放流量も既知とした。プログラム作成時になぜ収束計算の中で前回流量を既知として確定していなかったのか…

Relationship between critical depth and discharge coefficient for free overflow on dam spillway

In general, the discharge for free overflow on dam spillway can be expressed as follow: On the other hand, a critical depth of rectangular cross section channel can be expressed as follow: When it is assumed the water depth at the overflow…

Python:計算結果をエクセル出力し加工する(月平均値の算出とエクセル化)

能書き 報告書を作成しているとき、Pythonで計算した結果をWordに表形式で貼り付けたい場合がある。 これが、TeXやhtmlであれば、プロブラム内でタグを埋め込んだ形で標準出力し、コピー&ペーストでTeXもしくはhtml文書に貼り付けるのだが、相手がWordとな…

GraphvizでMLPと通常の重回帰分析のイメージ図を作る

作例 GraphvizでMLPと通常重回帰分析のイメージ図(conceptual diagram あるいは schematic diagram かな)を作ってみた。 作例は以下の通り。 プログラミング環境は以下の通り。 macOS Catalina iMac (Retina 4K, 21.5-inch, 2017) Graphvizのインストール …

Structural design formulas for penstocks embedded in rock

The structural design formulas for penstocks embedded in rock which are shown in 'Technical standards for gates and penstock' in Japan are described. Allowable stresss of steel material Welded joint efficiency Location of welding RT or UT …

Python 岩盤内埋設式水圧鉄管設計プログラム(新版)

はじめに 岩盤内埋設式水圧鉄管プログラムは、過去に一度掲載している(以下参照)。今回のプログラミング内容は工学的には過去のものとダブルが、過去投稿も、エクセルの罫線の書き方やセルの色付などの参考になるため、削除せずにおく。 https://damyarou.…

Python 軸対称応力解析プログラム

はじめに 軸対称モデルとして扱う構造物として、水平トンネルなど水平方向に回転軸を持つ構造物と、調圧水槽など鉛直方向に回転軸を持つ構造物がある。 これまで、四角形要素の2次元応力解析プログラムを軸対称解析用に書き換えたプログラムを使ってきたが…

トランジション(矩形断面から円形断面)での損失水頭

圧力水路の設計をしていると、取水口周辺で矩形断面から円形断面に変化する部分が必要となるが、その時の形状変化による損失(摩擦損失を除く)の計算について書いておく。 これまでは、矩形断面の断面積に等しい等価円を考え、漸縮管の損失水頭として扱って…

パソコン支給

2020年5月21日、会社からノートパソコンというかSurfaceが支給されました、 マシン仕様は以下の通り。 プロセッサ:Intel(R) Core(TM) i5-1035G4 CPU @ 1.10GHz 1.50 実装RAM:8GB OS:Windows 10 Pro ストレージ:SSD128GB 支給日の木曜日と金曜日は忙しか…

Python 表付きグラフ(効率カーブ)

簡単な表と一体化した画像を作った。 作例 このグラフにおけるTips 作図領域を上下に分ける drawfig1() は下側のグラフ(作図領域の下側70%)、```drawfig2()''' は上川の表を描画する。 plt.axes((0.0, 0.0, 1.0, 0.7)); drawfig1() plt.axes((0.0, 0.7, 1.…

Python 月次・年次データ集計(雨量)

日雨量を月・年毎に合計したもの。 各月の雨量の単位は mm/momth (月累計雨量)、 各年の雨量の単位は mm/year(年累計雨量)である。 #============================== # Rainfall # Dayly => Monthly, Yearly data #============================== impor…

Python 月次及び年次データ集計(流量)

概要 日平均流量の月次および年次データ集計のプログラム。 ここでは流量の集計を行い、月平均・年平均を算出している。 年平均は、「月平均の平均」ではなく、「1年間全データの平均」としている。 これは365日の流況図から出した年平均と数値を合わせるた…

Python バージョンを入れ替える(Mac)

2020年4月27日、Pythonは3.8.1を入れていたが、3.8.2にしてみた。 Pythonと関連ライブラリのインストールはpyenvとpipのみで行っている。 目的はPythonのバージョンを変えるだけなので、.zshrcに記載しているパスや、Jupyterの設定は変更しない。もちろんこ…

流況曲線作図(改訂版)

流況曲線作図プログラムを(自分にとって)少しわかりやすくしたのでアップ。 対象期間内に欠測はないことを前提にしている。 import numpy as np import pandas as pd import datetime import matplotlib.pyplot as plt from scipy import interpolate def …

VS code と BasicTeX 2020 をインストール

2020年4月12日、最近話題のVS codeをインストール。また、BasicTeX 2020もインストール。 BasicTeXは、2019がインストールしてあったので、まずこれを削除。 また、which ghostscript しても、なぜだか「見つからない」と言われるので、再インストール。 Bas…

matplotlibで使える色一覧

色一覧 画像作成プログラム import matplotlib import colorsys import matplotlib.pyplot as plt from matplotlib import rcParams rcParams['font.family'] = 'Ricty Diminished' def penc(hval): r=int(hval[1:3],16) g=int(hval[3:5],16) b=int(hval[6:8…

流況曲線と運転パターン図

はじめに 同じような図は何回か作成しているのだが、また必要になったため、新しく作り直した。 最新版のプログラムをアップしておく。 成果図 プログラム import numpy as np import pandas as pd import datetime import matplotlib.pyplot as plt def rda…