Shop OBEX P1 Docs P2 Docs Learn Events
Help determining equation — Parallax Forums

Help determining equation

Bobb FwedBobb Fwed Posts: 1,119
edited 2011-07-11 23:57 in Propeller 1
A couple years ago I asked here on the forums a similar question. I had it answered once using a program called RobotBasic and some programming in there, and I hope to find a similar solution again...

I have some data points that are part of a electronic (hardware) function. I want to get an equation I can put into float math that outputs the correction for the input from the hardware. Maybe it's better with an example: I originally got the solution for an RC circuit because the return values are logarithmic to the inputs, so it needed correction.

The equation is in the form of:
(-379.223 * ln( input ) + 4054.36

I still have RobotBasic installed, but I can't find the program that created the equation.

New set of data (I can get more if needed, but 3 should be enough to make a curve):
input: 1011 -- output: 1079
input: 796 -- output: 613
input: 159 -- output: 345

Any help getting the equation would be helpful. :tongue:

Comments

  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2011-07-11 16:00
    Never mind. I was missing a bit in my inputs (some bit in the middle -- odd). And now that I've found it, the input to output is very linear (like I originally thought it would be), and it just required a simple fractional multiply.
  • StefanL38StefanL38 Posts: 2,292
    edited 2011-07-11 17:32
    Just to add a solution for other forum members

    Excel.exe and OpenOffice calc.exe offer a diagram-type XY-Points.

    These diagrams have a feature add aproximation function.
    You can choose linear, polynomic, exponential, logarhitmical functions
    and you can even display the relation-factor which indicates how good the aprox-function is in touch with the given datapoints.
    So if you need an aprox-function only once at compile-time you can use this solution.

    If you need different aprox-functions at run-time you can dive into the mathematics how it is calculated

    keep the questions coming
    best regards

    Stefan
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2011-07-11 17:44
    Wonder if Open Office has that...
    StefanL38 wrote: »
    Just to add a solution for other forum members

    Excel.exe and OpenOffice calc.exe offer a diagram-type XY-Points.

    These diagrams have a feature add aproximation function.
    You can choose linear, polynomic, exponential, logarhitmical functions
    and you can even display the relation-factor which indicates how good the aprox-function is in touch with the given datapoints.
    So if you need an aprox-function only once at compile-time you can use this solution.

    If you need different aprox-functions at run-time you can dive into the mathematics how it is calculated

    keep the questions coming
    best regards

    Stefan
  • StefanL38StefanL38 Posts: 2,292
    edited 2011-07-11 23:57
    I have a german version so I must do an estimated translation

    double click on the xy-diagramm to enter modification mode
    if not yet done choose subtype "with connecting lines between points"

    leftclick on the connecting line rightclick on that line choose option "insert trendline"
    you a new window pops up "regression curve for datarow X"

    OpenOffice has not reached the level of Excel but it is coming closer and closer
    keep the questions coming
    best regards

    Stefan
Sign In or Register to comment.