# Data Manipulation

### Fitting Data

Want process variable -> can't directly measure it?

DEFINITION:

Calibration involves establishing a relationship between the process variable of interest and the measured quantity

Once have C=f(x) -> plot data. How do you use it?

• Interpolation - get data between existing points.
• Extrapolation - get data outside existing points.
• Fit curve.

Interpolate:
$y = y_1 + \frac{x-x_1}{x_2-x_1}(y_2-y_1)$,

where x and y are the to-be-determined variables and x_i and y_i are the data on the curve.

Need to do more often (or extrapolate) -> develop an expression y=f(x)

### Curve Fitting

Straight line -> easy

• by inspection ("looks good")
• least squares analysis -> minimize the sum of (absolute error)2

Eqn. of line -> y = ax + b

a - slope -> $\frac{rise}{run} = \frac{y_2-y_1}{x_2-x_1}$ b - intercept -> $b = y_1-ax_1 = y_2-ax_2$

Non-linear fitting -> cast non-linear equation [like y=Aebx] into linear form [like (ln(y) = bx + ln(a)].

Plot one y-dependent quantity [here, ln(y)] versus an x-dependent quantity [here, x].

OUTCOME:

Utilize curve-fitting or linear interpolation to estimate unmeasured data from measured data

TEST YOURSELF!

How do you "linearize": y=Bx3 [cheat]

These two types occur often:

• semi-log (log-linear or linear-log): useful for exponential dependencies
• log-log: useful for polynomial dependencies

IMPORTANT:

Do not perform a "double log", that is, don't plot the ln(y) on log paper.