<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Mathematica 问答社区 - 其它 中最新问题</title>
<link>https://mmaqa.com/qa/questions/%E5%85%B6-%E5%AE%83</link>
<description>Powered by Question2Answer</description>
<item>
<title>如何对某个特定函数的积分定义规则，用于复杂表达式的简化</title>
<link>https://mmaqa.com/qa/2800/</link>
<description>

&lt;p&gt;我在学习傅里叶级数，想做变量替换，达到以下效果：&lt;/p&gt;

&lt;p&gt;给出f[t]的傅里叶级数的一种定义形式，然后想通过变量替换，看看他能否转换成其它形式。&lt;/p&gt;

&lt;p&gt;谢谢！&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;pre data-pbcklang=&quot;prettyprint lang-mma&quot; data-pbcktabsize=&quot;4&quot; class=&quot;prettyprint lang-prettyprint lang-mma&quot;&gt;Remove[&amp;quot;Global`*&amp;quot;] // Quiet;
(*尝试1*)
(*f/:Integrate[f[t]E^(-I k_ t_),{t_,-Pi,Pi}]:=2Pi \
F[x]/;IntegerQ[k]*)

(*尝试2*)
(*f/:Integrate[f[t_]E^(-I k t_),t_]/;IntegerQ[k]:=2Pi F[t]*)

(*尝试3*)
rule[x_] := 
 x //. {Integrate[f[t_] E^(-I k t_), {t_, -Pi, Pi}] /; IntegerQ[k] :&amp;gt; 
    2 Pi F[t]}

(*尝试4*)
rule[x_] := 
 x //. {Integrate[f[t_] E^(-I k t_), t] /; IntegerQ[k] :&amp;gt; F[t]}

1/(2 Pi) Integrate[f[x] E^(-I k t), {x, -Pi, Pi}, 
   Assumptions -&amp;gt; k \[Element] Integers] // rule&lt;/pre&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/2800/</guid>
<pubDate>Mon, 10 Jan 2022 08:11:54 +0000</pubDate>
</item>
<item>
<title>什么是poisson kernel？谢谢</title>
<link>https://mmaqa.com/qa/2666/poisson-kernel</link>
<description>某篇论文提到了poisson kernel，网上并未找到相关资料。</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/2666/poisson-kernel</guid>
<pubDate>Tue, 12 Nov 2019 05:35:17 +0000</pubDate>
</item>
<item>
<title>能不能自己创建一个字符，这个字符看起来特别像下划线？这样就可以用这个字符代替下划线了</title>
<link>https://mmaqa.com/qa/2638/</link>
<description>自定义变量时，经常想用下划线，但是下划线是mmtc中模式的内置字符。所以就特想自己造一个字符看起来想下划线。&lt;br /&gt;
&lt;br /&gt;
就像输入面板中有个很像 梯度算子的那个字符，但它只是一个普通的字符，并不是mmtc内置的梯度算子。&lt;br /&gt;
&lt;br /&gt;
谢谢！</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/2638/</guid>
<pubDate>Thu, 17 Oct 2019 00:23:07 +0000</pubDate>
</item>
<item>
<title>【纯小白】含参数二元函数最大值求解提示电脑内存不足，请问该怎么解决？</title>
<link>https://mmaqa.com/qa/2618/</link>
<description>

&lt;p&gt;纯小白，第一次用mathematica，还处在学习和摸索阶段。目的是求基于霍特林模型的双边市场利润最大化下的市场平衡，s是补贴，p是价格，代码如下&lt;/p&gt;

&lt;pre data-pbcklang=&quot;prettyprint lang-mma&quot; data-pbcktabsize=&quot;4&quot; class=&quot;prettyprint linenums lang-prettyprint lang-mma&quot;&gt;Maximize[(T + p*a*(d/2)/(a*b*(2*c + 2*s)*(2*p - 2*v) + d))/2 + (Y - s*b/2)*(d/2)/(a*b*(2*c + 2*s)*(2*p - 2*v) + d), {s, p}]&lt;/pre&gt;

&lt;p&gt;运行后很长时间得不到结果，电脑（4g内存）提示内存不足，请问我该怎么处理？&lt;/p&gt;

&lt;p&gt;希望各位大佬不吝赐教，感谢！&lt;/p&gt;</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/2618/</guid>
<pubDate>Sun, 04 Aug 2019 05:22:07 +0000</pubDate>
</item>
<item>
<title>程序跑并行时如何监控进度（程序优化）</title>
<link>https://mmaqa.com/qa/2597/</link>
<description>

&lt;p&gt;因为程序跑的比较费时，所以想要监控下进度预估所需的时间，如果并行同时输出已跑的结果最好。需要优化的是最后的一个命令&lt;/p&gt;

&lt;p&gt;程序&lt;a rel=&quot;nofollow&quot; href=&quot;https://privatebin.net/?b88cf8000331a70f#ILQHMYqgdttw4ZrGi5lyLJ8mKP/p9fDod4wPCH0i3NY=&quot;&gt;https://privatebin.net/?b88cf8000331a70f#ILQHMYqgdttw4ZrGi5lyLJ8mKP/p9fDod4wPCH0i3NY=&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/2597/</guid>
<pubDate>Fri, 19 Apr 2019 02:17:35 +0000</pubDate>
</item>
<item>
<title>请问如何配置sublime text 3 来运行Mathematica？</title>
<link>https://mmaqa.com/qa/2459/sublime-text-3-mathematica</link>
<description>使用的插件是WolframLanguage.</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/2459/sublime-text-3-mathematica</guid>
<pubDate>Tue, 19 Jun 2018 01:15:22 +0000</pubDate>
</item>
<item>
<title>mathematica安装问题</title>
<link>https://mmaqa.com/qa/2456/mathematica</link>
<description>我的mathematica的安装目录文件名被我修改了以后，该软件就没有办法运行。我将其卸载以后在次安装，居然安装不上去。谁可以教我怎么去解决啊？在下先谢谢大家了！！！&lt;br /&gt;
&lt;br /&gt;
提示信息如下：&lt;br /&gt;
&lt;br /&gt;
1、Error:-1603 Fatal error during installation.&lt;br /&gt;
&lt;br /&gt;
Consult Windows Installer Help (Msi.chm) or MSDN for more information.&lt;br /&gt;
&lt;br /&gt;
2、Setup could not find a file on the specified path or disk.&lt;br /&gt;
&lt;br /&gt;
Please check that the proper disk in inserted or specify a new path.&lt;br /&gt;
&lt;br /&gt;
Unable to locate file&lt;br /&gt;
&lt;br /&gt;
C;\Users\lenovo\AppData\Local\Temp\pfrFB90.tmp\Mathematica5.msi.&lt;br /&gt;
&lt;br /&gt;
3、Error 1706.NO valid source could be found for product Mathematica 5. The Windows Installer cannot contineuse.</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/2456/mathematica</guid>
<pubDate>Sun, 03 Jun 2018 14:16:43 +0000</pubDate>
</item>
<item>
<title>理论物理：爆炸同步</title>
<link>https://mmaqa.com/qa/2403/</link>
<description>有没有大神做过关于爆炸同步的问题，求指导。。。。。</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/2403/</guid>
<pubDate>Mon, 12 Mar 2018 21:33:16 +0000</pubDate>
</item>
<item>
<title>怎样让旋转变换默认在实数域内进行？</title>
<link>https://mmaqa.com/qa/2286/</link>
<description>RotationTransform[\[Theta], {m, n, l}][{x, y, z}]&lt;br /&gt;
&lt;br /&gt;
结果会出现Abs, Conjugate 等函数&lt;br /&gt;
&lt;br /&gt;
怎样让旋转变换在实数域内进行？</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/2286/</guid>
<pubDate>Sat, 20 Jan 2018 11:35:30 +0000</pubDate>
</item>
<item>
<title>圆锥与平面相交的参数方程</title>
<link>https://mmaqa.com/qa/2285/</link>
<description>

&lt;p&gt;比如 x^2 + y^2 == z^2, z - z0 - y Tan[&amp;theta;] == 0
&lt;br&gt;
简单的方法是联立方程求解得到参数方程，但是这样得到的曲线分为两部分了，借助三角函数其实是可以合成一部分的。
&lt;br&gt;
观察这两个例子：&lt;/p&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
{ParametricPlot3D[{x,y,z}/.Solve[{x^2+y^2==z^2,z-z0-y Tan[&amp;theta;]==0}/.{z0-&amp;gt;1/2,&amp;theta;-&amp;gt;Pi/3},{y,z}]//Evaluate,{x,-2,2}],
ParametricPlot3D[{Sqrt[1/8]Tan[t],1/4 (-Sqrt[3]+Sec[t]),1/4 (-1+Sqrt[3] Sec[t])},{t,0,2Pi}]}

{ParametricPlot3D[{x,y,z}/.Solve[{x^2+y^2==z^2,z-z0-y Tan[&amp;theta;]==0}/.{z0-&amp;gt;1/3,&amp;theta;-&amp;gt;Pi/6},{y,z}]//Evaluate,{x,-2,2}],
ParametricPlot3D[{Sqrt[1/6]Cos[t],1/6 (Sqrt[3]-3 Sin[t]),1/6 (3-Sqrt[3] Sin[t])},{t,0,2Pi}]}&lt;/pre&gt;



&lt;p&gt;
&lt;br&gt;
&lt;img alt=&quot;&quot; src=&quot;https://mmaqa.com/qa/?qa=blob&amp;amp;qa_blobid=6111693996373769044&quot; style=&quot;height:728px; width:758px&quot;&gt;
&lt;br&gt;

&lt;br&gt;
我想得到通用的参数方程（含&amp;theta;和z0的），不要分成两部分的，没想到怎么写出来。&lt;/p&gt;



&lt;p&gt;好吧，这其实更像是个数学问题&lt;/p&gt;</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/2285/</guid>
<pubDate>Thu, 11 Jan 2018 12:32:05 +0000</pubDate>
</item>
<item>
<title>数值积分结果含怎么会有虚数？</title>
<link>https://mmaqa.com/qa/2220/</link>
<description>

&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
v11[x_, \[Delta]_, p1_, b11_] := -2 - b11 + (-1 + x)/x + 2 b11 x + 
  2 x^2 - b11 x^4 - 1/3 p1*\[Delta] (-1 + x^3) - (
  1 - 1/(x^3 (1 + \[Delta])^3 - \[Delta] (3 + \[Delta] (3 + \
\[Delta])))^(1/3))/(1 + \[Delta])^3 - (
  2 b11 (-1 + (x^3 (1 + \[Delta])^3 - \[Delta] (3 + \[Delta] (3 + \
\[Delta])))^(1/3)))/(1 + \[Delta])^3 - (
  2 (-1 + (x^3 (1 + \[Delta])^3 - \[Delta] (3 + \[Delta] (3 + \
\[Delta])))^(2/3)))/(1 + \[Delta])^3 + (
  b11 (-1 + (x^3 (1 + \[Delta])^3 - \[Delta] (3 + \[Delta] (3 + \
\[Delta])))^(4/3)))/(1 + \[Delta])^3
F[x_, \[Delta]_] := ((1/((1 + \[Delta])^3*x^3) - x^(-3) + 1)^(-1/3) - 
    1) x
plist = Range[2.5, 3, 0.01];
Tlist = Table[sol = NSolve[v11[x, 0.01, p, 0.1] == 0 &amp;amp;&amp;amp; x &amp;gt; 0, x];
  xa = x /. sol[[-1]];
  xb = x /. sol[[-2]];
  2*NIntegrate[(-1/2 x^2*F[x, 0.01]/v11[x, 0.01, p, 0.1])^(1/2), {x, 
     xa, xb}], {p, plist}]&lt;/pre&gt;



&lt;p&gt;运行结果&lt;/p&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
{2.50447, 2.53123, 2.55932, 2.58889, 2.62006, 2.65303, 2.688, 2.7252, \
2.76494, 2.80755, 2.85346, 2.90318, 2.95738, 3.01689, 3.0828, \
3.15656, 3.2402, 3.33662, 3.45019 + 5.34044*10^-7 I, 
 3.588 + 1.39994*10^-6 I, 3.76257 + 0.0000103213 I, 3.99962, 
 4.36644 + 4.58063*10^-6 I, 5.18809, 
 11.6708 + 0.00676701 I, 10.0829, 9.32563, 8.81796, 8.43657, 
 8.13567 + 0.000708948 I, 7.87621, 7.65394, 7.46839, 
 7.3056 + 0.015269 I, 7.1488, 7.01832, 6.89796 + 0.0106327 I, 6.77468,
  6.67698 + 0.00628891 I, 6.57456 + 0.00942845 I, 
 6.48188 + 0.0125146 I, 6.3876, 6.31884 + 0.0164423 I, 6.22926, 
 6.16198 + 0.0274216 I, 6.09393 + 0.0154801 I, 6.00774, 
 5.96437 + 0.0307611 I, 5.88839 + 6.77018*10^-7 I, 
 5.85019 + 0.00723323 I, 5.79512 + 0.00635796 I}&lt;/pre&gt;



&lt;p&gt;并有一系列错误提示。&lt;/p&gt;</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/2220/</guid>
<pubDate>Mon, 23 Oct 2017 13:42:55 +0000</pubDate>
</item>
<item>
<title>一个很难替换的函数名</title>
<link>https://mmaqa.com/qa/2168/</link>
<description>

&lt;p&gt;在 Mathematica 中，一般的函数名（头部）都可以用 /. 来替换，有时需要加上此函数不做运算的限定，比如：&lt;/p&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
mm01=Graphics[Circle[]];
mm01/.(Graphics-&amp;gt;ff)&lt;/pre&gt;



&lt;p&gt;其结果是：&lt;/p&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
ff[Circle[{0,0}]]&lt;/pre&gt;



&lt;p&gt;但 MeshRegion 这个函数这样替换就不行：&lt;/p&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
mm02=MeshRegion[{{0},{1}},{Point[{{1},{2}}]}];
mm02/.MeshRegion-&amp;gt;ff&lt;/pre&gt;



&lt;p&gt;结果仍然是mm02本身，根本没有任何替换。&lt;/p&gt;



&lt;p&gt;如果换种写法：&lt;/p&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
Unevaluated[mm02]/.MeshRegion-&amp;gt;ff&lt;/pre&gt;



&lt;p&gt;一样不行。&lt;/p&gt;



&lt;p&gt;所以这个 MeshRegion 还真是怪异。&lt;/p&gt;



&lt;p&gt;谁可以解释一下并给出个办法完成替代？&lt;/p&gt;



&lt;p&gt;【 注：在第二个代换那行代码中，如果直接用mm02的表达式是可以成功替换的；但这里要求只能使用符号mm02。】&lt;/p&gt;</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/2168/</guid>
<pubDate>Sun, 27 Aug 2017 13:38:39 +0000</pubDate>
</item>
<item>
<title>模式匹配成功，却没被应用！</title>
<link>https://mmaqa.com/qa/1938/</link>
<description>

&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
In[87]:= Unprotect[Times];
Times[f[t_]/t_, x___] := Times[x]
f[t]/(a c t)
MatchQ[f[t]/(a c t), Times[f[t_]/t_, x___]]

Out[89]= f[t]/(a c t)

Out[90]= True&lt;/pre&gt;



&lt;p&gt;
&lt;br&gt;
如上代码所示，模式匹配成功了，却还保持原值不变！\(\frac{f(t)}{a c t}\)应化简为为\(\frac{1}{a c}\)才对！&lt;/p&gt;</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/1938/</guid>
<pubDate>Tue, 06 Jun 2017 15:54:33 +0000</pubDate>
</item>
<item>
<title>怎么利用已知表达式对运算结果按照预定的方向进一步化简？</title>
<link>https://mmaqa.com/qa/1928/</link>
<description>

&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
r[t] = (R^3 + b[t]^3 - B^3)^(1/3);
r2 = D[r[t], {t, 2}] // Simplify&lt;/pre&gt;



&lt;p&gt;结果为
&lt;br&gt;
&lt;img alt=&quot;&quot; src=&quot;https://mmaqa.com/qa/?qa=blob&amp;amp;qa_blobid=3851726191637558795&quot; style=&quot;height:57px; width:480px&quot;&gt;&lt;/p&gt;



&lt;p&gt;预期结果为&lt;/p&gt;



&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;https://mmaqa.com/qa/?qa=blob&amp;amp;qa_blobid=7398562428971788634&quot; style=&quot;height:51px; width:435px&quot;&gt;&lt;/p&gt;



&lt;p&gt;我希望利用r[t] = (R^3 + b[t]^3 - B^3)^(1/3)这个表达式消去B，R&lt;/p&gt;



&lt;p&gt;使得结果里只含有r[t]和b[t]&lt;/p&gt;



&lt;p&gt;请问该怎么做？&lt;/p&gt;</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/1928/</guid>
<pubDate>Sun, 04 Jun 2017 03:05:11 +0000</pubDate>
</item>
<item>
<title>mma中化学常数的获取</title>
<link>https://mmaqa.com/qa/1806/mma</link>
<description>在做计算的时候，需要用到一下阿伏伽德罗常数，我该怎么才能从软件中得到这个数据。</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/1806/mma</guid>
<pubDate>Sun, 19 Mar 2017 12:56:36 +0000</pubDate>
</item>
<item>
<title>生成一个manipulate，创建5到50之间等间隔的色相值列表。P36-9.7。</title>
<link>https://mmaqa.com/qa/1787/manipulate550-p36-9-7</link>
<description>生成一个manipulate，创建5到50之间等间隔的色相值列表。Wolfram语言入门 P36-9.7。语文差没读懂</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/1787/manipulate550-p36-9-7</guid>
<pubDate>Wed, 15 Mar 2017 09:03:01 +0000</pubDate>
</item>
<item>
<title>为什么分段函数编译效果下降了</title>
<link>https://mmaqa.com/qa/1747/</link>
<description>

&lt;p&gt;有一个分段函数，每段编译之后速度将近是原函数的十倍，然后打包成一个完整的分段函数（也编译的），速度只有原函数的一半了，折腾了半天只有这么点效果，好难过啊。&lt;/p&gt;



&lt;p&gt;下面用一个类似的例子说明，每段编译后速度是原函数的5倍左右，打包后比原函数还慢了。&lt;/p&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
f1[x_] := Sin[x] + x^2 - 1/(1 + x);
f2[x_] := Sin[x] - x^2 - 1/(1 + x);
f3[x_] := Sin[x] - x^2 + 1/(1 + x);
cf1 = Compile[{{x, _Real}}, Sin[x] + x^2 - 1/(1 + x)];
cf2 = Compile[{{x, _Real}}, Sin[x] - x^2 - 1/(1 + x)];
cf3 = Compile[{{x, _Real}}, Sin[x] - x^2 + 1/(1 + x)];
Do[f1[0.01], {10^6}]; // AbsoluteTiming
Do[cf1[0.01], {10^6}]; // AbsoluteTiming
Do[f2[0.01], {10^6}]; // AbsoluteTiming
Do[cf2[0.01], {10^6}]; // AbsoluteTiming
Do[f3[0.01], {10^6}]; // AbsoluteTiming
Do[cf3[0.01], {10^6}]; // AbsoluteTiming&lt;/pre&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
{2.554146, Null}
{0.448026, Null}
{2.836162, Null}
{0.462026, Null}
{2.487142, Null}
{0.440025, Null}&lt;/pre&gt;



&lt;p&gt;合并之后，&lt;/p&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
f[x_] := Which[x &amp;gt; 0, Sin[x] + x^2 - 1/(1 + x),
              -1 &amp;lt; x &amp;lt;= 0, Sin[x] - x^2 - 1/(1 + x),
              x &amp;lt;= -1, Sin[x] - x^2 + 1/(1 + x) ];
cf = Compile[{{x, _Real}}, Which[x &amp;gt; 0, Sin[x] + x^2 - 1/(1 + x),
                                -1 &amp;lt; x &amp;lt;= 0, Sin[x] - x^2 - 1/(1 + x),
                                x &amp;lt;= -1,  Sin[x] - x^2 + 1/(1 + x) ]];
Do[f[0.01], {10^6}]; // AbsoluteTiming
Do[cf[0.01], {10^6}]; // AbsoluteTiming&lt;/pre&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
{4.692268, Null}
{7.180411, Null}&lt;/pre&gt;



&lt;p&gt;难道是因为which吗，which也在可编译函数这中啊，这可怎么办啊。&lt;/p&gt;</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/1747/</guid>
<pubDate>Sun, 12 Mar 2017 14:45:59 +0000</pubDate>
</item>
<item>
<title>Wolfram知识库可以通过应用程序来访问吗。data drop可以在非wolfram cloud的其他云计算平台上创建吗。</title>
<link>https://mmaqa.com/qa/1741/wolfram-dropwolfram-cloud</link>
<description>关于wolfram。data drop的问题</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/1741/wolfram-dropwolfram-cloud</guid>
<pubDate>Fri, 10 Mar 2017 05:57:58 +0000</pubDate>
</item>
<item>
<title>求历史相关的未知量的小程序，能否优化</title>
<link>https://mmaqa.com/qa/1705/</link>
<description>

&lt;p&gt;问题简介：&lt;/p&gt;



&lt;p&gt;已知ahki（一维数组，长度为n，此处n=200），aH和atau（一维数组，长度都是29），常数param1，param2，sum1，函数sumFun；&lt;/p&gt;



&lt;p&gt;要求eps（一维数组长度为n，但已知eps的第一、二个元素eps[[1]]=1,eps[[2]]=0.9966353966646951`)。&lt;/p&gt;



