Skip to main content
Improved code
Source Link
Michael E2
  • 244.7k
  • 18
  • 351
  • 774

[Udpate: simplified DirichletCondition, omitted unnecessary Method specification.]

Following the Transient PDE examples in Finite Element Programming, I came up with this:

Ω = ImplicitRegion[(x + y <= 10), {{x, 0, 10}, {y, 0, 10}}];

Dif = 0.0000072;

eq1 = D[u[t, x, y], t] == Dif*Laplacian[u[t, x, y], {x, y}] - 1.2;

sol = NDSolve[{eq1, 
   DirichletCondition[u[t, x, y] == 100,  x + y == 10 || x == 0 || y == 0]True], 
   u[0, x, y] == 100}, 
  u, {t, 0, 1000}, {x, y} ∈ Ω, 
  Method -> {"PDEDiscretization" -> {"MethodOfLines", 
      "SpatialDiscretization" -> {"FiniteElement"}}}]Ω]

Following the Transient PDE examples in Finite Element Programming, I came up with this:

Ω = ImplicitRegion[(x + y <= 10), {{x, 0, 10}, {y, 0, 10}}];

Dif = 0.0000072;

eq1 = D[u[t, x, y], t] == Dif*Laplacian[u[t, x, y], {x, y}] - 1.2;

sol = NDSolve[{eq1, 
   DirichletCondition[u[t, x, y] == 100,  x + y == 10 || x == 0 || y == 0],
   u[0, x, y] == 100}, 
  u, {t, 0, 1000}, {x, y} ∈ Ω, 
  Method -> {"PDEDiscretization" -> {"MethodOfLines", 
      "SpatialDiscretization" -> {"FiniteElement"}}}]

[Udpate: simplified DirichletCondition, omitted unnecessary Method specification.]

Following the Transient PDE examples in Finite Element Programming, I came up with this:

Ω = ImplicitRegion[(x + y <= 10), {{x, 0, 10}, {y, 0, 10}}];

Dif = 0.0000072;

eq1 = D[u[t, x, y], t] == Dif*Laplacian[u[t, x, y], {x, y}] - 1.2;

sol = NDSolve[{eq1, DirichletCondition[u[t, x, y] == 100, True], 
   u[0, x, y] == 100}, 
  u, {t, 0, 1000}, {x, y} ∈ Ω]
Source Link
Michael E2
  • 244.7k
  • 18
  • 351
  • 774

Following the Transient PDE examples in Finite Element Programming, I came up with this:

Ω = ImplicitRegion[(x + y <= 10), {{x, 0, 10}, {y, 0, 10}}];

Dif = 0.0000072;

eq1 = D[u[t, x, y], t] == Dif*Laplacian[u[t, x, y], {x, y}] - 1.2;

sol = NDSolve[{eq1, 
   DirichletCondition[u[t, x, y] == 100,  x + y == 10 || x == 0 || y == 0],
   u[0, x, y] == 100}, 
  u, {t, 0, 1000}, {x, y} ∈ Ω, 
  Method -> {"PDEDiscretization" -> {"MethodOfLines", 
      "SpatialDiscretization" -> {"FiniteElement"}}}]