Guest User

Untitled

a guest
Apr 22nd, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. dDSim = 2*^-8
  2. dThick := 1600*^-9
  3. dTime = 1*^-4
  4. eqSimple = D[x[z, t], t] == D[ dDSim*D[x[z, t], z], z]
  5. eqIni = x[z, 0] == Piecewise[{{1*199/200, z < dThick/2}, {1*1/200, z >= dThick/2}}]
  6. eqBLeft = Derivative[1, 0][x][0, t] == 0
  7. eqBRight = Derivative[1, 0][x][dThick, t] == 0
  8. mol[n_,o_]:={"MethodOfLines","SpatialDiscretization"->{"TensorProductGrid","MaxPoints"->n,"MinPoints"->n,"DifferenceOrder"->n}}
  9. res = NDSolve[{eqSimple, eqIni, eqBLeft, eqBRight},x, {z, 0, dThick}, {t, 0, dTime},Method->mol[40,9]]
  10.  
  11. Plot3D[Evaluate[x[z, t] /. res], {t, 0, dTime}, {z, 0, dThick}, AxesLabel -> {time, thickness, x val}]
  12.  
  13. dDSim = 2*^-8*(1/x[z, t] + 1/(1 - x[z, t]))
Add Comment
Please, Sign In to add comment