Heat Equation in Polar coordinates in Mathematica

In summary, the conversation is about trying to solve the heat equation in polar coordinates. The equation is written with Greek symbols and partial derivatives, and it is for a disk with radius a. The boundary conditions are given and the conversation also mentions using Mathematica to solve the equation. However, there are errors and issues with the code and boundary conditions, and it is suggested to use code tags and provide more specific values for the equation. Additionally, it may be necessary to use DSolve instead of NDSolve for a symbolic solution.
  • #1
Hop
1
0
Hi! Can someone please help?
I'm trying to solve the heat equation in polar coordinates. Forgive my way of typing it in, I'm battling to make it look right. The d for derivative should be partial, alpha is the Greek alpha symbol and theta is the Greek theta symbol.
du/dt = (alpha.alpha)[(d/dr)(du/dr)+(1/r)du/dr+(1/(r.r))(d/theta)(du/dtheta)]
This is the heat equation for a disk with radius a.
u(r,theta,0) = (a-r)cos(theta)
u(a,theta,t) = 0

In Mathematica, I used:
NDSolve[{Derivative[0,0,1][u][r,theta,t]==alpha Derivative[2,0,0][u][r,theta,t]+alpha Derivative[1,0,0][u][r,theta,t]+alpha Derivative[0,2,0][u][r,theta,t], u[r,theta,0] == (a-r)Cos[theta], u[a,theta,t]==0},u,{r,0,a},{theta,0,1},{t,0,1}]

I got an error: NDSolve: bcart
I tried replacing alpha with 2 and a with 4. Still got a problem. Is there a way of keeping the alpha's and a's? And can the radius start from 0, without problems?

Then I need to plot it in 3 dimensions. I tried: (radius starting from 1 since I had problems)
Plot3D[Evaluate[u[r,theta,t] /. First[%]],{r,1,4}, {theta,0,pi}, {t,0,1},PlotPoints -> 50]

I got an error: Plot3D: plnc (repeatedly)
General :: stop
Plot3D[InterpolatingFunction[{{1.,4.},{0.,3.14159},{0.,1.}},<>][r,theta,t],{r,1,4},{theta,0,pi},{t,0,1}, PlotPoints -> 50]

I still need to add a different boundary condition where du/dr(a,theta,t) = 0 and need to solve u(r,theta,t). Would it work the same way?

Please help! I would really appreciate it!

Thanks,
Hop
 
Physics news on Phys.org
  • #2
Hop said:
Hi! Can someone please help?
I'm trying to solve the heat equation in polar coordinates. Forgive my way of typing it in, I'm battling to make it look right. The d for derivative should be partial, alpha is the Greek alpha symbol and theta is the Greek theta symbol.
du/dt = (alpha.alpha)[(d/dr)(du/dr)+(1/r)du/dr+(1/(r.r))(d/theta)(du/dtheta)]
This is the heat equation for a disk with radius a.
u(r,theta,0) = (a-r)cos(theta)
u(a,theta,t) = 0

In Mathematica, I used:
NDSolve[{Derivative[0,0,1][u][r,theta,t]==alpha Derivative[2,0,0][u][r,theta,t]+alpha Derivative[1,0,0][u][r,theta,t]+alpha Derivative[0,2,0][u][r,theta,t], u[r,theta,0] == (a-r)Cos[theta], u[a,theta,t]==0},u,{r,0,a},{theta,0,1},{t,0,1}]

I got an error: NDSolve: bcart
I tried replacing alpha with 2 and a with 4. Still got a problem. Is there a way of keeping the alpha's and a's? And can the radius start from 0, without problems?

Then I need to plot it in 3 dimensions. I tried: (radius starting from 1 since I had problems)
Plot3D[Evaluate[u[r,theta,t] /. First[%]],{r,1,4}, {theta,0,pi}, {t,0,1},PlotPoints -> 50]

I got an error: Plot3D: plnc (repeatedly)
General :: stop
Plot3D[InterpolatingFunction[{{1.,4.},{0.,3.14159},{0.,1.}},<>][r,theta,t],{r,1,4},{theta,0,pi},{t,0,1}, PlotPoints -> 50]

I still need to add a different boundary condition where du/dr(a,theta,t) = 0 and need to solve u(r,theta,t). Would it work the same way?

Please help! I would really appreciate it!

Thanks,
Hop
These equations are unreadable. Please use LaTex.
 
  • #3
Hop said:
Hi! Can someone please help?
I'm trying to solve the heat equation in polar coordinates. Forgive my way of typing it in, I'm battling to make it look right. The d for derivative should be partial, alpha is the Greek alpha symbol and theta is the Greek theta symbol.
du/dt = (alpha.alpha)[(d/dr)(du/dr)+(1/r)du/dr+(1/(r.r))(d/theta)(du/dtheta)]

