Results 1 to 8 of 8

Math Help - Calculate the area between the calibration curve and the identity line on a graph

  1. #1
    Newbie
    Joined
    Aug 2009
    Posts
    8

    Calculate the area between the calibration curve and the identity line on a graph

    Hi all,

    I am working part-time at the university, and my background is not in mathematics, therefore I have a (probably easy) question that I need help with.

    I have a graph with two lines: a identity line (x = y) and a calibration curve. I need to calculate the area between the calibration curve and the identity line. The calibration curve might be below or above the identity line. Any ideas?

    I have no clue where to start ( my last maths class was in school ).

    Thanks in advance,
    s.t.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor

    Joined
    Apr 2005
    Posts
    15,977
    Thanks
    1643
    If all you are given is the graph, then it is probably best to approximate the calibration curve by a series of short straight lines, find the area of each trapezoid between the calibration curve and y=x and add them.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Aug 2009
    Posts
    8
    Thank you for the reply HallsofIvy. Sorry, I should have mentioned that I do have the exact x,y co-ordinates for the calibration curve. Therefore, is there a way to calculate the exact area, rather than to estimate it? I previously looked at something like the gini-coefficient to calculate the area (b) of the calibration curve. However am not sure whether it's the correct way to go about it :-)

    Thank you very much :-)
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor

    Joined
    Apr 2005
    Posts
    15,977
    Thanks
    1643
    What do you mean you "have the exact x,y coordinates"? Are you given a function describing the graph? If so, then the area is \int |f(x)- x|dx. What is the function? However, it is still true that most functions cannot be integrated in terms of elementary functions so it might still be necessary to use a trapezoid rule or Simpson's rule approximation.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Aug 2009
    Posts
    8
    Basically I have an array containing entries for x and y co-ordinates that I use to plot the calibration curve. I want to use these points to calculate the area of the curve.

    I'm sorry for being a pain, but I don't quite understand your solution :s

    Thanks for the help :-)
    Follow Math Help Forum on Facebook and Google+

  6. #6
    MHF Contributor

    Joined
    Apr 2005
    Posts
    15,977
    Thanks
    1643
    Then you are NOT "given" the function itself, you are given a numerical approximation to it and the best you can do is a numerical approximation to the area. Use either the "trapezoid" rule or "Simpson's rule" (from any Calculus book or google them) to integrate \int |f(x)- x|dx.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Super Member
    Joined
    Aug 2008
    Posts
    903
    I suggest you do the following: Run the data points in Mathematica using Fit to obtain a least-square fit function. Then integrate the difference. The code below just makes up a table of points corresponding randomly to the function 0.1 x^2. I then run Fit to obtain a least-square fit I cal myFunction. I then plot the function y=x, y=myFunction, and also the list of points I generated. Finally, I use Integrate to integrate the area between myFunction and x in the range 0 to 5. I use Abs below to get the total area if the calib curve dips below y=x. If you're not familiar with this, try and get someone there to help you with the details.

    Code:
    myList = Table[{xval, 0.1 xval^2 +
     RandomReal[{-0.5, 0.5}]}, {xval, 0,
         5, 0.1}];
    ListPlot[myList]
    myFunction = Fit[myList, {1 + x + x^2 + x^3}, x]
    Show[{ListPlot[myList], Plot[{x, myFunction}, {x, 0, 5}]}]
    Integrate[Abs[x - myFunction], {x, 0, 5}]
    Attached Thumbnails Attached Thumbnails Calculate the area between the calibration curve and the identity line on a graph-picc.jpg  
    Last edited by shawsend; August 29th 2009 at 12:05 PM. Reason: Added Abs to get total area
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Newbie
    Joined
    Aug 2009
    Posts
    8
    Thanks Hallsofivy and shawsend! That helped! Getting the hang of it now :-) :-)
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. area between a line and a curve
    Posted in the Calculus Forum
    Replies: 1
    Last Post: June 2nd 2010, 02:07 AM
  2. calculate line integral and draw curve C
    Posted in the Calculus Forum
    Replies: 4
    Last Post: December 8th 2009, 01:00 PM
  3. area between curve and tangent line
    Posted in the Calculus Forum
    Replies: 4
    Last Post: April 28th 2009, 10:57 AM
  4. area under curve and line.
    Posted in the Calculus Forum
    Replies: 6
    Last Post: April 24th 2009, 11:00 AM
  5. Area between line and curve
    Posted in the Calculus Forum
    Replies: 2
    Last Post: May 7th 2008, 02:56 PM

Search Tags


/mathhelpforum @mathhelpforum