+ Reply to Thread
Results 1 to 10 of 10

Plotting U,Z variables from X,U and X,Z experimental data tables

  1. #1
    Registered User
    Join Date
    04-16-2013
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2013
    Posts
    5

    Post Plotting U,Z variables from X,U and X,Z experimental data tables

    Hi guys!

    I've been struggling from some time with this problem...

    Well, I'm going to try to be clear with my explanation:

    I have two data tables from laboratory tests, using two different equipment. The first table is time (X) versus Stress (U). The second table is time (X) and Hit counts (Z). Despite that initial zero time is the same in both tables, the time values (instants) are different.

    I can plot a chart with double Y-axis (U and Z), having two series but I would like to draw a U vs Z scatter chart.

    In the attachment I send na example for my type of data.

    Anyone can please help me to solve my problem?

    Thanks a lot!
    Attached Files Attached Files

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Plotting U,Z variables from X,U and X,Z experimental data tables

    Please Login or Register  to view this content.
    I added an interpolation function, so it's an xlsm file now.
    Attached Files Attached Files
    Entia non sunt multiplicanda sine necessitate

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

    Re: Plotting U,Z variables from X,U and X,Z experimental data tables

    What is needed is a new table with values for u and z at the same values for x. The hardest part of a problem like this is going to be deciding how best to obtain values for u and z at an arbitrary x. I use 2 general approaches:

    1) curve fitting/regression: If I can readily identify a function that will fit my data, I will regress a function that I can then use to obtain u and z at any value for x. In this case, I don't see an obvious simple function that would fit the data.
    2) linear interpolation: Linear interpolation can be a simple method to obtain "intermediate" values from a table of values like you have. Unfortunately, Excel does not have a built in linear interpolation function (Quattro Pro does, and other spreadsheets might, if you are not bound to Excel). If you are bound to Excel, and you choose to use linear interpolation, you will have to come up with an algorithm for it. We discuss it many times on this forum, and I've even seen a few UDF's for it (such as the one included in shg's file), so you might search this forum carefully if you are not sure how to program linear interpolation.

    In setting up the table, I would probably pick one of the two that you have, and add a third column to that table. The table might look something like:
    Please Login or Register  to view this content.
    where the "linterp" function is whatever you end up using for the "z at arbitrary x" function. Once this table is in place, it should be easy to plot column B vs. column C in a scatter plot.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Registered User
    Join Date
    04-16-2013
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Plotting U,Z variables from X,U and X,Z experimental data tables

    Thank you shg!
    Unfortunatly my Excel version (2013) in portuguese does not recognize Linterp function. I don't really know if it's a "language problema" or a version problem.
    But, anyway I'm going to make a question: This linear interpolation is a general interpolation or a point-by-point interpolation from time vs. hit number table?

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Plotting U,Z variables from X,U and X,Z experimental data tables

    1. It's a user-defined function I added to the workbook. You have to enable macros for it to work.

    2. It is a linear intepolation between adjacent points.

  6. #6
    Registered User
    Join Date
    04-16-2013
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Plotting U,Z variables from X,U and X,Z experimental data tables

    Thank you Mr. Shorty.

    In deed it is not possible to adjust my original data to any fitting/regression... I thought firstly that the best way to make this is to make a point-to-point linear regression from one of the tables and adjust time to a single counter and I think that this is not possible in Excel, right?

  7. #7
    Registered User
    Join Date
    04-16-2013
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Plotting U,Z variables from X,U and X,Z experimental data tables

    Ok Thank you so much shg... I'm gonna try and then I reply...

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

    Re: Plotting U,Z variables from X,U and X,Z experimental data tables

    I thought firstly that the best way to make this is to make a point-to-point linear regression from one of the tables and adjust time to a single counter and I think that this is not possible in Excel, right?
    It is most certainly possible in Excel, but Excel does not have a built in function for it. shg's UDF should do exactly what you want (to one decimal place, he gets the same thing my own LINTERP() UDF outputs).

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Plotting U,Z variables from X,U and X,Z experimental data tables

    to one decimal place, he gets the same thing my own LINTERP()
    One significant digit is all we share?

  10. #10
    Registered User
    Join Date
    04-16-2013
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Plotting U,Z variables from X,U and X,Z experimental data tables

    Hi guyz!

    The application of the macro that you gave me worked quite well in my data! Problem solved!

    In fact, I'm nor quite familiar to macros in Excel and now is a good justification to learn it!

    Thank you so much for your help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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