MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Problem when NIntegrate matrix


Hi all!

I can not understand why there is a NIntegrate::inum error when I try to evaluate the following code

TEST = Piecewise[{
     {{{1, 2, 3}, {2, 3, 4}, {3, 4, 5}}, #1 < 0.00},
     {{{2, 3, 4}, {3, 4, 5}, {4, 5, 6}}, #1 >= 0.00},
     }] &;

NIntegrate[TEST[x], {x, -1, +1}]

However, I can get the correct result by modifying the code manually. That is

NIntegrate[{{1, 2, 3}, {2, 3, 4}, {3, 4, 5}}, {x, -1, 0}]+NIntegrate[{{2, 3,4}, {3, 4, 5}, {4, 5, 6}}, {x, 0, 1}]

However, it is impossible for me to manually split the integration range to thousands of segments. Why this happens? What should I do if I want the first code be evaluated correctly?

Thanks!


  • Prev by Date: Identifying Linearly Dependent Equations
  • Next by Date: Re: coupled map lattice problem
  • Previous by thread: Supercomputing Engine for Mathematica (SEM) now available
  • Next by thread: Re: Problem when NIntegrate matrix