[tex]\frac{\partial u}{\partial t} = \alpha^2\left(
\frac{\partial^2 u}{\partial r^2} + \frac 1r \frac{\partial u}{\partial r} + \frac{1}{r^2} \frac{\partial^2 u}{\partial \theta^2}\right)[/tex]

This is the heat equation for a disk with radius a.
u(r,theta,0) = (a-r)cos(theta)
u(a,theta,t) = 0

In Mathematica, I used:

NDSolve[{Derivative[0,0,1][u][r,theta,t]==alpha Derivative[2,0,0][u][r,theta,t]+alpha Derivative[1,0,0][u][r,theta,t]+alpha Derivative[0,2,0][u][r,theta,t], u[r,theta,0] == (a-r)Cos[theta], u[a,theta,t]==0},u,{r,0,a},{theta,0,1},{t,0,1}]

Please use code tags for code. It prevents the parser interpreting [u] as an underline tag.

Code:
NDSolve[{Derivative[0,0,1][u][r,theta,t]==alpha Derivative[2,0,0][u][r,theta,t]+alpha Derivative[1,0,0][u][r,theta,t]+alpha Derivative[0,2,0][u][r,theta,t], u[r,theta,0] == (a-r)Cos[theta], u[a,theta,t]==0},u,{r,0,a},{theta,0,1},{t,0,1}]

As I read it, you have [itex]\theta[/itex] running between 0 and 1. Surely you want [itex]\theta[/itex] between 0 and [itex]2\pi[/itex]?

I got an error: NDSolve: bcart
I tried replacing alpha with 2 and a with 4. Still got a problem. Is there a way of keeping the alpha's and a's? And can the radius start from 0, without problems?

NDSolve is for numerical solutions. This necessarily involves telling Mathematica what values of [itex]\alpha[/itex] and [itex]a[/itex] you want it to use (but in any event you can remove both of them from the problem by suitable rescalings of [itex]r[/itex] and [itex]t[/itex]). If you want a symbolic solution, use DSolve.

The error message indicates that you have not supplied sufficient boundary conditions. In particular, Mathematica does not know that [itex]r[/itex] and [itex]\theta[/itex] are to be interpreted as polar coordinates, and that therefore [itex]u(r,0,t) = u(r,2\pi,t)[/itex] and that the boundary condition to be imposed at [itex]r = 0[/itex] is that [itex]\frac{\partial u}{\partial r} = 0[/itex]. But the coordinate singularity at the origin may be fatal in any event: I don't think you can tell NDSolve that the value of [itex]u[/itex] at the origin should not depend on [itex]\theta[/itex]. (Or, if Mathematica can work all that out for itself, you only told it to look at [itex]0 \leq \theta \leq 1[/itex] and didn't supply boundary conditions at the edges of that sector.)
 

1. What is the heat equation in polar coordinates?

The heat equation in polar coordinates is a mathematical equation that describes how heat is distributed over a two-dimensional circular or spherical surface. It takes into account factors such as the initial temperature distribution, the thermal conductivity of the material, and the rate at which heat is being generated or removed.

2. How do I solve the heat equation in polar coordinates in Mathematica?

To solve the heat equation in polar coordinates in Mathematica, you can use the built-in function NDSolve. This function allows you to specify the initial conditions, boundary conditions, and any other parameters needed to solve the equation. You can also use the Manipulate function to visualize the results and adjust the parameters.

3. Can the heat equation in polar coordinates be applied to real-world problems?

Yes, the heat equation in polar coordinates has many real-world applications, such as modeling the temperature distribution in a circular or spherical object, such as a heat sink or a planet. It can also be used to study heat transfer in various engineering and scientific fields, such as thermodynamics, meteorology, and geophysics.

4. What are some limitations of using the heat equation in polar coordinates?

The heat equation in polar coordinates assumes that the material being studied is homogeneous and isotropic, meaning that its properties do not vary with direction or location. It also does not take into account factors such as convection or phase change, which can significantly affect the temperature distribution in real-world scenarios.

5. Can I use other software besides Mathematica to solve the heat equation in polar coordinates?

Yes, there are other software programs that can solve the heat equation in polar coordinates, such as MATLAB, Python, and Maple. However, Mathematica is a popular choice due to its powerful built-in functions and visualization capabilities, making it well-suited for solving complex mathematical equations like the heat equation.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
221
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
261
Replies
8
Views
234
  • Introductory Physics Homework Help
Replies
10
Views
263
  • Special and General Relativity
Replies
9
Views
1K
  • Differential Equations
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • General Math
Replies
4
Views
1K
  • Differential Equations
Replies
6
Views
2K
Replies
4
Views
348
Back
Top