Message Boards Message Boards

Quantum Mechanics Without Differential Equations

POSTED BY: Frank Kampas
9 Replies

I don't know how that could be done.

POSTED BY: Frank Kampas

Hello Frank,

is there any possibility that I can access IPOPTMinimize under Mma Version 7?

Hans

POSTED BY: Hans Dolhaine

I can approximate a simple harmonic oscillator as follows:

In[25]:= AbsoluteTiming[sho = cmpt[10000 (x - 1/2)^2, 5, 1/1000];]

During evaluation of In[25]:= {{Solve_Succeeded,1}}

During evaluation of In[25]:= {{Solve_Succeeded,1}}

During evaluation of In[25]:= {{Solve_Succeeded,1}}

During evaluation of In[25]:= {{Solve_Succeeded,1}}

During evaluation of In[25]:= {{Solve_Succeeded,1}}

Out[25]= {7.70231, Null}

 energy levels

In[26]:= sho[[1]]

Out[26]= {99.9994, 299.997, 499.992, 699.985, 899.977}

 test spacing

In[27]:= Table[sho[[1, n]]/(n - 1/2), {n, 5}]

Out[27]= {199.999, 199.998, 199.997, 199.996, 199.995}

In[28]:= Table[ListPlot[Table[{x, psi[x]}, {x, 0, 1, 1/100}] /. sho[[2, n]], 
  Joined -> True], {n, 5}]

enter image description here

POSTED BY: Frank Kampas

Hans,

Some years ago I wrote a Mathematica interface to Ipopt, using MathLInk. After that I bugged Wolfram Research to do something like that in Mathematica and they did a better job than I had. Using ParametricIpoptMInimize, I can set up the problem once and then run it multiple times with different starting values for the variables, with no extra overhead. I find that it can be much more powerful than NMinimize.

Frank

POSTED BY: Frank Kampas

Hello Frank,

I don't know what has happened earlier, but in the meantime I could download and open the notebook. Alas, to no avail, because I have only Mathematica 7 and no access to ParametricIPOPTMinimize.

Beste Grüße Hans

POSTED BY: Hans Dolhaine

Hans, I can e-mail you the code I used for ParametricIPOPTMinimize, if you like.

POSTED BY: Frank Kampas

I didn't try collocation because I felt it would be easier to do optimization with a complicated objective function and a small number of constraints, as opposed to solving a lot of coupled equations from collocation. .

POSTED BY: Frank Kampas

Hello Frank,

looks impressive - cool.

I tried to run your code ( copy = ctrl c and paste = ctrl v , because I could not download your notebook: error message " Ooops, we couldn't ...." and I got lots of error messages.

Table::itform: Argument 5 at position 2 does not have the correct form for an iterator. >>

ReplaceAll::reps: {Join[cons1,{}]} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing. >>

Having a closer look I think the varable i in

Do[cons2 = Table[vars.varres[[j]] == 0, {j, i - 1}];

is not defined, nor do I find

iMin[........]

in the code.

Regards, Hans

POSTED BY: Hans Dolhaine

Dr. Frank: Neat application of IPOPT! Just curious how the optimization approach compares to solution via collocation method. I surmise the collocation might not (gracefully) handle the eigenfunction orthogonality constraint?

POSTED BY: Frank Iannarilli
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract