Reverse a function from a Plot?

Thread Starter

Art

Joined Sep 10, 2007
806
Hi Guys :)
This is NOT homework! My homework was to do the opposite.
I’m wondering if it’s possible to derive a function if you are given a plot drawn on a graph?
This is totally arbitrary. A function didn’t create it. I made it up.

It’s to accelerate quickly from zero toward 32 or 33, and slow down toward the end.
You could think of the list of integers as a lookup table, so that x0 ouputs y0,
x32 outputs y32, but incrementing in-between is not a linear output.
I wouldn’t expect the output of a similar function to be integers of course, for a curve,
but maybe the floats would round to approximate the integers.
Cheers, Art.
 

Attachments

wayneh

Joined Sep 9, 2010
17,498
I’m wondering if it’s possible to derive a function if you are given a plot drawn on a graph?
Sure, it’s called curve fitting and it doesn’t matter whether you do y vs x or vice versa.

Curve fitting can be a bit of an art and it helps to understand the system. For instance the rate of a chemical reaction typically obeys the Arrhenius equation, and so transforming the data to fit that will give you a straight line. Same deal with exponential growth of microbes or exponential decay of voltage on a capacitor in an RC circuit. Plotted properly these can all be straight lines which are far easier to fit.
 

Thread Starter

Art

Joined Sep 10, 2007
806
Simple! I don’t know why the solution didn’t just dawn on me intuitively:
y = 37.00346+(-0.3649253-37.00346)/(1+(x/9.347271)^1.414382)

One of those parenthesis of constants can be eliminated,
but somehow, I’m not sure this is a saving on my original 33 byte lookup table :D

Thanks the the reply in any case, I really do appreciate it :)
 

WBahn

Joined Mar 31, 2012
30,054
Hi Guys :)
This is NOT homework! My homework was to do the opposite.
I’m wondering if it’s possible to derive a function if you are given a plot drawn on a graph?
This is totally arbitrary. A function didn’t create it. I made it up.

It’s to accelerate quickly from zero toward 32 or 33, and slow down toward the end.
You could think of the list of integers as a lookup table, so that x0 ouputs y0,
x32 outputs y32, but incrementing in-between is not a linear output.
I wouldn’t expect the output of a similar function to be integers of course, for a curve,
but maybe the floats would round to approximate the integers.
Cheers, Art.
You can do it provided the graph actually is a function. In order to be a function, it must be single-valued. For y(x), this means that for any given value of x, there is exactly one value of y.

If that requirement is satisfied, then you can come up with a mathematical function that approximates the actual graph as close as you want it to, but the closer you want it, the more complicated the function gets.
 

Hymie

Joined Mar 30, 2018
1,284
In order to be a function, it must be single-valued. For y(x), this means that for any given value of x, there is exactly one value of y.
This statement is demonstrably false – the function for a circle has 2 separate values for y for any given value of x.
 

WBahn

Joined Mar 31, 2012
30,054
This statement is demonstrably false – the function for a circle has 2 separate values for y for any given value of x.
And it is therefore not a function. Spend some time looking at what the definition of a mathematical function IS, as opposed to what you would like it to be.

It might help to look at the difference between a relation and a function.
 

Hymie

Joined Mar 30, 2018
1,284
And it is therefore not a function. Spend some time looking at what the definition of a mathematical function IS, as opposed to what you would like it to be.

It might help to look at the difference between a relation and a function.
I bow to your superior knowledge – but the ‘circle equation’ shows that it is not a requirement for the solution to be a function.
 
Top