Issue link: http://dc.ee.ubm-us.com/i/71850

PROGRAMMER'S TOOLBOX It's been a while since we specifically discussed the math of parabolic fits. What's more, it can be quite tricky, and you will get slightly different results depending on the form you assume for f(x). 1110 = Y I - Yo X I -Xu /11 1 = Y2 - Y I X2 - XI algorithm and u"ied to break it. Sigh. I gue s I'm going it alone he re, so I might as well get on with it. Some parabolic math It's been a whi le since we specifically discussed the math of parabolic fi ts. What's more, it can be quite tricky, and you wi ll get slightly diffe re nt resul ts depending on the form you assume fOI " fix) . To make matters worse, I've used different forms in past articles, so I think it's best if we sum- marize the process of fittin g a parabo- la to three data points here. We start by assuming that we have three data poin ts: Po = [Xo, )'0] PI = [XI' YI] P2 = [~, )'2] Next, we a sume a quadratic equation using Newton's form: (2) Note carefully the choice of X indices used. This is very important. Next, we force the function to fit at these three poin ts. This allows us to solve for the three coefficients a, b, and c. The equations are: b = Y2 - Yo = 111 X2 -Xo (4) Note that this parameter has the form of the slope, 171, of a straight line. In th is case, tile line connects points Po and P2, the two end poin ts of the range. We are now left to solve the second equation for c. We have: Y I - Yo ---= m +cxl- x 2 X I -Xo ( ) (5) Again , the left side has the form of a slope, this time of the line between Po and PI ' We can properly defin e this as )110. Then we get: C = /11- 1110 X2 - X I (6) It is not at all obvious from tile form, but this is the same thing as the "slope of slopes": C = ml - 1110 X2 - Xo (7) whe re /1l1 is a slope just like mo, but from PI to P2. The easiest way to prove th e equiva lence is to expand Simpli fYing gives: both expressions out and compare terms. Using the slopes gives us an easy way to compute b and c. Defin e: 22 DECEMBER 2000 Embedded Systems Programming Simplifying give: (11) It's worth noting that c cannot be zero, since it's the difference of two slopes that are necessarily non-ze ro and of opposite signs. That condition is a neces a ry co nsequence of Equation 1. The slope m, on th e othe r hand, can be zero, and wi ll be if Yo = )'2' Thi is the case when we start out with a balanced geome try. In this case, xmin is simply the average of Xo and ~, and is independent of the val- ues of Y = f( x) . Substituting the value for x",in into our function gives the predicted mini- m um val ue of f( x). It is: or: Xmin ="2 l( X2 +xo --;;- 111 ) (10) Yo = a (3) III = Y2 - Yo X2 -Xo Then b = 111, and c is the slope of slopes given in Equation 7. OUf functional form can then be wTitten: The first equation clearly gives the value of G, us b: (8) directl y. The third one gives Recall tllat at the minimum the slope of thi s fun cti on must be zero. Differentiating Equation 9 gives:

- December001
- December002
- December003
- December004
- December005
- December006
- December007
- December008
- December009
- December010
- December011
- December012
- December013
- December014
- December015
- December016
- December017
- December018
- December019
- December020
- December021
- December022
- December023
- December024
- December025
- December026
- December027
- December028
- December029
- December030
- December031
- December032
- December033
- December034
- December035
- December036
- December037
- December038
- December039
- December040
- December041
- December042
- December043
- December044
- December045
- December046
- December047
- December048
- December049
- December050
- December051
- December052
- December053
- December054
- December055
- December056
- December057
- December058
- December059
- December060
- December061
- December062
- December063
- December064
- December065
- December066
- December067
- December068
- December069
- December070
- December071
- December072
- December073
- December074
- December075
- December076
- December077
- December078
- December079
- December080
- December081
- December082
- December083
- December084
- December085
- December086
- December087
- December088
- December089
- December090
- December091
- December092
- December093
- December094
- December095
- December096
- December097
- December098
- December099
- December100
- December101
- December102
- December103
- December104
- December105
- December106
- December107
- December108
- December109
- December110
- December111
- December112
- December113
- December114
- December115
- December116
- December117
- December118
- December119
- December120
- December121
- December122
- December123
- December124
- December125
- December126
- December127
- December128
- December129
- December130
- December131
- December132
- December133
- December134
- December135
- December136
- December137
- December138
- December139
- December140
- December141
- December142
- December143
- December144
- December145
- December146
- December147
- December148
- December149
- December150
- December151
- December152
- December153
- December154
- December155
- December156
- December157
- December158
- December159
- December160
- December161
- December162
- December163
- December164
- December165
- December166
- December167
- December168
- December169
- December170
- December171
- December172
- December173
- December174
- December175
- December176
- December177
- December178
- December179
- December180
- December181
- December182
- December183
- December184
- December185
- December186
- December187
- December188
- December189
- December190
- December191
- December192
- December193
- December194
- December195
- December196
- December197
- December198