注册 登录
Simwe仿真论坛(forum.simwe.com),CAE/CAD/CAM/,FEA/FEM/有限元分析论坛---(手机验证注册) 返回首页

TBE_Legend的个人空间 https://home.simwe.com/?355196 [收藏] [复制] [分享] [RSS]

日志

are dummy variables are relly dummy in mmtc?

已有 275 次阅读2009-12-26 16:06 |个人分类:mmtc_maple

In[1]:= g[x_] := Integrate[f[s] s^x, {s, 0, 1}]
g[x_] := h[f[s] s^x, {s, 0, 1}]
g[x_] := h[f[s] s^x]
g[a]
g[s]
Out[4]= h[s^a f[s]] (* This is what we want *)
Out[5]= h[s^s f[s]] (* This is not what we expect *)
 
Then How to handle this kind of situation? Module it ! mmtc then automatically rename the inside dummy variables with same names as outside.
 
q[i_] := Module[{j}, a[i, j] b[j]]
In[7]:= q[i1] q[i2]
Out[7]= a[i1, j$513] a[i2, j$514] b[j$513] b[j$514]

路过

雷人

握手

鲜花

鸡蛋

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 注册

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

GMT+8, 2024-3-29 06:53 , Processed in 0.022024 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

返回顶部