&lt;p&gt;eps的计算过程是这样的：从第三个元素开始，其值计算与该值前面的元素有关（所以程序复杂度就上来了），具体的，&lt;/p&gt;



&lt;p&gt;eps[[3]]=param1*eps[[2]]-param2*eps[[1]]-sumFun[2,1]*(eps[[2]]-eps[[1]])/sum1;&lt;/p&gt;



&lt;p&gt;eps[[4]]=param1*eps[[3]]-param2*eps[[2]]-sumFun[3,1]*(eps[[2]]-eps[[1]])/sum1-sumFun[3,2]*(eps[[3]]-eps[[2]])/sum1;...&lt;/p&gt;



&lt;p&gt;下面是程序：&lt;/p&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
akhi = {0, 2.3287936864188195`*^-6, ...2947`,  
   0.0015648884595468354`, 0.001582400475354751`};见&lt;a rel=&quot;nofollow&quot; href=&quot;https://mmaqa.com/?qa=blob&amp;amp;qa_blobid=2628598349081426233&quot;&gt;https://mmaqa.com/?qa=blob&amp;amp;qa_blobid=2628598349081426233&lt;/a&gt;
aH = {0.001430085925000597`, 0.0016675838954522528`, 
   0.0019445237518651497`, 0.0022674557075536023`, 
   0.002644017786250091`, 0.003083116477520201`, 
   0.0035951373940762837`, 0.004192190913477146`, 
   0.004888398614142006`, 0.00570022728041296`, 0.006646878376194832`,
    0.007750742197153878`, 0.009037927434105591`, 
   0.010538878629833178`, 0.012289095928226376`, 
   0.014329973160626298`, 0.016709769425524348`, 
   0.019484714892418913`, 0.02272017089502634`, 0.0264913657698098`, 
   0.030881308242713845`, 0.03596425066700329`, 0.04171792332650145`, 
   0.047571148303899205`, 0.04982598082764393`, 0.031665129676599436`,
    0.008140592433938151`, 0.0018935256812937901`, 
   0.00045598357538307243`};
atau = {1.`*^-20, 1.`*^-19, 1.`*^-18, 1.`*^-17, 1.`*^-16, 1.`*^-15, 
   1.`*^-14, 1.`*^-13, 1.`*^-12, 1.`*^-11, 1.`*^-10, 1.`*^-9, 1.`*^-8,
    1.`*^-7, 1.`*^-6, 0.00001`, 0.0001`, 0.001`, 0.01`, 0.1`, 1.`, 
   10.`, 100.`, 1000.`, 10000.`, 100000.`, 1.`*^6, 1.`*^7, 1.`*^8};
