1次元関数
TF1 クラスを使用する
f1 = ROOT.TF1('f1', 'x * sin(x) * exp(-0.1 * x)', -10, 10)
f1.Draw()

2次元関数
TF2 クラスを使用する
f2 = ROOT.TF2('f2', 'abs(sin(x) / x) * y * cos(y)', -5, 5, -5, 5)
f2.Draw("surf")
#f2.Draw("cont1")
#f2.Draw("lego")
f2.Draw("surf")

f2.Draw("cont1")

f2.Draw("lego")

パラメータ付きの関数
パラメータを [0], [1], [2],,, で置き換える
f3 = ROOT.TF1('f3', '[0] + [1] * exp(x)', -5, 5)
// set value of parameters
f3.setParameters(1, 2)
f3.Draw()
fitting にこの関数をつかう場合、設定したパラメータ値が初期値になる
0 件のコメント:
コメントを投稿