+ Reply to Thread
Results 1 to 4 of 4

Get y= eqn / fx from coords efficiently

  1. #1
    Registered User
    Join Date
    07-25-2019
    Location
    Hilliard, OH, US
    MS-Off Ver
    Office 2010
    Posts
    23

    Get y= eqn / fx from coords efficiently

    Making an AQMS. Air Quality Monitoring System.

    I want to be able to determine specific gas that elevated sensors readings. Using MQ gas sensors and an esp32 MCU. the existing libraries are not sufficient.

    Now each sensor is sensitive to a few and not others and there's overlap... It's like ABD, ACE, BCD, BDE. So if I have those four sensors and #1, #2 go up, I know it's gas A. If 12 & 4 it's B, so on.

    Anyhow, what I need help with is getting eqns made for the sensitivity curves (see example attached). A ratio changes based in gas concn. I want to simply input 3 coordinats and have VBA &Excel find best eqn and poop it out onto sheet. It would make eqn for every sensor*gas.

    .. I figured out how to get eqn on chart but not sheet...
    Attached Images Attached Images

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

    Re: Get y= eqn / fx from coords efficiently

    Since this looks like an extension of the previous thread (https://www.excelforum.com/excel-cha...-and-more.html ) I still recommend using LINEST() for the regressions. Where most of your curves are linear (or mostly linear) on a log-log plot, I would probably use a power trendline rather than a polynomial as suggested in the previous thread. power trendlines (y=ax^b) are linear on a log-log plot as can be shown by taking the log of both sides ln(y)=ln(a)+b*ln(x) (substitute u=ln(x) and v=ln(y) to get v=ln(a)+bu if needed to see the straight line relationship). Something like =LINEST(LN(known_ys),LN(known_xs)) will return the parameters for a power trendline.

    You may find this tutorial useful, as it describes the different trendlines available to charts as well as equivalent worksheet formulas for each trendline type. https://www.ablebits.com/office-addi...ower-trendline
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    07-25-2019
    Location
    Hilliard, OH, US
    MS-Off Ver
    Office 2010
    Posts
    23

    Re: Get y= eqn / fx from coords efficiently

    Yeah i forgot... so i think i may of misconceptialized this... so I still use a straight line eqn y=mx+b, but the axis's are log! What offset are m and b from the returned array of linest()? (dumb ? i know)....

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

    Re: Get y= eqn / fx from coords efficiently

    I'm not sure I understand your question. The LINEST() output is m(n), m(n-1),...,m(1),b. If you include the additional statistics (4th argument is TRUE), the LINEST() will output additional statistics on successive rows (see the help file for the exact output). So, for a basic power trendline [y=b*x^m equivalent to ln(y)=ln(b)+m*ln(x)], LINEST(LN(known_ys),LN(known_xs)) will output m in the first cell and ln(b) in the second cell.

    Does that answer your question, or am I misunderstanding your question?

+ 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. Structure Coords
    By grassmaster in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-16-2018, 01:08 AM
  2. [SOLVED] Dynamic chart size and coords
    By ZickZak in forum Excel General
    Replies: 7
    Last Post: 11-10-2017, 01:13 PM
  3. Replies: 0
    Last Post: 08-06-2013, 10:59 AM
  4. Gathering coords from an image and using MouseDown
    By scooteriggy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-27-2013, 11:34 PM
  5. E2:I2 to numeric coords
    By KillGorack in forum Excel General
    Replies: 6
    Last Post: 12-05-2011, 02:27 PM
  6. using coords to put names on a excell map
    By Nuno Neves in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-08-2011, 02:57 PM
  7. Convert GPS Coords
    By stewman in forum Excel General
    Replies: 2
    Last Post: 08-09-2010, 02:59 PM

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