How do I use acot(x) as a continuous function in matlab?

3 ビュー (過去 30 日間)
Michael Pegis
Michael Pegis 2021 年 2 月 3 日
コメント済み: Michael Pegis 2021 年 2 月 8 日
Hi All,
I tried searching for answers about this, but I am trying to model a chemical system by defining a potential energy surface that is the product of two functions weighted by their probability, e.g.
F(x,y) = f1(x,y)*n(x,y) + f2(x,y)*(1-n(x,y))
where n is my switching function (should scale between 0 and 1)
The problem is, the literature I am using is using 1/(pi)*acot(x) as the switching function. It looks like the default setting in matlab is to define the acot(x) in the domain where it is a discountinuous function (rather than starting from 0 to Pi as input domain for the inverse).
How do I use acot(x) as a continuous function in matlab?
For additional context you can see this link https://www.intmath.com/blog/mathematics/which-is-the-correct-graph-of-arccot-x-6009

採用された回答

David Goodmanson
David Goodmanson 2021 年 2 月 4 日
編集済み: David Goodmanson 2021 年 2 月 4 日
Hi Michael,
I believe that
1/2 - (1/pi)*atan(x)
fills the bill. It's the same as (1/pi)*acot(x) for x>0 and is continuous, with range 0 to 1.
  1 件のコメント
Michael Pegis
Michael Pegis 2021 年 2 月 8 日
Hi David,
Thanks so much! That seems to work great

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by