+ Reply to Thread
Results 1 to 10 of 10

Need code for maximum (peak) values from graph

  1. #1
    Forum Contributor
    Join Date
    08-27-2016
    Location
    INDIA
    MS-Off Ver
    2003,2007,2010
    Posts
    134

    Question Need code for maximum (peak) values from graph

    Hiii Friends,

    how are you? i need code for extract peak maximum values from graph. please find sample attachment.


    Best wishes.
    Attached Files Attached Files
    Last edited by structo; 04-27-2017 at 02:03 AM.

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Need code for maximum (peak) values from graph

    How is the Peak Maximum Value calculated?
    Cheers!
    Deep Dave

  3. #3
    Forum Contributor
    Join Date
    08-27-2016
    Location
    INDIA
    MS-Off Ver
    2003,2007,2010
    Posts
    134

    Re: Need code for maximum (peak) values from graph

    Quote Originally Posted by NeedForExcel View Post
    How is the Peak Maximum Value calculated?
    Hii friend, i have entered peaks values manually at cells by reading of generated graph. so any automation instead of manual entry of values?

    Best wishes.

  4. #4
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Need code for maximum (peak) values from graph

    So basically you want to find Dry density & Moisture from the graph?

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: Need code for maximum (peak) values from graph

    Here's how I would probably do it:

    Regress or otherwise determine an equation for dry density as a function of moisture content. rho(dry)=f(x(H2O)).
    1) Often the "hardest" part of performing the regression is choosing what kind of equation to use for f. I have no idea what it should look like, though you might look at your sequence of functions in rows 6 to 15 (and maybe spend some time algebraically manipulating those equations) to see what ideas anc conclusions you come to. For empirical regressions, we often default to polynomials because they are linear and easy to work with, but they are not always well behaved. If you choose a linear function (such as a polynomial), you can use the chart trendline feature (you should probably change your chart from a line chart to an XY scatter chart) or use the LINEST() function.
    2) Once you have f(x), then you can simply use your calculus from high school to find the "critical point(s)" of f(x), and then determine which is the maximum. (Here's one tutorial, if you need a refresher: https://www.khanacademy.org/math/ap-...ritical-points ).

    Sometimes, Solver can be a useful tool for these kinds of problems. https://support.office.com/en-us/art...d-078f96d1652c You need to identify your A) objective function (probably dry density) and your B) Decision variables (water content or something) and C) any constraints, then have Solver find the maximum of that objective function.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Forum Contributor
    Join Date
    08-27-2016
    Location
    INDIA
    MS-Off Ver
    2003,2007,2010
    Posts
    134

    Re: Need code for maximum (peak) values from graph

    Quote Originally Posted by NeedForExcel View Post
    So basically you want to find Dry density & Moisture from the graph?
    Yes friend exactly.

  7. #7
    Forum Contributor
    Join Date
    08-27-2016
    Location
    INDIA
    MS-Off Ver
    2003,2007,2010
    Posts
    134

    Re: Need code for maximum (peak) values from graph

    Quote Originally Posted by MrShorty View Post
    Hi friend, thank you for your response. how adopt those functions to my sheet?

  8. #8
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: Need code for maximum (peak) values from graph

    I'm not sure I can make any solid recommendations until you do the math/algebra part to give me a better idea of what f should look like.

    If you really have no idea where to begin, I would suggest that you use the chart trendline feature to add a polynomial trendline: https://support.office.com/en-us/art...4-901a745842ad Then you can use the coefficients of that trendline (be sure to format to show coefficients to full precision) to find the maximum value (either using calculus or using Solver). That , of course, assumes that a polynomial is an adequate choice for f.

  9. #9
    Forum Contributor
    Join Date
    08-27-2016
    Location
    INDIA
    MS-Off Ver
    2003,2007,2010
    Posts
    134

    Re: Need code for maximum (peak) values from graph

    Quote Originally Posted by MrShorty View Post
    I'm not sure I can make any solid recommendations until you do the math/algebra part to give me a better idea of what f should look like.
    Dear friend, thank you for reply. please find my sample file. i have already added trendline in my excel graph. i need extract maximum value of
    Density and corresponding moisture content value from trend line.

    Best wishes.

  10. #10
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: Need code for maximum (peak) values from graph

    I did not see the trendline in the chart in your sample file. Once you have the trendline equation (assuming it is a polynomial), then decide which approach you want to use. Do you want to use Solver to approximate the maximum value (probably easiest and more flexible), or do you want an exact value using calculus (which will require differentiation and root finding algorithms)?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 7
    Last Post: 10-07-2015, 03:01 PM
  2. Replies: 10
    Last Post: 10-07-2013, 11:41 AM
  3. Maximum Width of Lines in Line Graph
    By neutrino in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 12-05-2007, 04:28 PM
  4. mixed graph maximum bars
    By pkm in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-13-2007, 03:07 AM
  5. how can I mark the maximum point on x-y graph
    By MAJ-BEHNAM in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-30-2006, 06:40 AM
  6. finding the coordinates of the maximum point on a graph
    By eastham85 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-16-2005, 10:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1