2021-03-31から1日間の記事一覧

pythonで関数のフィッティング

多項式で近似する場合 numpyの機能で実行できます。 import numpy as np x = np.arange(0, 1000, 1) y_target = xxx ndim = 3 # Coeffs=np.polyfit(x,y_target,3) # plt.plot( x, np.poly1d(Coeffs)(x) ) 一般の関数で近似する場合 scipyのoptimize, curve_f…

OpenFOAM【物性の温度依存性の設定1】

chtMultiFegionFoam中で固体(solid)の物性の温度依存性を反映させるのが目的。熱伝導率(transport)、比熱(thermo)の温度依存性を考慮できます。thermophysicalPropertiesが設定ファイル。まずは、thermoTypeで関数の指定。 thermoType { type heSolidT…