I have a datasheet. It looks like an hyperbola. How can I fit a curve to it? And how can I plot a curve of the first derivative?
Time (x)second Normalized data (y)
0 100.00%
100 102.60%
200 104.39%
300 105.53%
400 106.80%
500 107.49%
1000 113.03%
1500 113.13%
2000 113.30%
2500 113.63%
3000 113.78%
3500 113.92%
4000 113.92%
You can use least-squares fitting if you can express the curve that you want to fit as $$y = \sum_{i=1}^{n} a_i f_i(x),$$ where $a_i$'s are the unknowns that you would like to estimate from your data and $f_i$'s are known functions of $x$.
Let $Y = \begin{bmatrix}y_1 \\ \vdots \\ y_m\end{bmatrix}$, $A = \begin{bmatrix} a_1 \\ \vdots \\a_n\end{bmatrix}$, and $F = \begin{bmatrix} f_1(x_1) \ldots f_n(x_1) \\ f_1(x_2) \ldots f_n(x_2) \\ \ldots \\ f_1(x_m) \ldots f_n(x_m) \end{bmatrix}$, then the least squares solution is given by "inverting" $Y = F\cdot A$ to obtain an estimate $\hat{A}$ of $A$: $$\hat{A} = (F^{T}F)^{-1} F^{T} Y$$
The first derivative is simply given by $$\dfrac{dy}{dx} = \sum_{i=1}^{n} \hat{a}_i \dfrac{df_i(x)}{dx}$$