sumFun[n_, 
   j_] := (4*
      Total[aH[[#]]*
          Exp[-(akhi[[n + 1]] - akhi[[j + 1]])/atau[[#]]] &amp;amp; /@ 
        Range[29]] - 
     2 aH[[1]]*Exp[-(akhi[[n + 1]] - akhi[[j + 1]])/atau[[1]]] - 
     2 aH[[29]]*
      Exp[-(akhi[[n + 1]] - akhi[[j + 1]])/atau[[29]]])*2.302*0.125/4;
sum1 = 0.061087175858476464`;
param1 = 0.9697185699822564`;
param2 = -0.026916826682438735`;
&lt;/pre&gt;



&lt;p&gt;解1.Nest （用了链表结构）&lt;/p&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
eps0 = Nest[{#,&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;param1*(res = Flatten[#])[[-1]] - param2*res[[-2]] -&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Sum[sumFun[Length[res], i]*Differences[res][[i]]/sum1, {i, 1,&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Length[res] - 1}]} &amp;amp;, {1, 0.9966353966646951`}, 200] //&amp;nbsp;
&amp;nbsp; &amp;nbsp; Flatten; // AbsoluteTiming&lt;/pre&gt;



&lt;p&gt;返回{6.128351, Null}&lt;/p&gt;



&lt;p&gt;解2.Do&lt;/p&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
eps1 = Flatten[{1, 0.9966353966646951`, Table[0, {200}]}];
Do[eps1[[n + 1]] = 
    param1*eps1[[n]] - param2*eps1[[n - 1]] - 
     Sum[sumFun[n, i]*(eps1[[i + 1]] - eps1[[i]])/sum1, {i, 1, 
       n - 1}], {n, 2, 201}]; // AbsoluteTiming
Norm[eps1 - eps0]&lt;/pre&gt;



&lt;p&gt;返回&lt;/p&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
{5.870336, Null}
0.&lt;/pre&gt;



&lt;p&gt;这个程序应该是规模n（此处n=200）的平方次复杂度（规模为n时，约算n^2/2次sumFun函数），我要算的规模n=30000，如果这样算肯定很久。
&lt;br&gt;
&lt;strong&gt;问题1. &lt;/strong&gt;Do语句能不能优化？比如能不能Compile?（Compile我不懂，问错了的话见谅），我不会用，试了下，列在下面，结果不对（Do语句没有执行，结果还是返回原定义的eps2），怎么体验到原生的汇编速度。&lt;/p&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
eps2 = Flatten[{1, 0.9966353966646951`, Table[0, {200}]}];
Compile[{{n, _Integer}, {i, _Integer}}, 
   Do[eps1[[n + 1]] = 
     param1*eps1[[n]] - param2*eps1[[n - 1]] - 
      Sum[sumFun[n, i]*(eps1[[i + 1]] - eps1[[i]])/sum1, {i, 1, 
        n - 1}], {n, 2, 201}]]; // AbsoluteTiming
Norm[eps0 - eps2]
Norm[Flatten[{1, 0.9966353966646951`, Table[0, {200}]}] - eps2]&lt;/pre&gt;



&lt;p&gt;返回&lt;/p&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
{0., Null}
14.1098
0.&lt;/pre&gt;



&lt;p&gt;问题2. 因为要多次调用sumFun函数，应该最耗时的就是n^2/2次sumFun函数的计算了吧，这个能怎么优化么？整个程序任何位置可以改进的都可以，谢谢大家！&lt;/p&gt;</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/1705/</guid>
<pubDate>Sat, 25 Feb 2017 14:28:19 +0000</pubDate>
</item>
<item>
<title>URLFetch如何实现提交表单</title>
<link>https://mmaqa.com/qa/1695/urlfetch</link>
<description>

&lt;p&gt;目的：想使用URLFetch登录网站&lt;/p&gt;



&lt;p&gt;版本:mathematica11&lt;/p&gt;



&lt;p&gt;看网站的登录界面，form表单里有四个要提交的&lt;/p&gt;



&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;https://mmaqa.com/qa/?qa=blob&amp;amp;qa_blobid=2458764795340771349&quot; style=&quot;height:222px; width:807px&quot;&gt;&lt;/p&gt;



&lt;p&gt;通过抓包，看post的情况&lt;/p&gt;



&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;https://mmaqa.com/qa/?qa=blob&amp;amp;qa_blobid=9845179901349162029&quot; style=&quot;height:126px; width:342px&quot;&gt;&lt;/p&gt;



&lt;p&gt;用mathematica实现&lt;/p&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
URLFetch[&amp;quot;https://bbs.byr.cn/index&amp;quot;,
 Method -&amp;gt; &amp;quot;POST&amp;quot;, 
 &amp;quot;Parameters&amp;quot; -&amp;gt; {&amp;quot;id&amp;quot; -&amp;gt; &amp;quot;xxx&amp;quot;, &amp;quot;passwd&amp;quot; -&amp;gt; &amp;quot;xxx&amp;quot;, &amp;quot;mode&amp;quot; -&amp;gt; &amp;quot;0&amp;quot;, 
   &amp;quot;CookieDate&amp;quot; -&amp;gt; &amp;quot;0&amp;quot;}]&lt;/pre&gt;



&lt;p&gt;但是仍然是不能成功登录。&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;



&lt;p&gt;应该如何做，才能登录上去。&lt;/p&gt;</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/1695/urlfetch</guid>
<pubDate>Sun, 19 Feb 2017 08:03:01 +0000</pubDate>
</item>
<item>
<title>在在线文档的地址里加.en强制切换英文的招数貌似不好使了？</title>
<link>https://mmaqa.com/qa/1667/en</link>
<description>如题。在线版的自带帮助似乎会根据IP自动切换语言。在过去，我们可以通过在页面地址里加入.en强制变换它的语言为英语，比如&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://reference.wolfram.com/language/ref/WorkingPrecision.html&quot; rel=&quot;nofollow&quot;&gt;http://reference.wolfram.com/language/ref/WorkingPrecision.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
只要改成&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://reference.wolfram.com/language/ref/WorkingPrecision.en.html&quot; rel=&quot;nofollow&quot;&gt;http://reference.wolfram.com/language/ref/WorkingPrecision.en.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
就行了。但是这招现在好像不好使了，是取消了还是后缀变了？有人知道吗？</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/1667/en</guid>
<pubDate>Mon, 06 Feb 2017 08:23:46 +0000</pubDate>
</item>
<item>
<title>含有有理数的表达式怎么进一步化简？</title>
<link>https://mmaqa.com/qa/1605/</link>
<description>

&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
f[x_] := (1 + x^3)^(2/
     3) ((1 - b) ((1 + a^3 x^3)^(-4/3) + 4 (1 + a^3 x^3)^(-1/3)) + 
    b ((1 + x^3)^(-4/3) + 4 (1 + x^3)^(-1/3)))
Series[f[x], {x, Infinity, 1}]&lt;/pre&gt;



&lt;p&gt;结果为&lt;/p&gt;



&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;https://mmaqa.com/qa/?qa=blob&amp;amp;qa_blobid=9634992662939606383&quot; style=&quot;height:74px; width:308px&quot;&gt;&lt;/p&gt;



&lt;p&gt;请问怎么进一步把分母部分化简为a？&lt;/p&gt;</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/1605/</guid>
<pubDate>Wed, 04 Jan 2017 02:42:28 +0000</pubDate>
</item>
<item>
<title>关于简写 _? 的意思</title>
<link>https://mmaqa.com/qa/1461/</link>
<description>

&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
Position[{1,2,3,4,5,6,7,8,9},&amp;nbsp;_?(#&amp;nbsp;&amp;gt;5&amp;nbsp;&amp;amp;)]&lt;/pre&gt;



&lt;p&gt;想知道 _?是什么意思，整个式子的意思我知道。&lt;/p&gt;



&lt;p&gt;还有就是怎么在帮助文档里查找这种简写符号的意思。&lt;/p&gt;</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/1461/</guid>
<pubDate>Sun, 30 Oct 2016 12:48:24 +0000</pubDate>
</item>
<item>
<title>用mathematica自动推导数值积分的余项</title>
<link>https://mmaqa.com/qa/1431/mathematica</link>
<description>比如要计算$\int_a^b f(x)dx$，如果输入intrmd[ {a,b}, {1,1}/2, {a,b} ]，表示取点a和b处的函数值，加权系数均为1/2，去逼近区间[a,b]上的积分，即$\int_a^b f(x)dx\approx \frac{f(a)+f(b)}{2}$。这是梯形公式，其输出应该为$-\frac{(b-a)^3}{12}f''(\eta)$。&lt;br /&gt;
&lt;br /&gt;
而如果输入intrmd[ {a, (a+b)/2, b}, {1,4,1}/6, {a,b} ]，则表示$\int_a^b f(x)dx\approx \frac{f(a)+4f((a+b)/2)+f(b)}{6}$，这是辛普森公式，其输出应为$-\frac{(b-a)^5}{90}f^{(4)}(\eta)$。&lt;br /&gt;
&lt;br /&gt;
如果输入intrmd[ {$\frac{a+b}{2}-\frac{b-a}{2\sqrt{3}}$, $\frac{a+b}{2}+\frac{b-a}{2\sqrt{3}}$}, {1,1}/2, {a,b} ]，这是两点的高斯求积公式，其输出应为$\frac{(b-a)^4}{135}f^{(4)}(\eta)$。&lt;br /&gt;
&lt;br /&gt;
系数的符号可以不管，输出的函数是几阶导数似乎可以令$f(x)$分别取$1,x,x^2,\dots$来估计（代数精度的定义），但是系数不知该如何计算。可否利用mathematica来代替手工繁琐的推导呢？比如输入intrmd[ Range[0,1,1/30], Total@NestList[RotateRight[#, 3] &amp;amp;, PadRight[{1, 3, 3, 1}, 30 + 1], &amp;nbsp;10 - 1], {0,1} ]，这是把$[0,1]$分为10等分，每区间内采用3阶牛顿法的数值积分，其结果应该是什么呢？</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/1431/mathematica</guid>
<pubDate>Fri, 28 Oct 2016 03:09:04 +0000</pubDate>
</item>
<item>
<title>线性规划中的大于和小于的表示</title>
<link>https://mmaqa.com/qa/1277/</link>
<description>用LinearProgramming求解线性规划问题的时候，约束条件遇到了大于和小于的情况，请问能不能用数表示？</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/1277/</guid>
<pubDate>Mon, 03 Oct 2016 10:53:51 +0000</pubDate>
</item>
<item>
<title>在一个集合上求和，有没有更好的实现办法？</title>
<link>https://mmaqa.com/qa/1201/</link>
<description>

&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;

&amp;nbsp;&lt;/pre&gt;



&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;https://mmaqa.com/qa/?qa=blob&amp;amp;qa_blobid=11828811802483046538&quot; style=&quot;height:175px; width:600px&quot;&gt; my mma code:&amp;nbsp;&lt;/p&gt;



&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;https://mmaqa.com/qa/?qa=blob&amp;amp;qa_blobid=1455403143829905848&quot; style=&quot;height:220px; width:600px&quot;&gt;&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/1201/</guid>
<pubDate>Fri, 09 Sep 2016 13:04:32 +0000</pubDate>
</item>
<item>
<title>关于Conjugate</title>
<link>https://mmaqa.com/qa/1154/conjugate</link>
<description>

&lt;p&gt;各位有没有觉得mma里面的Conjugate有些弱呢？比如一个稍微复杂点的表达式都不能够按照期望的做复共轭运算。比如下面的运算：&lt;/p&gt;



&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;https://mmaqa.com/qa/?qa=blob&amp;amp;qa_blobid=16715930922074871325&quot; style=&quot;height:97px; width:600px&quot;&gt;&lt;/p&gt;



&lt;p&gt;写了一个简单的myConjugate如下：&lt;/p&gt;



&lt;p&gt;myConjugate[expr_] := Head[expr] @@ Conjugate[Apply[List, expr]];&lt;/p&gt;



&lt;p&gt;但是这样只能做到第一层。如何把一个表达式的TreeForm上的每一个叶子都运用Conjugate？假设我们的表达式只包含复数的四则运算。&lt;/p&gt;</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/1154/conjugate</guid>
<pubDate>Sun, 28 Aug 2016 03:19:08 +0000</pubDate>
</item>
<item>
<title>mma如何做服务器后台</title>
<link>https://mmaqa.com/qa/1080/mma</link>
<description>想用mma做服务器后台，实现接受一张图片，识别出图片上的文字，并反馈，不知道应该怎么实现。&lt;br /&gt;
&lt;br /&gt;
自己的系统是Win10</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/1080/mma</guid>
<pubDate>Fri, 12 Aug 2016 03:02:36 +0000</pubDate>
</item>
<item>
<title>安装完mathematica10.4后不能运行</title>
<link>https://mmaqa.com/qa/675/mathematica10-4</link>
<description>问题事件名称: &amp;nbsp;&amp;nbsp;&amp;nbsp;APPCRASH&lt;br /&gt;
&amp;nbsp;&amp;nbsp;应用程序名: &amp;nbsp;&amp;nbsp;&amp;nbsp;Mathematica.exe&lt;br /&gt;
&amp;nbsp;&amp;nbsp;应用程序版本: &amp;nbsp;&amp;nbsp;&amp;nbsp;10.4.30762.23169&lt;br /&gt;
&amp;nbsp;&amp;nbsp;应用程序时间戳: &amp;nbsp;&amp;nbsp;&amp;nbsp;5711f13b&lt;br /&gt;
&amp;nbsp;&amp;nbsp;故障模块名称: &amp;nbsp;&amp;nbsp;&amp;nbsp;KERNELBASE.dll&lt;br /&gt;
&amp;nbsp;&amp;nbsp;故障模块版本: &amp;nbsp;&amp;nbsp;&amp;nbsp;6.1.7601.19135&lt;br /&gt;
&amp;nbsp;&amp;nbsp;故障模块时间戳: &amp;nbsp;&amp;nbsp;&amp;nbsp;56a1c680&lt;br /&gt;
&amp;nbsp;&amp;nbsp;异常代码: &amp;nbsp;&amp;nbsp;&amp;nbsp;c06d007e&lt;br /&gt;
&amp;nbsp;&amp;nbsp;异常偏移: &amp;nbsp;&amp;nbsp;&amp;nbsp;000080d7&lt;br /&gt;
&amp;nbsp;&amp;nbsp;OS 版本: &amp;nbsp;&amp;nbsp;&amp;nbsp;6.1.7601.2.1.0.256.1&lt;br /&gt;
&amp;nbsp;&amp;nbsp;区域设置 ID: &amp;nbsp;&amp;nbsp;&amp;nbsp;2052&lt;br /&gt;
&amp;nbsp;&amp;nbsp;其他信息 1: &amp;nbsp;&amp;nbsp;&amp;nbsp;0a9e&lt;br /&gt;
&amp;nbsp;&amp;nbsp;其他信息 2: &amp;nbsp;&amp;nbsp;&amp;nbsp;0a9e372d3b4ad19135b953a78882e789&lt;br /&gt;
&amp;nbsp;&amp;nbsp;其他信息 3: &amp;nbsp;&amp;nbsp;&amp;nbsp;0a9e&lt;br /&gt;
&amp;nbsp;&amp;nbsp;其他信息 4: &amp;nbsp;&amp;nbsp;&amp;nbsp;0a9e372d3b4ad19135b9</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/675/mathematica10-4</guid>
<pubDate>Fri, 27 May 2016 10:44:52 +0000</pubDate>
</item>
<item>
<title>关于mathematics在chrome上加载演示项目的</title>
<link>https://mmaqa.com/qa/605/mathematicschrome</link>
<description>

&lt;p&gt;1,我已经允许总是加载了,这个为啥老是提醒重新加载CDF
&lt;br&gt;
2,重新加载完了 还是跟一起一样 快崩溃了
&lt;br&gt;
3,我用的是chrome浏览器 有解决方案不?&lt;img alt=&quot;&quot; src=&quot;https://mmaqa.com/qa/?qa=blob&amp;amp;qa_blobid=559567331605427177&quot; style=&quot;height:465px; width:600px&quot;&gt;g&lt;/p&gt;</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/605/mathematicschrome</guid>
<pubDate>Mon, 23 May 2016 13:20:22 +0000</pubDate>
</item>
<item>
<title>MMA在计算集群中的节点选择问题</title>
<link>https://mmaqa.com/qa/561/mma</link>
<description>我现在需要在一个计算集群(RedHat)上运行MMA程序，安装都已经完成，现有以下几个问题：&lt;br /&gt;
&lt;br /&gt;
1.默认是在主节点上计算，由于主节点很多人要使用，一般都是将各自程序在分节点上计算，那么如何设置使得在某个分节点上运行nb文件？对于C和Fortran有专门的MPI来处理这种问题，对于MMA是怎样的？&lt;br /&gt;
&lt;br /&gt;
2.另外，如何在多个节点之间实现分布式计算？&lt;br /&gt;
&lt;br /&gt;
3.当前MMA并行最多认16个核，如何增大？&lt;br /&gt;
&lt;br /&gt;
谢谢。@苹果</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/561/mma</guid>
<pubDate>Thu, 19 May 2016 04:14:45 +0000</pubDate>
</item>
<item>
<title>如何加速这段FDTD程序？</title>
<link>https://mmaqa.com/qa/319/fdtd</link>
<description>

&lt;p&gt;代码基本是下面一坨了，目前的速度其实还可以了，用了With做宏替换，Compile编译到机器码。
&lt;br&gt;
目前感觉还能提速的地方是每个Do循环，因为每个Do循环其实跟 i、j、k 的顺序是无关的，所以在想有没有可能并行起来。但是在Compile内部并行我不知道怎么弄。&lt;/p&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
Ni = 50;
Nj = 80;
Nk = 50;
di = 5/50;
dj = 2 Pi/Nj;
dk = 5/50;
f = 150 10^6;
&amp;mu; = 4.0 Pi 1.0 10^-7;
X = 1/f;
ks = 2*Pi^2*f^2;
X = 1/f;
cc = 2.99792458 10^8;
&amp;Delta;t = 
  0.99/cc /Sqrt[1.0/di^2 + 1.0/(0.5*di dj)^2 + 1.0/dk^2];
mat = ConstantArray[0, {Ni + 1, Nj, Nk + 2}];
{EiMat, EjMat, EkMat, HiMat, HjMat, HkMat} = ConstantArray[mat, 6];

compute =
  With[{
    miu = 4.0*Pi*1.0 10^-7,
    ϵ = 1.0/(cc cc &amp;mu;),
    &amp;sigma; = 10^-6,
    dt = &amp;Delta;t,
    di = di,
    dj = dj,
    dk = dk,
    Ni = Ni,
    Nj = Nj,
    Nk = Nk,
    &amp;Delta;t = &amp;Delta;t,
    ks = ks,
    X = X,
    f = f
    
    },
   Compile[{{t, _Real},
     {matrix, _Real, 4}},
    Module[
     {
      pulse,
      sum,
      CA,
      CB,
      EiMat,
      EjMat,
      EkMat,
      HiMat,
      HjMat,
      HkMat
      },
     {EiMat, EjMat, EkMat, HiMat, HjMat, HkMat} = matrix;
     CA = (2 ϵ - &amp;sigma; &amp;Delta;t)/(
      2 ϵ + &amp;sigma; &amp;Delta;t);
     CB = (2 &amp;Delta;t)/(
      2 ϵ + &amp;sigma; &amp;Delta;t);
     (*Do[*)
     pulse = 2*ks*Sqrt[Exp[1/2/ks]]*Exp[-ks*(t - X)^2]*(t - X);
     (***********************)
     EkMat[[10, 10, 25]] += pulse;
     Do[
      EiMat[[i, j, 
        k]] = (CA EiMat[[i, j, k]] + 
         CB ((HkMat[[i, j, k]] - 
             HkMat[[i, If[j == 1, Nj, j - 1], 
              k]])/((i - 1/2) di dj) - (
            HjMat[[i, j, k]] - HjMat[[i, j, k - 1]])/dk)),
      {i, 1, Ni},
      {j, 1, Nj},
      {k, 2, Nk}
      ];
     
     
     Do[
      EjMat[[i, j, k]] = 
        CA EjMat[[i, j, k]] + 
         CB ((HiMat[[i, j, k]] - HiMat[[i, j, k - 1]])/dk - (
            HkMat[[i, j, k]] - HkMat[[i - 1, j, k]])/di);
      ,
      {i, 2, Ni},
      {j, 1, Nj},
      {k, 2, Nk}];
     
     Do[
      EkMat[[i, j, k]] = 
       CA EkMat[[i, j, k]] + 
        CB (((i - 1/2) HjMat[[i, j, k]] - (i - 3/2) HjMat[[i - 1, j, 
              k]])/((i - 1) di) - (
           HiMat[[i, j, k]] - HiMat[[i, If[j == 1, Nj, j - 1], k]])/(
           di dj (i - 1))),
      {i, 2, Ni},
      {j, 1, Nj},
      {k, 2, Nk}
      ];
     
     (*Ek i=1*)
     Do[
      sum = Sum[HjMat[[1, m, k]], {m, 1, Nj}];
      Do[
       EkMat[[1, j, k]] = CA EkMat[[1, j, k]] + CB (4/(di Nj)) sum,
       {j, 1, Nj}],
      {k, 1, Nk}];
     
     
     Do[
      HiMat[[i, j, k]] = (
        HiMat[[i, j, k]] +
         dt/
          miu ((EjMat[[i, j, k + 1]] - EjMat[[i, j, k]])/dk - (
            EkMat[[i, If[j == Nj, 1, j + 1], k]] - 
             EkMat[[i, j, k]])/((i - 1) di dj))),
      {i, 2, Ni},
      {j, 1, Nj},
      {k, 2, Nk}];
     
     
     Do[
      HkMat[[i, j, k]] =
       HkMat[[i, j, k]] +
        dt/
         miu ((EiMat[[i, If[j == Nj, 1, j + 1], k]] - 
            EiMat[[i, j, k]])/((i - 1/2) di dj) - (
           
           i EjMat[[i + 1, j, k]] - (i - 1) EjMat[[i, j, k]])/((i - 1/
              2) di ));
      HjMat[[i, j, k]] = 
       HjMat[[i, j, k]] + 
        dt/miu ((EkMat[[i + 1, j, k]] - EkMat[[i, j, k]])/di - (
           EiMat[[i, j, k + 1]] - EiMat[[i, j, k]])/dk)
      ,
      {i, 1, Ni},
      {j, 1, Nj},
      {k, 2, Nk}];
     (*,{t,0,50 10^-9,&amp;Delta;t}];*)
     {EiMat, EjMat, EkMat, HiMat, HjMat, HkMat}
     ], CompilationTarget -&amp;gt; &amp;quot;C&amp;quot;,
    RuntimeOptions -&amp;gt; &amp;quot;Speed&amp;quot;
    ]
   ];
n = 0; PrintTemporary[Dynamic[n]];
Do[If[Mod[n, 50] == 0, EkMat2 = EkMat; nn = n]; 
 n++; {EiMat, EjMat, EkMat, HiMat, HjMat, HkMat} = 
  compute @@ {t, {EiMat, EjMat, EkMat, HiMat, HjMat, HkMat}},
 {t, 0, 50 10^-9, &amp;Delta;t}]
&lt;/pre&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/319/fdtd</guid>
<pubDate>Fri, 29 Apr 2016 06:46:19 +0000</pubDate>
</item>
<item>
<title>mma先森的诅咒 笔记本内容无法上下滑动</title>
<link>https://mmaqa.com/qa/94/mma</link>
<description>

&lt;p&gt;内核崩溃后 某个笔记本不能用滚轮控制 但是打开另一个新的又能控制了 重启mma也一样 那个笔记本就像下了咒语一样 滚轮控制不能。。。
&lt;br&gt;

&lt;br&gt;
用mma10.2打开也不行。。。&lt;/p&gt;



&lt;p&gt;现在比较机智的方法是&lt;strong&gt;利用单元开闭了&lt;/strong&gt;。。。把数据提取回来。。。&lt;/p&gt;



&lt;p&gt;这个笔记本已经提取我的数据了 但是问题还在：&lt;/p&gt;



&lt;p&gt;百度云分享：着了魔的笔记本.nb&lt;/p&gt;



&lt;p&gt;链接: &lt;a href=&quot;http://pan.baidu.com/s/1slR6rWp&quot; rel=&quot;nofollow&quot;&gt;http://pan.baidu.com/s/1slR6rWp&lt;/a&gt; 密码: 9yii&lt;/p&gt;</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/94/mma</guid>
<pubDate>Thu, 14 Apr 2016 00:44:09 +0000</pubDate>
</item>
<item>
<title>采用高斯拟合时显示精度溢出或得到结果显然存在明显的较大偏差</title>
<link>https://mmaqa.com/qa/90/</link>
<description>

&lt;p&gt;数据如下
&lt;br&gt;

&lt;br&gt;
data1 := {{6.2, 575.8}, {6.3, 1025.0}, {6.4, 1168.3}, {6.5,840.3}, {6.6, 485.5}}
&lt;br&gt;

&lt;br&gt;
采用FindFit，FindFit[data1, a*Exp[-(x - b)^2/c^2], {a, b, c}, x]，然后显示
&lt;br&gt;

&lt;br&gt;
LinearAlgebra`BLAS`TRSV::oflow: 在计算过程中，碰到机器精度溢出.
&lt;br&gt;

&lt;br&gt;
求问这是为什么&lt;/p&gt;



&lt;p&gt;上面的问题已被解答，然而又有一个相似的问题。。。&lt;/p&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
data2 = {{7.0, 647.0}, {7.1, 1909.3}, {7.2, 2352.8}, {7.3, 
    1682.0}, {7.4, 633.0}};
FindFit[data2, a*Exp[-(x - b)^2/c^2], {a, b, c}, x, 
 MaxIterations -&amp;gt; 10000]&lt;/pre&gt;



&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;https://mmaqa.com/qa/?qa=blob&amp;amp;qa_blobid=13845165730332390050&quot; style=&quot;height:316px; width:600px&quot;&gt;&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;



&lt;p&gt;所得的结果明显有问题&lt;/p&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
NonlinearModelFit[data2, a*Exp[-(x - b)^2/c^2], {a, b, c}, x, 
 MaxIterations -&amp;gt; Infinity]&lt;/pre&gt;



&lt;p&gt;分析之后得到&lt;/p&gt;



&lt;pre class=&quot;prettyprint lang-mma&quot;&gt;
{
 {&amp;quot;&amp;quot;, &amp;quot;Estimate&amp;quot;, &amp;quot;Standard Error&amp;quot;, &amp;quot;t\[Hyphen]Statistic&amp;quot;, 
  &amp;quot;P\[Hyphen]Value&amp;quot;},
 {a, 4182.48, 1.67714*10^24, 2.49381*10^-21, 1.},
 {b, 352.755, 4.2033*10^21, 8.39233*10^-20, 1.},
 {c, 60.1843, 3.66042*10^20, 1.64419*10^-19, 1.}
}&lt;/pre&gt;



&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;https://mmaqa.com/qa/?qa=blob&amp;amp;qa_blobid=15335344933097939070&quot; style=&quot;height:263px; width:600px&quot;&gt;&lt;/p&gt;



&lt;p&gt;显然存在问题&lt;/p&gt;</description>
<category>其它</category>
<guid isPermaLink="true">https://mmaqa.com/qa/90/</guid>
<pubDate>Wed, 13 Apr 2016 12:41:44 +0000</pubDate>
</item>
</channel>
</rss>