Mathematica 中的反三角函数范围

发布于 2024-11-28 09:23:19 字数 326 浏览 3 评论 0原文

让我们假设所有数字都是真实。我试图在mathematica中获取一个区间内ArcSin所有值。特别是,mathematica 中 ArcSin 的正常行为是 ArcSin[x] 位于 [-Pi/2,Pi/2] 区间内每当 x[-1,1] 区间内为实数时。

但是,我需要获取每个 x[0,2 Pi] 间隔中的所有角度,如上所述。有办法实现这一点吗?

Let us assume that all numbers are real. I'm trying to obtain in mathematica all values of ArcSin in an interval. In particular, the normal behavior of ArcSin in mathematica is that ArcSin[x] is in [-Pi/2,Pi/2] interval whenever x is real in [-1,1] interval.

However, I need to obtain all the angles in [0,2 Pi] interval for every x as above. Is there a way to achieve this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

南渊 2024-12-05 09:23:19

Leonid 的答案中隐含的是公式

In[1]:= Reduce[Sin[x] == y, x]
Out[1]= (x == ArcSin[y] + 2*Pi*C[1] || x == Pi - ArcSin[y] + 2*Pi*C[1]) && Element[C[1], Integers]

上述,但更好

从上面两个无限家族解决方案,您可以找到对于任何给定的 y 和可接受的 x 范围满足 y = sin(x) 的角度(请参阅 Leonid 的回答,其中,每次调用时,都会生成上述内容以及额外条件 start <= x <= end 并吐出 x 的所有解决方案。)

显式公式为x 值范围 [0,请

In[2]:= Reduce[Sin[x] == y && 0 <= x < 2 Pi, x]

Out[2]=    (y == -1 && x == (3 Pi)/2) 
        || (y == 1 &&  x == Pi/2) 
        || (-1 < y < 1 && x == Pi - ArcSin[y]) 
        || (-1 < y < 0 && x == ArcSin[y] + 2 Pi) 
        || (0 <= y < 1 && x == ArcSin[y])

注意,前两行是边缘值,中间的线取自上述无限解的一个族,最后两行放在一起取自另一族的解。这与狮子座的评论一致:

对于 Sin 的正值(输入,例如 x),您有 ArcSin[x]Pi >
-ArcSin[x],而对于 x 的负值,则有 Pi - ArcSin[x]
2 Pi + ArcSin[x]

上述公式假定 ArcSin 的主值。


主值

在任何 2 pi 周期内,对于给定的 ySin[x] == y 有两种解决方案。从 Sin[x](2 pi 周期)的图表中可以明显看出这一点

sin(x )==y

拥有唯一的反函数 x = ArcSin[y] 您需要选择您想要的特定解决方案(从两个无限系列中)。 Mathematica 选择标准范围 -Pi/2 < x < Pi/2。这个选择(按照惯例)是反三角函数

反函数

Implicit in Leonid's answer is the formula

In[1]:= Reduce[Sin[x] == y, x]
Out[1]= (x == ArcSin[y] + 2*Pi*C[1] || x == Pi - ArcSin[y] + 2*Pi*C[1]) && Element[C[1], Integers]

the above, but nicer

From the two above infinite families of solutions, you can find the angles satisfying y = sin(x) for any given y and range of acceptable x (See Leonid's answer, which, every time it's called, generates the above along with the extra condition start <= x <= end and spits out all solutions for x.)

The explicit formula for x values in the range [0, Pi) is

In[2]:= Reduce[Sin[x] == y && 0 <= x < 2 Pi, x]

Out[2]=    (y == -1 && x == (3 Pi)/2) 
        || (y == 1 &&  x == Pi/2) 
        || (-1 < y < 1 && x == Pi - ArcSin[y]) 
        || (-1 < y < 0 && x == ArcSin[y] + 2 Pi) 
        || (0 <= y < 1 && x == ArcSin[y])

Note that the first two lines are the edge values, the middle line is taken from one family of the above infinite solutions and the last two lines taken together are from the other family of solutions. This agrees with Leonids comment:

for positive values of Sin (inputs, say x), you have ArcSin[x] and Pi
-ArcSin[x], while for negative values of x you have Pi - ArcSin[x]
and 2 Pi + ArcSin[x].

The above formulae assume the principal value for ArcSin.


Principal Value

In any 2 pi period, there are two solutions to Sin[x] == y for a given y. This is obvious from the graph for Sin[x] (which is 2 pi periodic)

sin(x)==y

To have a unique inverse function x = ArcSin[y] you need to choose which particular solution (out of the two infinite families) you want. Mathematica chooses the standard range -Pi/2 < x < Pi/2. This choice is (by convention) the principal value of the inverse trigonometric function

inverse function

一个人的旅程 2024-12-05 09:23:19

您可以尝试如下操作:

Clear[getAngles];
getAngles[x_, interval : {start_, end_} : {0, 2 Pi}] :=
Module[{y},
  Quiet@Cases[
     Reduce[#, y] & /@ 
       LogicalExpand[
         Reduce[Reduce[Sin[y] == x, y] && start <= y < end, y]], (y == 
     yrhs_?NumericQ) :> yrhs, {2}]]

例如:

In[90]:= getAngles[0.7]

Out[90]= {0.775397, 2.3662}

In[92]:= {#, Sin[#]} & /@ getAngles[0.7, {0, 4 Pi}]

Out[92]= {{0.775397, 0.7}, {2.3662, 0.7}, {7.05858, 0.7}, {8.64938, 0.7}}

You can try something like the following:

Clear[getAngles];
getAngles[x_, interval : {start_, end_} : {0, 2 Pi}] :=
Module[{y},
  Quiet@Cases[
     Reduce[#, y] & /@ 
       LogicalExpand[
         Reduce[Reduce[Sin[y] == x, y] && start <= y < end, y]], (y == 
     yrhs_?NumericQ) :> yrhs, {2}]]

For example:

In[90]:= getAngles[0.7]

Out[90]= {0.775397, 2.3662}

In[92]:= {#, Sin[#]} & /@ getAngles[0.7, {0, 4 Pi}]

Out[92]= {{0.775397, 0.7}, {2.3662, 0.7}, {7.05858, 0.7}, {8.64938, 0.7}}
以可爱出名 2024-12-05 09:23:19

你不能。正如您所知,ArcSinSin 函数的反函数,该函数在 [0,2 Pi] 范围内不是双射的。此范围内的某些 x 值会产生相同的 Sin 值(例如,Sin[3/4 [Pi]] == Sin[1/4 [Pi]]),因此您不能扭转这个过程。

您可以在绘图中获得的最接近的结果类似于:

ParametricPlot[{Sin[x], x}, {x, 0, 2 \[Pi]},
   Ticks -> {Automatic, (Range[0, 8] \[Pi]/4)}]
]

在此处输入图像描述

[https://i.sstatic.net /Jcqxy.png">

You can't. ArcSin, as you will be well aware of, is the inverse function of the Sin function which isn't bijective in the range [0,2 Pi]. Some of the x values in this range yield the same Sin value (e.g., Sin[3/4 [Pi]] == Sin[1/4 [Pi]]), so you can't reverse this process.

The closest you can get in plotting would be something like:

ParametricPlot[{Sin[x], x}, {x, 0, 2 \[Pi]},
   Ticks -> {Automatic, (Range[0, 8] \[Pi]/4)}]
]

enter image description here

[https://i.sstatic.net/Jcqxy.png">

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文