Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Volume beneath a two-dimensional polynomial

  1. Apr 24, 2013 #1
    Hello

    Firstly apologies for what seems like an extremely fundamental question, it's been a while since I've done any calculus!

    I'm currently using a program to fit data with a two dimensional 3 degree polynomial curve( which outputs the fit in the following format) with the aim of calculating the volume between the curve and the baseline:
    z = a + bx + cy + d(x^2) + exy + f(y^2) + g(x^3) + h(x^2y) + i(xy^2) + j(y^3)

    However I'm struggling to integrate this w.r.t. dydx within the fit range, having previously only calculated areas in this way.

    An ideal solution would be to calculate the volume by inputting the constants into a script,as is possible with two dimensional Gaussians. Since there are >200 curves to analyse per dataset so integrating each fit manually will be extremely labour intensive!

    Thanks in advance for any replies,
    Billy
     
  2. jcsd
  3. Apr 25, 2013 #2

    haruspex

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    Do you mean that you want the volume between the surface and z=0? If so, how are the bounds of the integration defined? Are there specific ranges of x and y? Can the surface go below z=0 anywhere in the range? If so, how do you want to treat that?
     
  4. Apr 25, 2013 #3
    Hi haruspex,

    Yes I want the volume between the surface and z=0. The bounds of the integration are manually defined e.g. 0 and 20 in x and y. Assuming a good fit, no, the surface should not go below z=0 within the range as this is below the parameters of the dataset, however if this occurs then I would only want to count the volume above z=0.

    Thanks
    Billy
     
  5. Apr 25, 2013 #4

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    If I understand this correctly you want the volume beneath [itex]z = a + bx + cy + d(x^2) + exy + f(y^2) + g(x^3) + h(x^2y) + i(xy^2) + j(y^3)[/itex], above the xy-plane, z= 0, and bounded on the sides by the planes x= 0, x= 20, y= 0, and y= 20. That is, of course,
    [tex] \int_{x=0}^{20}\int_{y= 0}^{20}(a+ bx+ cy+ dx^2+ exy+ fy^2+ gx^3+ hx^2y+ jy^3)dx[/tex]
    [tex] = \left[ax+ bx^2/2+ cy^2/2+ dx^3/3+ ex^2y/2+ exy^2/2+ fy^3/3+ gx^4/4+ yx^3y/3+ hx^2y^2/2+ jy^4/4\right]_{x=0, y=0}^{x=20, y=20}[/tex].
     
    Last edited by a moderator: Apr 25, 2013
  6. Apr 25, 2013 #5

    haruspex

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    To cover that eventuality, you will need to find whereabouts z<0 and remove those areas from the integral. Finding those areas is messy (solving a cubic) and skirting around them in the integral could get very difficult. Maybe you could check for whether it's likely to happen just by evaluating z across a grid of points.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Volume beneath a two-dimensional polynomial
Loading...