【问题标题】:How to adjust manipulate output in mathematica?如何调整mathematica中的操作输出?
【发布时间】:2012-01-09 06:09:20
【问题描述】:

是否可以调整操纵选项,使这个公式写成标准形式:5 Cos(2x + 1.85982),我的意思是括号内先写x,然后写相位。

还有一种方法可以用 Pi 来写这个相位,因为我认为学生以熟悉的 Pi/2 形式看到相位比 1.5708 更有意义。

感谢您的任何建议和回答。

这是我使用的代码:

Manipulate[
     Plot[A Cos[\[Omega] t + \[Phi]], {t, -4 Pi, 4 Pi}, AspectRatio -> 1, PlotRange -> 10], 
     Dynamic[A Cos[\[Omega] x + \[Phi]]], {{A, 5}, 1, 10, 1, Appearance -> "Labeled"}, 
     {\[Omega], 1, 5, 1, Appearance -> "Labeled"}, 
     {\[Phi], 0, 2 Pi, Appearance -> "Labeled"}]

【问题讨论】:

    标签: wolfram-mathematica


    【解决方案1】:

    也许你可以做一些类似的事情

    Manipulate[
     Plot[A Cos[\[Omega] t + \[Phi]], {t, -4 Pi, 4 Pi}, AspectRatio -> 1, PlotRange -> 10], 
     Pane[Dynamic[A Cos[Row[{\[Omega] x, "+", \[Phi]}]]], {100, 30}],
     {{A, 5}, 1, 10, 1, Appearance -> "Labeled"},
     {\[Omega], 1, 5, 1, Appearance -> "Labeled"}, 
     {\[Phi], 0, 2 Pi, Pi/10, Appearance -> "Labeled"}]
    

    截图:

    【讨论】:

      【解决方案2】:

      在实践中,人们更喜欢连续控制相位和幅度。因此,为了达到预期的结果,我们添加了一个可能需要的技巧,通过使用 HoldForm[expr] 防止评估 expr

      Manipulate[ 
          Plot[A Cos[\[Omega] t + \[Phi]], {t, -4Pi, 4Pi}, AspectRatio -> 1, PlotRange -> 10],
          Pane[Dynamic[ A Cos[Row[{ \[Omega] x, "+", \[Phi]/Pi  HoldForm[Pi]}]]], {150, 30}],
          {{A, 5}, 1, 10, Appearance -> "Labeled"}, 
          {\[Omega], 0.1, 5, Appearance -> "Labeled"},
          {\[Phi]  , 0, 2 Pi, Appearance -> "Labeled"}]
      

      【讨论】:

      • 感谢您分享此技巧 :) 如果有人尝试此操作,他可能会遇到公式(请参阅相关图片中的公式是什么)可能不会像我一样完全可见的问题。为了解决这个问题,我只是通过改变 Pane[______, {150,30}] 中的尺寸来让它更大。我已将其更改为 {170,30}.. 效果很好
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-05-18
      • 2011-09-02
      • 2011-07-11
      • 1970-01-01
      • 2012-09-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多