Mathematica 2D Heat Equation Animation

懵懂的女人 提交于 2019-12-06 10:22:43

Just a quick check:

RT = 1
R = 1
FUNC = NDSolve[{D[T[x, y, t], t] == 
     RT*(D[T[x, y, t], x, x] + D[T[x, y, t], y, y]), T[x, y, 0] == 0, 
    T[0, y, t] == R*t,
    T[9, y, t] == R*t,
    T[x, 0, t] == R*t,
    T[x, 9, t] == R*t}, T,
   {x, 0, 9}, {y, 0, 9}, {t, 0, 6}];
a = Table[
  Plot3D[T[x, y, t] /. FUNC, {x, 0, 9}, {y, 0, 9}, Mesh -> 15, 
   PlotRange -> {{0, 9}, {0, 9}, {-1, 10}}, 
   ColorFunction -> Function[{x, y, z}, Hue[.3 (1 - z)]]], {t, 0, 6}]
Export["c:\anim.gif", a]

PS: A lot of mistakes are avoided by using a lowercase letter as the first char for your symbols...

I'm with Mark -- there is nothing wrong with your program. The problem is that nothing interesting happens to your function after t=0: Try having a look at

ListAnimate[
 Table[Plot3D[T[x, y, t] /. FUNC, {x, 0, 9}, {y, 0, 9}, Mesh -> 9], {t, 0, 6}]]

As you can see, all that happens is a scaling, so that when DensityPlot rescales each frame independently, they end up looking identical :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!