Skip to main content
Post Closed as "Duplicate" by J. M.'s missing motivation
made code more readable
Source Link
Lukas Lang
  • 34.4k
  • 1
  • 56
  • 99

I try to compute the coefficients b[i], i=2b[i] ,...m $i=2,...,m$. I got the following output.:

m := 20; \[Mu]
μ := 0.5
 
u[x_] := (12 \[Mu]^212*μ^2)/25 + (6/25 \[Mu]^2)*μ^2* Sech[(x \[Mu]x*μ)/5]^2 - 
 (12/25 \[Mu]^2 Tanh[)*μ^2*Tanh[(x \[Mu]x*μ)/5]; 
  
T[n_, x_] := \!\(\*UnderoverscriptBox[\(\[Sum]\), \(i = 0\), \(Ceiling[
\*FractionBox[\(n\), \(2\)]]\)]\(
\*SuperscriptBox[\((\(-1\))\), \(i\)] 
\*SuperscriptBox[\Sum[(2\-1), \^i*2^(n - 2  i2*i - 1\1)] 
\*FractionBox[\(n\ \*(\(n*(n - i - 1)\)!\)\), \(\((\/(i!\*(n - 2*i)!)\) \(\(*x^(n - 2*i), 
     2  {i)\)!\)\)] \*SuperscriptBox[\(x\), \(n - 2 0, i\)]\)\);Ceiling[n/2]}];

Table[b[n] = 
 (2/\[Pi] NIntegrate[Pi)*NIntegrate[(u[0.5 x5*x + 0.5] T[n5]*T[n, x])/Sqrt[
1Sqrt[1 - x^2], 
          {x, -1, 1}, PrecisionGoal -> 12], {n, 2, m}]

NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in x near {x} = {-0.99999999999999667104594803109799410885580269090806374709815354529}. NIntegrate obtained -0.0001047215230431864 and 7.698445916412437`*^-11 for the integral and error estimates. >>

NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in x near {x} = {0.99999999999999667104594803109799410885580269090806374709815354529}. NIntegrate obtained 2.330428756121359*^-6 and 7.096561136045723*^-11 for the integral and error estimates. >>

NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in x near {x} = {-0.99999999999999667104594803109799410885580269090806374709815354529}. NIntegrate obtained 4.308639728030708*^-8 and 7.540153824713211*^-11 for the integral and error estimates. >>

General::stop: Further output of NIntegrate::ncvb will be suppressed during this calculation. >>

NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in x near {x} = {-0.99999999999999667104594803109799410885580269090806374709815354529}. NIntegrate obtained -0.0001047215230431864 and 7.698445916412437`*^-11 for the integral and error estimates. >>

NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in x near {x} = {0.99999999999999667104594803109799410885580269090806374709815354529}. NIntegrate obtained 2.330428756121359`^-6 and 7.096561136045723`^-11 for the integral and error estimates. >>

NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in x near {x} = {-0.99999999999999667104594803109799410885580269090806374709815354529}. NIntegrate obtained 4.308639728030708`^-8 and 7.540153824713211`^-11 for the integral and error estimates. >>

General::stop: Further output of NIntegrate::ncvb will be suppressed during this calculation. >>

 {-0.00006666779216173972, 1.483597024240845*10^-6, 
 2.742965242872827*10^-8, -4.361781616250265*10^-10, \
-9.55048318138621*10^-12, 1.324805938959673*10^-13, 
 3.053277276241757*10^-15, 
 6.813896661329826*10^-16, -2.257310336427579*10^-15, \
-1.279952387436186*10^-15, 4.762549327712297*10^-15, 
 8.651550477286525*10^-15, 6.111965912879058*10^-14, 
 5.913733424919787*10^-14, -2.416647291094786*10^-13, \
-5.98964708075444*10^-13, -5.167457130207156*10^-13, 
 8.120386801889474*10^-13, 3.653845513969105*10^-12}

I try to compute the coefficients b[i], i=2,...m. I got the following output.

m := 20; \[Mu] := 0.5
 
u[x_] := (12 \[Mu]^2)/25 + 6/25 \[Mu]^2 Sech[(x \[Mu])/5]^2 - 
 12/25 \[Mu]^2 Tanh[(x \[Mu])/5];
T[n_, x_] := \!\(\*UnderoverscriptBox[\(\[Sum]\), \(i = 0\), \(Ceiling[
\*FractionBox[\(n\), \(2\)]]\)]\(
\*SuperscriptBox[\((\(-1\))\), \(i\)] 
\*SuperscriptBox[\(2\), \(n - 2  i - 1\)] 
\*FractionBox[\(n\ \(\((n - i - 1)\)!\)\), \(\((\(i!\))\) \(\((n - 
     2  i)\)!\)\)] \*SuperscriptBox[\(x\), \(n - 2  i\)]\)\);

Table[b[n] = 
 2/\[Pi] NIntegrate[(u[0.5 x + 0.5] T[n, x])/Sqrt[
1 - x^2], {x, -1, 1}, PrecisionGoal -> 12], {n, 2, m}]

NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in x near {x} = {-0.99999999999999667104594803109799410885580269090806374709815354529}. NIntegrate obtained -0.0001047215230431864 and 7.698445916412437`*^-11 for the integral and error estimates. >>

NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in x near {x} = {0.99999999999999667104594803109799410885580269090806374709815354529}. NIntegrate obtained 2.330428756121359*^-6 and 7.096561136045723*^-11 for the integral and error estimates. >>

NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in x near {x} = {-0.99999999999999667104594803109799410885580269090806374709815354529}. NIntegrate obtained 4.308639728030708*^-8 and 7.540153824713211*^-11 for the integral and error estimates. >>

General::stop: Further output of NIntegrate::ncvb will be suppressed during this calculation. >>

 {-0.00006666779216173972, 1.483597024240845*10^-6, 
 2.742965242872827*10^-8, -4.361781616250265*10^-10, \
-9.55048318138621*10^-12, 1.324805938959673*10^-13, 
 3.053277276241757*10^-15, 
 6.813896661329826*10^-16, -2.257310336427579*10^-15, \
-1.279952387436186*10^-15, 4.762549327712297*10^-15, 
 8.651550477286525*10^-15, 6.111965912879058*10^-14, 
 5.913733424919787*10^-14, -2.416647291094786*10^-13, \
-5.98964708075444*10^-13, -5.167457130207156*10^-13, 
 8.120386801889474*10^-13, 3.653845513969105*10^-12}

I try to compute the coefficients b[i] , $i=2,...,m$. I got the following output:

m := 20; 
μ := 0.5
u[x_] := (12*μ^2)/25 + (6/25)*μ^2* Sech[(x*μ)/5]^2 - (12/25)*μ^2*Tanh[(x*μ)/5]; 
  
T[n_, x_] := 
  Sum[(-1)^i*2^(n - 2*i - 1)*((n*(n - i - 1)!)/(i!*(n - 2*i)!))*x^(n - 2*i), 
       {i, 0, Ceiling[n/2]}];

Table[b[n] = (2/Pi)*NIntegrate[(u[0.5*x + 0.5]*T[n, x])/Sqrt[1 - x^2], 
          {x, -1, 1}, PrecisionGoal -> 12], {n, 2, m}]

NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in x near {x} = {-0.99999999999999667104594803109799410885580269090806374709815354529}. NIntegrate obtained -0.0001047215230431864 and 7.698445916412437`*^-11 for the integral and error estimates. >>

NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in x near {x} = {0.99999999999999667104594803109799410885580269090806374709815354529}. NIntegrate obtained 2.330428756121359`^-6 and 7.096561136045723`^-11 for the integral and error estimates. >>

NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in x near {x} = {-0.99999999999999667104594803109799410885580269090806374709815354529}. NIntegrate obtained 4.308639728030708`^-8 and 7.540153824713211`^-11 for the integral and error estimates. >>

General::stop: Further output of NIntegrate::ncvb will be suppressed during this calculation. >>

 {-0.00006666779216173972, 1.483597024240845*10^-6, 
 2.742965242872827*10^-8, -4.361781616250265*10^-10,
-9.55048318138621*10^-12, 1.324805938959673*10^-13, 
 3.053277276241757*10^-15, 
 6.813896661329826*10^-16, -2.257310336427579*10^-15,
-1.279952387436186*10^-15, 4.762549327712297*10^-15, 
 8.651550477286525*10^-15, 6.111965912879058*10^-14, 
 5.913733424919787*10^-14, -2.416647291094786*10^-13,
-5.98964708075444*10^-13, -5.167457130207156*10^-13, 
 8.120386801889474*10^-13, 3.653845513969105*10^-12}
Source Link

The coefficients with NIntegrate

I try to compute the coefficients b[i], i=2,...m. I got the following output.

m := 20; \[Mu] := 0.5

u[x_] := (12 \[Mu]^2)/25 + 6/25 \[Mu]^2 Sech[(x \[Mu])/5]^2 - 
12/25 \[Mu]^2 Tanh[(x \[Mu])/5];
T[n_, x_] := \!\(\*UnderoverscriptBox[\(\[Sum]\), \(i = 0\), \(Ceiling[
\*FractionBox[\(n\), \(2\)]]\)]\(
\*SuperscriptBox[\((\(-1\))\), \(i\)] 
\*SuperscriptBox[\(2\), \(n - 2  i - 1\)] 
\*FractionBox[\(n\ \(\((n - i - 1)\)!\)\), \(\((\(i!\))\) \(\((n - 
     2  i)\)!\)\)] \*SuperscriptBox[\(x\), \(n - 2  i\)]\)\);

Table[b[n] = 
2/\[Pi] NIntegrate[(u[0.5 x + 0.5] T[n, x])/Sqrt[
1 - x^2], {x, -1, 1}, PrecisionGoal -> 12], {n, 2, m}]

Here the message that before the results.

NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in x near {x} = {-0.99999999999999667104594803109799410885580269090806374709815354529}. NIntegrate obtained -0.0001047215230431864 and 7.698445916412437`*^-11 for the integral and error estimates. >>

NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in x near {x} = {0.99999999999999667104594803109799410885580269090806374709815354529}. NIntegrate obtained 2.330428756121359*^-6 and 7.096561136045723*^-11 for the integral and error estimates. >>

NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in x near {x} = {-0.99999999999999667104594803109799410885580269090806374709815354529}. NIntegrate obtained 4.308639728030708*^-8 and 7.540153824713211*^-11 for the integral and error estimates. >>

General::stop: Further output of NIntegrate::ncvb will be suppressed during this calculation. >>

 {-0.00006666779216173972, 1.483597024240845*10^-6, 
 2.742965242872827*10^-8, -4.361781616250265*10^-10, \
-9.55048318138621*10^-12, 1.324805938959673*10^-13, 
 3.053277276241757*10^-15, 
 6.813896661329826*10^-16, -2.257310336427579*10^-15, \
-1.279952387436186*10^-15, 4.762549327712297*10^-15, 
 8.651550477286525*10^-15, 6.111965912879058*10^-14, 
 5.913733424919787*10^-14, -2.416647291094786*10^-13, \
-5.98964708075444*10^-13, -5.167457130207156*10^-13, 
 8.120386801889474*10^-13, 3.653845513969105*10^-12}