[Mathematica] Solving Heat Equation in Spherical Coordinates

In summary, the conversation discusses solving a heat equation expressed in spherical coordinates, with a source term and constant values for n and K. The individual is seeking help in converting a Maple code to Mathematica in order to numerically solve the equation for different datasets on a sphere.
  • #1
GAbit
2
0
Hello Folks,


I have this equation to solve (expressed in LaTeX):

\frac{\partial{h}}{\partial t} = \frac{1}{n} \left[ \frac{1}{r^2 \sin^2{\phi}} \frac{\partial}{\partial \theta} \left( K \frac{\partial h}{\partial \theta} \right) + \frac{1}{r^2 \sin \phi} \frac{\partial}{\partial \phi} \left( K \sin \phi \frac{\partial h}{\partial \phi}\right) + s(\theta,\phi,t) \right]

This is similar to heat equation expressed in spherical coordinates, using mathematical convention for \phi and \theta and where s is a source term (but comes from data and do not need to be computed), and n is constant (does not depend on time) and again this is something we know (or assume), and finally, as you can read, there is no gradient in the radial direction.

I'd like to use Mathematica as I need to resolve this equation numerically for different dataset (for K,n and s, that I have) on a sphere, and it seems to be THE tool for such task. But I don't have any experience (a very a little actually) with Mathematica.

Could someone help me with this?

thanks a lot!

G.
 
Last edited:
Physics news on Phys.org
  • #2
I might have something close to what I need, but in Maple:

PDE := n*(diff(h(theta, phi, t), t)) = (diff(K*(diff(h(theta, phi, t),
theta)), theta))/(r^2*sin(phi)^2)+(diff(K*sin(phi)*(diff(h(theta, phi,
t), phi)), phi))/(r^2*sin(phi)) ;

sol := pdsolve(PDE, h(theta, phi, t));

but I really want to do it with Mathematica, as my Maple license will expire soon and only Mathematica will be available in my place.

Any ideas how I can convert this into Mathematica?

thanks.
 

FAQ: [Mathematica] Solving Heat Equation in Spherical Coordinates

How do I set up the heat equation in spherical coordinates using Mathematica?

To set up the heat equation in spherical coordinates, you will need to define the variables and parameters, as well as the initial and boundary conditions. You can use the built-in function NDSolve in Mathematica to numerically solve the heat equation in spherical coordinates.

How can I visualize the solution to the heat equation in spherical coordinates using Mathematica?

There are several ways to visualize the solution to the heat equation in spherical coordinates using Mathematica. You can use the Plot3D function to create a 3D plot of the temperature distribution, or the ContourPlot3D function to create a 3D contour plot. You can also use the Manipulate function to create an interactive visualization.

Can Mathematica solve the heat equation in spherical coordinates with varying thermal conductivity?

Yes, Mathematica can solve the heat equation in spherical coordinates with varying thermal conductivity. You will need to define the thermal conductivity as a function of the spatial coordinates and include it in the heat equation when setting up the problem.

How can I include a heat source term in the heat equation in spherical coordinates using Mathematica?

To include a heat source term in the heat equation in spherical coordinates, you will need to define the heat source as a function of the spatial coordinates and include it in the heat equation when setting up the problem. You can also use the NeumannValue function to specify a heat flux at the boundary.

Is there a built-in function in Mathematica for solving the heat equation in spherical coordinates?

Yes, the NDSolve function in Mathematica can be used to numerically solve the heat equation in spherical coordinates. However, you will need to set up the problem correctly and provide appropriate initial and boundary conditions for it to work effectively.

Similar threads

Replies
2
Views
461
Replies
1
Views
2K
Replies
6
Views
6K
Replies
9
Views
2K
Replies
19
Views
1K
Replies
1
Views
926
Replies
4
Views
1K
Replies
2
Views
693
Back
Top