Mathematica returns non-numerical integrand while minimizing

  • Thread starter Thread starter physstudent.4
  • Start date Start date
  • Tags Tags
    Mathematica
physstudent.4
Messages
12
Reaction score
0

Homework Statement


I need to minimize the function Etrial[a]
trial[x_] := E^(-a*x^2)
Etrial[a_] :=
NIntegrate[1/2*D[trial[x], x]^2 + x^4*trial[x]^2, {x, -\[Infinity], \[Infinity]}]/
NIntegrate[trial[x]^2, {x, -\[Infinity], \[Infinity]}]


Homework Equations





The Attempt at a Solution


I have used NMinimize[Etrial[a],a] and Minimize[Etrial[a],a], as well as FindMiminum[Etrial[a],{a,.5}], since when I plot it, the minimum is pretty obviously around .7, so I arbitrarily chose .5 as a close starting point.
 
Physics news on Phys.org
Use Integrate instead of NIntegrate. Also, you can actually do the integrals and write the expressions down in closed form. If you define Etrial using those results, it'll be a lot faster since Mathematica won't have to repeatedly perform the integrations.
 
I ended up just writing a separate loop that found the minimum. I discovered if I had written my trial function as a function of both x and a, then used partial derivatives, Mathematica can handle that easier. Thanks anyway though!
 
Thread 'Need help understanding this figure on energy levels'
This figure is from "Introduction to Quantum Mechanics" by Griffiths (3rd edition). It is available to download. It is from page 142. I am hoping the usual people on this site will give me a hand understanding what is going on in the figure. After the equation (4.50) it says "It is customary to introduce the principal quantum number, ##n##, which simply orders the allowed energies, starting with 1 for the ground state. (see the figure)" I still don't understand the figure :( Here is...
Thread 'Understanding how to "tack on" the time wiggle factor'
The last problem I posted on QM made it into advanced homework help, that is why I am putting it here. I am sorry for any hassle imposed on the moderators by myself. Part (a) is quite easy. We get $$\sigma_1 = 2\lambda, \mathbf{v}_1 = \begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix} \sigma_2 = \lambda, \mathbf{v}_2 = \begin{pmatrix} 1/\sqrt{2} \\ 1/\sqrt{2} \\ 0 \end{pmatrix} \sigma_3 = -\lambda, \mathbf{v}_3 = \begin{pmatrix} 1/\sqrt{2} \\ -1/\sqrt{2} \\ 0 \end{pmatrix} $$ There are two ways...

Similar threads

Replies
13
Views
2K
Replies
1
Views
2K
Replies
34
Views
4K
Replies
4
Views
3K
Replies
6
Views
5K
Replies
7
Views
2K
Back
Top