User Portlet User Portlet

Frank Kampas
Discussions
BoundaryStyle -> None appears to be the fastest.
Thanks.
The error message answers that question. For the method NDSolve`IDA, only machine real code is available. Unable to continue with complex values or beyond floating-point exceptions.
I suggest you give a simpler example of this type of problem.
Why is x=0 not a solution? In[3]:= Limit[(x + 1/x) - (-1 + 1/x), x -> 0] Out[3]= 1
In[1]:= (* Basis states are Sqrt[2] Sin[n \[Pi] x]*) bas[n_][x_] = Sqrt[2] Sin[n \[Pi] x]; In[2]:= (* Basis states are normalized *) FullSimplify[Integrate[bas[n][x]^2, {x, 0, 1}], Assumptions -> n \[Element]...
If your gradient were not so complicated, I'd suggested converting the problem to a differential equation and solving it with DSolve. However, I don't think DSolve can handle such a complicated problem.
You should post your code, using the code sample icon.
Energy Levels and Wavefunctions in a 2-D Infinite Square Well Potential are Computed By Minimizing the Expectation Values of the Wavefunction Energies. In[5]:= cmpt[pefunc_ (* potential energy function *), n_Integer (* number of...
In[5]:= sphcmpt[pefunc_, n_Integer, d_] := Block[{i, vars, psi, vwb, ener, enres, psires, varres, cons1, cons2, sln, wavefunctions}, (* define variables *) vars = Table[psi[r], {r, 0, 1, d}]; (* add bounds...