1

I am working on a solution to solve a Partial Differential Equation, Fick's Second Law of Diffusion to be exact. I was able to produce a 3D Plot using the NDSolve and Plot3D functions. Code used:

NDSolve[{D[c[t, h], t] == 1*D[c[t, h], h, h],
               c[0, h] == Erfc[h/(2*81.2)], 
               c[t, 0] == 1, 
            c[t, 4000] == 3.08*^-18}, c, {t, 0, 900}, {h, 0, 274}]

Instead of a graphical representation, I would like to find numerical points of the graph at t = 900. I would like to know how to put in t = 900 into NDSolve (or other functions) so as to generate detailed numerical points of the solution.

4

1 に答える 1

0

最初にソリューションを変数に保存してみてください。

e = NDSolve[{D[c[t, h], t] == 1*D[c[t, h], h, h], c[0, h] == Erfc[h/(2*81.2)], c[t, 0] == 1, c[t, 4000] == 3.08*^-18}, c, {t, 0, 900}, {h, 0, 274}]

次に、目的の変数についてこの式を評価できます。

Evaluate[c[900, 10] /. e]
(*{0.914014}*)

または、より用途の広いものにするために、Manipulate を使用できます。

Manipulate[Evaluate[c[t, h] /. e], {t, 0, 900}, {h, 0, 274}]

操作する

更新: 以下のコメントから受け取った情報を考慮してください。関数として解を与えるq[t,h]のような関数を定義できます。

q[t_, h_] := Evaluate[c[t, h] /. e]
q[900, 10]
(*{0.914014}*)
于 2013-06-26T06:03:02.133 に答える