Mathematica problem involving integral

Click For Summary

Discussion Overview

The discussion revolves around using Mathematica to plot the heat capacity of a solid as described by Debye theory. Participants explore how to implement numerical integration using NIntegrate and address challenges related to variable limits in integration.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant suggests creating a vector of values for T/θ using "Table" to facilitate plotting C_v/3Nk.
  • Another participant proposes creating a function directly for plotting, indicating that a table may not be necessary.
  • A participant expresses difficulty with NIntegrate due to the variable upper limit of integration, leading to warnings and incorrect results.
  • Another participant advises using delayed evaluation (:=) for NIntegrate to avoid errors when the upper limit is a variable.
  • One participant reflects on the learning curve of Mathematica but acknowledges its power once familiar.
  • Discussion includes thoughts on the potential for cloud services to enhance Mathematica's performance compared to traditional programming languages like Fortran.
  • Another participant questions the feasibility of sending Mathematica notebooks to cloud computers for evaluation, highlighting the advantages of Mathematica in simplifying physicists' work.

Areas of Agreement / Disagreement

Participants generally agree on the utility of Mathematica for the task at hand, but there are differing opinions on the best approach to implement the plotting and integration. The discussion remains unresolved regarding the optimal method for handling variable limits in NIntegrate.

Contextual Notes

Participants express uncertainty about the implications of variable limits in numerical integration and the specific syntax required in Mathematica. There is also a lack of consensus on the necessity of using a table versus a direct function for plotting.

Who May Find This Useful

Individuals interested in computational physics, numerical methods, and those learning to use Mathematica for mathematical modeling and data visualization.

issacnewton
Messages
1,035
Reaction score
37
Hi

We know that in Debye theory,

[tex]C_v=9kN\left(\frac{T}{\theta}\right)^3 \int_0^{\theta/T} \frac{x^4 e^x}{(e^x-1)^2}\;dx[/tex]

is the heat capacity of the solid. I want to plot [itex]C_v/3Nk[/itex] as a function of [itex]T/ \theta[/itex] from 0.001 to 1.4 using mathematica. The hint says to use NIntegrate. Now should I first create a vector of values of [itex]T/ \theta[/itex] from 0.001 to 1.4 using "Table" ? Then maybe I can feed this vector to NIntegrate which could be placed inside another "Table"
statement.

any help ?
 
Technology news on Phys.org
No need for a table. Just create a function that does what you want and plot it, like the attached notebook.
 

Attachments

thanks, I tried to do something like that, but since the upper limit of the integration is
a variable itself, NIntegrate tried to give warning and didn't seem to give correct answer
 
Post what you did and we can probably figure out why.
Note that if you ask for immediate evaluation (=), and the limit of NIntegrate is a variable, then it can't evaluate and will give you an error. That's why I asked for delayed evaluation(:=), so it doesn't try to evaluate NIntegrate until after it has been supplied with a numeric limit. In this case, it doesn't even try to evaluate NIntegrate until it is making the plot and Plot has supplied it with a number to integrate up to.
 
You nailed it... that was the problem... mathematica is very easy once we become familiar with it...

I read on their website that they are coming up with cloud services... In that case, people don't have to worry about the slower processing time of mathematica as compared to say, Fortran...since cloud servers are very powerful...
 
Yes, Mathematica definitely has a learning curve, but it is very powerful once you become familiar with it.
 
do you think it will be possible send mathematica notebooks to cloud computers for evaluation since ordinary computers don't have memory sometimes. mathematica simplifies the work of a physicist to a great extent. if you are programming in say fortran, then lot of time is spent in thinking about the programming issues.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 43 ·
2
Replies
43
Views
6K
  • · Replies 6 ·
Replies
6
Views
7K