Skip to main content
added and deleted tag
Link
bbgodfrey
  • 62.1k
  • 18
  • 92
  • 160
reformatted code
Source Link
bbgodfrey
  • 62.1k
  • 18
  • 92
  • 160
Clear[Hmp$, "*Hmp*", m, n, p, Nmax, "\[Psi]*"]"ψ*"]
Nmax = 10.; (*want 80*)
Hmp = Table[0, {p, Nmax}, {m, Nmax}];
 
Chop[ReplacePart[
  HmpChop[ReplacePart[Hmp, {m_, p_} :> (p^2 \[Pi]^2π^2)/2 KroneckerDelta[m, p] + 
    2 Integrate[
      Sin[mIntegrate[Sin[m \[Pi]π \[Chi]]χ] Sin[p \[Pi]π \[Chi]]χ] V[\[Chi]]V[χ], {\[Chi]χ, 0, 
       1}]]]
Clear[Hmp$, "*Hmp*", m, n, p, Nmax, "\[Psi]*"]
Nmax = 10.; (*want 80*)
Hmp = Table[0, {p, Nmax}, {m, Nmax}];
 
Chop[ReplacePart[
  Hmp, {m_, p_} :> (p^2 \[Pi]^2)/2 KroneckerDelta[m, p] + 
    2 Integrate[
      Sin[m \[Pi] \[Chi]] Sin[p \[Pi] \[Chi]] V[\[Chi]], {\[Chi], 0, 
       1}]]]
Clear[Hmp$, "*Hmp*", m, n, p, Nmax, "ψ*"]
Nmax = 10.; (*want 80*)
Hmp = Table[0, {p, Nmax}, {m, Nmax}];

Chop[ReplacePart[Hmp, {m_, p_} :> (p^2 π^2)/2 KroneckerDelta[m, p] + 
  2 Integrate[Sin[m π χ] Sin[p π χ] V[χ], {χ, 0, 1}]]]
added 32 characters in body
Source Link
Karsten7
  • 27.6k
  • 5
  • 74
  • 135

Clear[Hmp$, "Hmp", m, n, p, Nmax, "[Psi]*"] Nmax = 10.; (want 80) Hmp = Table[0, {p, Nmax}, {m, Nmax}];

Chop[ReplacePart[ Hmp, {m_, p_} :> (p^2 [Pi]^2)/2 KroneckerDelta[m, p] + 2 Integrate[ Sin[m [Pi] [Chi]] Sin[p [Pi] [Chi]] V[[Chi]], {[Chi], 0, 1}]]]

Clear[Hmp$, "*Hmp*", m, n, p, Nmax, "\[Psi]*"]
Nmax = 10.; (*want 80*)
Hmp = Table[0, {p, Nmax}, {m, Nmax}];

Chop[ReplacePart[
  Hmp, {m_, p_} :> (p^2 \[Pi]^2)/2 KroneckerDelta[m, p] + 
    2 Integrate[
      Sin[m \[Pi] \[Chi]] Sin[p \[Pi] \[Chi]] V[\[Chi]], {\[Chi], 0, 
       1}]]]

Clear[Hmp$, "Hmp", m, n, p, Nmax, "[Psi]*"] Nmax = 10.; (want 80) Hmp = Table[0, {p, Nmax}, {m, Nmax}];

Chop[ReplacePart[ Hmp, {m_, p_} :> (p^2 [Pi]^2)/2 KroneckerDelta[m, p] + 2 Integrate[ Sin[m [Pi] [Chi]] Sin[p [Pi] [Chi]] V[[Chi]], {[Chi], 0, 1}]]]

Clear[Hmp$, "*Hmp*", m, n, p, Nmax, "\[Psi]*"]
Nmax = 10.; (*want 80*)
Hmp = Table[0, {p, Nmax}, {m, Nmax}];

Chop[ReplacePart[
  Hmp, {m_, p_} :> (p^2 \[Pi]^2)/2 KroneckerDelta[m, p] + 
    2 Integrate[
      Sin[m \[Pi] \[Chi]] Sin[p \[Pi] \[Chi]] V[\[Chi]], {\[Chi], 0, 
       1}]]]
Source Link
Jacob
  • 11
  • 1
Loading