找回密码
 注册
Simdroid-非首页
查看: 200|回复: 7

[图形图像] 为何不能Manipulate ParametricPlot【已解决by Freddy 再次认识语法高亮+module】

[复制链接]
发表于 2009-11-16 14:57:36 | 显示全部楼层 |阅读模式 来自 黑龙江哈尔滨
本帖最后由 TBE_Legend 于 2009-11-17 17:43 编辑


  1. Clear["Global`*"]
  2. Block[{u, k, f, t},
  3. u = 1/15 f \[Pi] Cos[2 f \[Pi] t];
  4. k = 1/10 - 1/30 Sin[2 f \[Pi] t];
  5. Manipulate[
  6. ParametricPlot[{u, k}, {t, 0, 1/f}, AspectRatio -> 1], {f, 0.5, 2}]]

复制代码
 楼主| 发表于 2009-11-16 15:25:02 | 显示全部楼层 来自 黑龙江哈尔滨
Simdroid开发平台

  1. Clear["Global`*"]
  2. (*Block[{u,k,f,t},*)u[f_, t_] := 1/15 f \[Pi] Cos[2 f \[Pi] t];
  3. k[f_, t_] := 1/10 - 1/30 Sin[2 f \[Pi] t];
  4. u = 1/15 f \[Pi] Cos[2 f \[Pi] t];
  5. k = 1/10 - 1/30 Sin[2 f \[Pi] t];
  6. Manipulate[
  7. ParametricPlot[{u[f, t], k[f, t]}, {t, 0, 1/f},
  8.   AspectRatio -> 1], {f, 0.5, 2}]
复制代码


evaluation真是搞得我有点乱,原则是什么呢?
回复 不支持

使用道具 举报

发表于 2009-11-16 15:25:57 | 显示全部楼层 来自 加拿大
本帖最后由 smarten 于 2009-11-16 01:29 编辑
  1. Clear["Global`*"]
  2. With[{ u = 1/15 f \[Pi] Cos[2 f \[Pi] t],
  3.   k = 1/10 - 1/30 Sin[2 f \[Pi] t]},
  4. Manipulate[
  5.   ParametricPlot[{u, k}, {t, 0, 1/f}, AspectRatio -> 1], {f, 0.5, 2}]]
复制代码

  1. Clear["Global`*"]
  2. Block[{}, u[f_Real, t_] := 1/15 f \[Pi] Cos[2 f \[Pi] t];
  3. k[f_Real, t_] := 1/10 - 1/30 Sin[2 f \[Pi] t];
  4. Manipulate[
  5.   ParametricPlot[{u[f, t], k[f, t]} // Evaluate, {t, 0, 1/f},
  6.    AspectRatio -> 1], {f, 0.5, 2}]
复制代码
回复 不支持

使用道具 举报

 楼主| 发表于 2009-11-16 15:30:28 | 显示全部楼层 来自 黑龙江哈尔滨
本帖最后由 TBE_Legend 于 2009-11-16 15:32 编辑
Clear["Global`*"]
With[{ u = 1/15 f \[Pi] Cos[2 f \[Pi] t],
  k = 1/10 - 1/30 Sin[2 f \[Pi] t]},
Manipulate[
  ParametricPlot[{u, k}, {t, 0, 1/f}, AspectRatio -> 1], {f, 0.5, 2}]]
smarten 发表于 2009-11-16 15:25

多谢,对with又有了新的认识。
能否解释下我的第一个帖子中的code的问题出在哪里呢?
为什么其中的k,v不replaced呢?


With[{x=Subscript[x, 0],y=Subscript[y, 0],\[Ellipsis]},expr]
specifies that in expr occurrences of the symbols x, y, \[Ellipsis]  should be replaced by Subscript[x, 0], Subscript[y, 0], \[Ellipsis] .
回复 不支持

使用道具 举报

发表于 2009-11-17 17:14:51 | 显示全部楼层 来自 上海
一般把 Manipulate 放在外面,模块放在里面。

  1. Manipulate[Module[{u, k, t},
  2.   u = 1/15 f \[Pi] Cos[2 f \[Pi] t];
  3.   k = 1/10 - 1/30 Sin[2 f \[Pi] t];
  4.   ParametricPlot[{u, k}, {t, 0, 1/f}, AspectRatio -> 1]], {f, 0.5, 2}]
复制代码
告诉你一个小秘密。

游客,本帖隐藏的内容需要积分高于 20 才可浏览,您当前积分为 0
回复 不支持

使用道具 举报

 楼主| 发表于 2009-11-17 17:37:03 | 显示全部楼层 来自 黑龙江哈尔滨
本帖最后由 TBE_Legend 于 2009-11-17 17:41 编辑
一般把 Manipulate 放在外面,模块放在里面。
Manipulate[Module[{u, k, t},
  u = 1/15 f \[Pi] Cos[2 f \[Pi] t];
  k = 1/10 - 1/30 Sin[2 f \[Pi] t];
  ParametricPlot[{u, k}, {t, 0, 1/f}, AspectRatio - ...
FreddyMusic 发表于 2009-11-17 17:14


Mathematica 的诀窍在于把.....

这诀窍,很精炼,如果你的书都是这些东西的话,1000元一本也很值。
回复 不支持

使用道具 举报

发表于 2009-11-18 14:18:10 | 显示全部楼层 来自 黑龙江大庆
还是无法理解三个模块函数的精髓!
回复 不支持

使用道具 举报

发表于 2011-11-5 15:42:16 | 显示全部楼层 来自 天津
学习一下诀窍。
回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-4-27 00:40 , Processed in 0.041191 second(s), 14 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表