Forum Discussion

theDeCoder01's avatar
theDeCoder01
Copper Contributor
Mar 16, 2025
Solved

Slope equation calculation (Is it the same as trendline?)

Hi there,

 

I'm trying to calibrate a temperature monitoring system in reference to a calibrated one.

The relation is not linear, so the difference equation is not linear.

This is where Excel comes in handy.

I stuck both in water in the same environment at the same sampling frequency and generated a lot of points at a large temperature scale.

Using a scatter chart, I generated a 4th-degree polynomial trendline that describes the relation between the both, with R2=0.9998.

However, when using the equation to convert one value of one device to the equivalent in the other, the trendline equation throws random numbers at me, which makes me think that the trendline eq. and the slope eq. are not the same. I can share my date with anyone who is interested.

 

Any idea on where I went wrong?

 

Thanks!

  • HansVogelaar's avatar
    HansVogelaar
    Mar 19, 2025

    The forum has been broken since late 2024. I only now got a notification of your reply.

    For a 4th degree polynomial, you can't just calculate the slope - you have to calculate the coefficients for x, x^2, x^3 and x^4. For OpSens CH2 to PICO CH1:

    To use this to predict/interpolate values:

    These values look reasonable to me.

  • JKPieterse's avatar
    JKPieterse
    Silver Contributor

    The displayed equation of a trendline may have rounded constants. You can change the number format of the equation by clicking on it and then hitting the short-cut key combination Control+1.

    You can then set options like these:

     

    • theDeCoder01's avatar
      theDeCoder01
      Copper Contributor

      Hey JKPieterse,

      IDK what happened to my first reply to you, but here we go again:

      Thank you very much for your input! It did help! Now, the numbers are not random. However, they are still not right.

      I'll share a sheet of my workbook with the first graph implementing your idea.

       

      Thanks!

    • theDeCoder01's avatar
      theDeCoder01
      Copper Contributor

      Hey JKPieterse,

      Thank you for your input! that helped!

      The numbers now are not random, however, they are still not correct.

      I'll try to share my workbook.

       

      Thanks!

  • Could you attach a small sample workbook demonstrating the problem (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar?

    • theDeCoder01's avatar
      theDeCoder01
      Copper Contributor

      Hey Hans,

      Thank you for your input!

      IDK what happened to my first reply. However, attached is one sheet of my workbook with JKPieterse's idea in the first graph.

       

      Thanks!

      • HansVogelaar's avatar
        HansVogelaar
        MVP

        The forum has been broken since late 2024. I only now got a notification of your reply.

        For a 4th degree polynomial, you can't just calculate the slope - you have to calculate the coefficients for x, x^2, x^3 and x^4. For OpSens CH2 to PICO CH1:

        To use this to predict/interpolate values:

        These values look reasonable to me.

    • theDeCoder01's avatar
      theDeCoder01
      Copper Contributor

      Hey Hans,

      Thanks for your input.

      I'll share one sheet from my workbook with the first graph implementing JKPieterse idea.

      I'd be happy to share more info with you if you'd like.

       

      Thanks!

Resources