Skip to main content
added 12 characters in body
Source Link
Michael E2
  • 245k
  • 18
  • 351
  • 775

The problem is that some of the integrals vanish (also suggested in the NIntegrate::slwcon warning), which makes it impossible to achieve an error goal determined exclusively by relative precision. This is what happens by default, because the setting for AccuracyGoal is Infinity. Use a finite AccuracyGoal that is appropriate for the magnitude of the integrand and the working precision. For machine precision and yourthe integrands in rules4, which have maxima on the order of 10^0 == 1, use $MachinePrecision or 16.

NIntegrate[rules4[[All, 2]], {x2, 0, L2}, AccuracyGoal -> $MachinePrecision]
(*
{0.5, 0., -5.55112*10^-17, 0.848826, -0.339531, 0.21827, 0.5, 
 5.55112*10^-17, 0.509296, 0.727565, -0.282942, 0.5, -0.121261, 
 0.565884, 0.694494, 0.5, -9.10214*10^-18, 6.7447*10^-17, 0.5, 
 2.22967*10^-16, 0.5}
*)

The problem is that some of the integrals vanish (also suggested in the NIntegrate::slwcon warning), which makes it impossible to achieve an error goal determined exclusively by relative precision. This is what happens by default, because the setting for AccuracyGoal is Infinity. Use a finite AccuracyGoal that is appropriate for the magnitude of the integrand and the working precision. For machine precision and your integrands which have maxima on the order of 10^0 == 1, use $MachinePrecision or 16.

NIntegrate[rules4[[All, 2]], {x2, 0, L2}, AccuracyGoal -> $MachinePrecision]
(*
{0.5, 0., -5.55112*10^-17, 0.848826, -0.339531, 0.21827, 0.5, 
 5.55112*10^-17, 0.509296, 0.727565, -0.282942, 0.5, -0.121261, 
 0.565884, 0.694494, 0.5, -9.10214*10^-18, 6.7447*10^-17, 0.5, 
 2.22967*10^-16, 0.5}
*)

The problem is that some of the integrals vanish (also suggested in the NIntegrate::slwcon warning), which makes it impossible to achieve an error goal determined exclusively by relative precision. This is what happens by default, because the setting for AccuracyGoal is Infinity. Use a finite AccuracyGoal that is appropriate for the magnitude of the integrand and the working precision. For machine precision and the integrands in rules4, which have maxima on the order of 10^0 == 1, use $MachinePrecision or 16.

NIntegrate[rules4[[All, 2]], {x2, 0, L2}, AccuracyGoal -> $MachinePrecision]
(*
{0.5, 0., -5.55112*10^-17, 0.848826, -0.339531, 0.21827, 0.5, 
 5.55112*10^-17, 0.509296, 0.727565, -0.282942, 0.5, -0.121261, 
 0.565884, 0.694494, 0.5, -9.10214*10^-18, 6.7447*10^-17, 0.5, 
 2.22967*10^-16, 0.5}
*)
Source Link
Michael E2
  • 245k
  • 18
  • 351
  • 775

The problem is that some of the integrals vanish (also suggested in the NIntegrate::slwcon warning), which makes it impossible to achieve an error goal determined exclusively by relative precision. This is what happens by default, because the setting for AccuracyGoal is Infinity. Use a finite AccuracyGoal that is appropriate for the magnitude of the integrand and the working precision. For machine precision and your integrands which have maxima on the order of 10^0 == 1, use $MachinePrecision or 16.

NIntegrate[rules4[[All, 2]], {x2, 0, L2}, AccuracyGoal -> $MachinePrecision]
(*
{0.5, 0., -5.55112*10^-17, 0.848826, -0.339531, 0.21827, 0.5, 
 5.55112*10^-17, 0.509296, 0.727565, -0.282942, 0.5, -0.121261, 
 0.565884, 0.694494, 0.5, -9.10214*10^-18, 6.7447*10^-17, 0.5, 
 2.22967*10^-16, 0.5}
*)