Mathematica : NDSolve on 2-D steady state heat eqn

In summary, the document discusses solving the two-dimensional steady-state heat equation using Mathematica's NDSolve function. It outlines the formulation of the heat equation, boundary conditions, and the implementation of numerical methods to obtain solutions. The focus is on how to effectively set up the problem in Mathematica, interpret the results, and visualize the temperature distribution in a given domain.
  • #1
Swamp Thing
Insights Author
970
670
I am trying to implement this equation ##−k∇^2 u = e^{-(x^2+y^2)}##
using NDSolve in Mathematica. The idea is to solve for the temperature of a plate 10 x 10 units, with heat inputs as per the RHS.
Here is my attempt:
Code:
NDSolve[{ - Laplacian[u, {x, y}] == Exp[-(x^2 + y^2)], u[x, -5] == 0,
  u[x, 5] == 0, u[-5, y] == 0, u[5, y] == 0}, u, {x, -5, 5}, {y, -5,
  5}]

I get this error:
Code:
NDSolve::ndode: The equations {0==E^(-x^2-y^2)} are not
 differential equations or initial conditions
in the dependent variables {u}.

What is my mistake?
 
Physics news on Phys.org
  • #2
The u in your Laplacian does not depend on x or y so the result is zero.

Try Laplacian[u[x,y],{x,y}]

Edit: Note on nomenclature: The stationary heat equation is the Poisson equation.
 
  • Like
Likes Swamp Thing

FAQ: Mathematica : NDSolve on 2-D steady state heat eqn

What is the basic syntax for using NDSolve to solve a 2-D steady-state heat equation in Mathematica?

The basic syntax for using NDSolve to solve a 2-D steady-state heat equation is:

NDSolve[{Laplacian[u[x, y], {x, y}] == 0, boundary_conditions}, u, {x, xmin, xmax}, {y, ymin, ymax}]
Here, u[x, y] represents the temperature distribution, and boundary_conditions specify the conditions at the boundaries of the domain.

How do I specify boundary conditions for the 2-D steady-state heat equation in Mathematica?

Boundary conditions can be specified using equalities. For example, if you have Dirichlet boundary conditions where the temperature is fixed at the boundaries, you can specify them as:

{u[x, ymin] == T1, u[x, ymax] == T2, u[xmin, y] == T3, u[xmax, y] == T4}
Here, T1, T2, T3, and T4 are the fixed temperatures at the respective boundaries.

Can I solve the 2-D steady-state heat equation with mixed boundary conditions using NDSolve?

Yes, you can solve the 2-D steady-state heat equation with mixed boundary conditions using NDSolve. Mixed boundary conditions can include both Dirichlet and Neumann conditions. For example:

{u[x, ymin] == T1, u[x, ymax] == T2, Derivative[1, 0][u][xmin, y] == g1, Derivative[1, 0][u][xmax, y] == g2}
Here, g1 and g2 are the heat fluxes at the boundaries.

Similar threads

Replies
4
Views
2K
Replies
1
Views
2K
Replies
4
Views
5K
Replies
1
Views
2K
Replies
2
Views
2K
Back
Top