Numerical Integration Schemes for a Hemispherical Region











up vote
1
down vote

favorite












I am struggling with a problem that requires me to numerical integrate a function within a hemisphere. While the function is smooth, it is pretty nasty, extremely oscillatory and I have to calculate it at any given point approximately from solving another problem in Stokes flow.



At the moment, I have just naively been integrating it in a hemisphere by using spherical coordinates and doing trapezoid in the $theta$ dimension and Gaussian in the $p$ and $phi$ dimensions. The numerical answer I get out doesn't settle down until roughly 500,000-1 million quadrature points are used (it's pretty similar if I'm integrating over a cube and using Gaussian quadrature in all the dimensions). So a few questions



1) If I'm doing spherical, then the points are tending to cluster around the origin with my naive approach. What is a good way to weight the node in the $p$ dimension so they are more evenly distributed? I did some Googling and saw one suggestion of using a weighted Gaussian with a weight $x$, but I don't know a priori why that would be the best choice, and I can't find any clear lists or programs for Matlab for weighted Gaussian nodes and if I'm writing it from scratch I might as well use the most 'ideal' weight function I can.



2) Is it a terrible idea to just throw more Gaussian points at it? Should I instead be cutting up the region into smaller and smaller sections and using the same number of quadrature points in each region? If so, I'm not sure how to subdivide my hemispherical region in a reasonable way.



3) Any other suggestions?










share|cite|improve this question


























    up vote
    1
    down vote

    favorite












    I am struggling with a problem that requires me to numerical integrate a function within a hemisphere. While the function is smooth, it is pretty nasty, extremely oscillatory and I have to calculate it at any given point approximately from solving another problem in Stokes flow.



    At the moment, I have just naively been integrating it in a hemisphere by using spherical coordinates and doing trapezoid in the $theta$ dimension and Gaussian in the $p$ and $phi$ dimensions. The numerical answer I get out doesn't settle down until roughly 500,000-1 million quadrature points are used (it's pretty similar if I'm integrating over a cube and using Gaussian quadrature in all the dimensions). So a few questions



    1) If I'm doing spherical, then the points are tending to cluster around the origin with my naive approach. What is a good way to weight the node in the $p$ dimension so they are more evenly distributed? I did some Googling and saw one suggestion of using a weighted Gaussian with a weight $x$, but I don't know a priori why that would be the best choice, and I can't find any clear lists or programs for Matlab for weighted Gaussian nodes and if I'm writing it from scratch I might as well use the most 'ideal' weight function I can.



    2) Is it a terrible idea to just throw more Gaussian points at it? Should I instead be cutting up the region into smaller and smaller sections and using the same number of quadrature points in each region? If so, I'm not sure how to subdivide my hemispherical region in a reasonable way.



    3) Any other suggestions?










    share|cite|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I am struggling with a problem that requires me to numerical integrate a function within a hemisphere. While the function is smooth, it is pretty nasty, extremely oscillatory and I have to calculate it at any given point approximately from solving another problem in Stokes flow.



      At the moment, I have just naively been integrating it in a hemisphere by using spherical coordinates and doing trapezoid in the $theta$ dimension and Gaussian in the $p$ and $phi$ dimensions. The numerical answer I get out doesn't settle down until roughly 500,000-1 million quadrature points are used (it's pretty similar if I'm integrating over a cube and using Gaussian quadrature in all the dimensions). So a few questions



      1) If I'm doing spherical, then the points are tending to cluster around the origin with my naive approach. What is a good way to weight the node in the $p$ dimension so they are more evenly distributed? I did some Googling and saw one suggestion of using a weighted Gaussian with a weight $x$, but I don't know a priori why that would be the best choice, and I can't find any clear lists or programs for Matlab for weighted Gaussian nodes and if I'm writing it from scratch I might as well use the most 'ideal' weight function I can.



      2) Is it a terrible idea to just throw more Gaussian points at it? Should I instead be cutting up the region into smaller and smaller sections and using the same number of quadrature points in each region? If so, I'm not sure how to subdivide my hemispherical region in a reasonable way.



      3) Any other suggestions?










      share|cite|improve this question













      I am struggling with a problem that requires me to numerical integrate a function within a hemisphere. While the function is smooth, it is pretty nasty, extremely oscillatory and I have to calculate it at any given point approximately from solving another problem in Stokes flow.



      At the moment, I have just naively been integrating it in a hemisphere by using spherical coordinates and doing trapezoid in the $theta$ dimension and Gaussian in the $p$ and $phi$ dimensions. The numerical answer I get out doesn't settle down until roughly 500,000-1 million quadrature points are used (it's pretty similar if I'm integrating over a cube and using Gaussian quadrature in all the dimensions). So a few questions



      1) If I'm doing spherical, then the points are tending to cluster around the origin with my naive approach. What is a good way to weight the node in the $p$ dimension so they are more evenly distributed? I did some Googling and saw one suggestion of using a weighted Gaussian with a weight $x$, but I don't know a priori why that would be the best choice, and I can't find any clear lists or programs for Matlab for weighted Gaussian nodes and if I'm writing it from scratch I might as well use the most 'ideal' weight function I can.



      2) Is it a terrible idea to just throw more Gaussian points at it? Should I instead be cutting up the region into smaller and smaller sections and using the same number of quadrature points in each region? If so, I'm not sure how to subdivide my hemispherical region in a reasonable way.



      3) Any other suggestions?







      integration numerical-methods numerical-optimization






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Nov 15 at 19:16









      Fractal20

      593418




      593418



























          active

          oldest

          votes











          Your Answer





          StackExchange.ifUsing("editor", function () {
          return StackExchange.using("mathjaxEditing", function () {
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          });
          });
          }, "mathjax-editing");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "69"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3000165%2fnumerical-integration-schemes-for-a-hemispherical-region%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3000165%2fnumerical-integration-schemes-for-a-hemispherical-region%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Plaza Victoria

          Brian Clough

          Cáceres