How to find function expression from the graph and consequently find inflection points?

260 Views Asked by At

There are two variables a and b over time t .For example

| t | 18:23 | 18:24 | 18:25 | ... |
|---|-------|-------|-------|-----|
| a | 234   | 121   | 555   | ... |
|---|-------|-------|-------|-----|
| b | 333   | 111   | 732   | ... |

I use the following function to create point J

J=$f(a,b)=\frac{a-b}{a}$ when $a>b$, a>0
J=$f(a,b)=\frac{b-a}{b}$ when $b>a$, b>0

such that now the table looks like this

| t | 18:23            | 18:24         | 18:25           | ... |
|---|------------------|---------------|-----------------
| j | (333-234)/333    | (121-111)/121 | (732-555)/732   | ... |

Now I plot j over t.
My goal is to find inflection points, maxima and minima from the plot.

Here is how I am thinking to solve this-

-In order to find the inflection point and maxima, minima first I need to find the derivative/rate of change of the function. So what would be the function expression that I need to use?

-Do I need to find f'(a,b) ? Countering myself-then it would be the partial derivative as time 't' is not captured in the above function. The derivative f'(a,b) would give the rate of change of variable a with respect to b.Which is incorrect for my scenario.

-What I want is the rate of change of variable j over time t, but the above function doesn't have the variable t .Therefore the above function might not be the correct expression on which I apply the derivative?

These thoughts bring me to the following Questions-

-How do I find the rate of change of j over t in this scenario ?
-What would be the function expression on which I would apply the derivative?

2

There are 2 best solutions below

0
On BEST ANSWER

In order to find the inflection point and maxima, minima first I need to find the derivative/rate of change of the function. So what would be the function expression that I need to use?

You have $$ j(t) = f(a(t), b(t)) $$ so $$ j’(t) = \frac{\partial f}{\partial a} \frac{da}{dt} + \frac{\partial f}{\partial b} \frac{db}{dt} $$ We have the partial derivatives $$ \frac{\partial f}{\partial a} = \begin{cases} b/a^2 & ; a > b \\ -1/b & ; b > a \end{cases} \quad\quad \frac{\partial f}{\partial b} = \begin{cases} -1/a & ; a > b \\ a/b^2 & ; b > a \end{cases} $$ However $a(t)$ and $b(t)$ are only given as sequences of values sampled at certain times. So you have to use numeric methods to approximate the time derivatives. E.g. see the Wikipedia article on Finite difference.

You will try to find the critical points where $j'$ vanishes. Again you will have to use a numerical method like bisection or Newton-Raphson iteration to find those points.

1
On

Your function is given at discrete points. Whatever smooth function you "invent" in between, you're making stuff up (you are interpolating). Alternatively, if you know what the expected function is, you can use fitting.

However, what you are looking for is a discrete approximation of the derivative, and in the lowest approximation, that's just the finite difference that you know from primary school physics: $$y'\approx \frac{\Delta y}{\Delta t}=\frac{y_{n+1}-y_n}{\Delta t}$$ $$y''\approx \frac{\Delta y'}{\Delta t}=\frac{y_{n+1}-2y_n+y_{n-1}}{\Delta t^2}$$ and so on.

For the first derivative, you can do right difference, left difference or symmetric difference (skipping the middle value, making the interval twice as wide), but for the second derivative, the formula above is the most commonly used and recognizable at a glance.

This works if you have samples at regular intervals. If you times are not equally spaced, you need to find other suitable formulas, but they are not hard to find. For second derivative, just find a parabola that goes through 3 neighboring points and calculate its second derivative.