A Core Course on Modeling Week 4-Dealing with mathematical relations From graph shape to functional relation A taxonomy on the basis of graph shapes • assume functions f:R R • focus on behavior for x ‘in the long run’ (x and x - , or as far as they get) • heuristic: no guarantee for ‘correctness’ • may need a bit of tuning to get the right parameterization • start with searching a match with few as possible parameters • experiment! 1 A Core Course on Modeling Week 4-Dealing with mathematical relations From graph shape to functional relation 2 A Core Course on Modeling Week 4-Dealing with mathematical relations From graph shape to functional relation Behavior Linear Suggested parameterisation y = ax + b Parameters a: slope with the +x axis; b: intercept with the y-axis How to fit linear least squares 3 (http://en.wikipedia.org/wiki/Linear_least_squares_(mathematics) ); Example Remarks The world record time on 100 m sprint as a function of time (this example shows the limitations of extrapolating simple models; see Edwards & Hamson, page 10 and further) A Core Course on Modeling Week 4-Dealing with mathematical relations From graph shape to functional relation Behavior Piecewise linear (tent- or V-shape, sharp bend) Suggested parameterisation y = a abs(x - x0) + b Parameters a: slope with the +x axis; b: height of the apex; x0 : location of the (+ or -) apex How to fit first estimate x0; next linear least squares to find a and b 4 (http://en.wikipedia.org/wiki/Linear_least_squares_(mathematics) ); Example Accurate measurements using compensation method (e.g., Wheatstone bridge for measuring resistance, capacity, inductance) Remarks Possibly the slopes of left- and right segments are too different; then: treat as two separate lines A Core Course on Modeling Week 4-Dealing with mathematical relations From graph shape to functional relation Behavior Suggested parameterisation 5 Horizontal asymptote left (right); unbounded increase/decrease right (left) or vice versa y = exp (b (x-x0)) + a Parameters a determines the height of the asymptote; the sign of b determines which side (left or right) the asymptote; x0 determines the rate of increase/decrease How to fit first estimate a; next take log(y-a) =b(x-x0) and estimate b and x0 using linear least squares. Example Proportional growth, e.g. financial assets (compound interest), populations; absorption in a medium (x=thickness), radioactive decay (x=time), … Remarks Alternative parameterisation: y = y0 exp bx + a A Core Course on Modeling Week 4-Dealing with mathematical relations From graph shape to functional relation Behavior Suggested parameterisation 6 Vertical asymptote left (right); unbounded increase/decrease right (left) or vice versa y = a log (b (x-x0)), b(x-x0) >0 Parameters x0 determines the location of the asymptote; the sign of a determines increase or decrease; the sign of b determines whether increase/decrease is for ascending or descending x. How to fit first estimate x0; next set x-x0 t and plot y against exp(t): y=a(log b+t). Linear least squares gives a and slope=a log b. Find b as exp(slope/a).. Example Perception (e.g., perceived loudness is proportional to the log of the air pressure); computing science (execution time of algorithms sometimes grows proportional with log of data size) Remarks Alternative parameterisation: y = y0 +log(x-x0), x>x0 or y0+log(x0-x), x<x0 A Core Course on Modeling Week 4-Dealing with mathematical relations From graph shape to functional relation 7 Behavior Unbounded increase left, decrease right – or vice versa Suggested parameterisation y = a x2 + b x + c Parameters a determines curvature; b left-right symmetry; c absolute height. How to fit first estimate apex (xa,ya); find point (xa+p,yshift) for arbitrary p. Then a = (yshift-ya)/p2; b = -2axa; c = ya+b2/4a Example Free falling and thrown objects have parabolic trajectories; stopping distance for braking cars is quadratic in speed; air resistance on a moving object is (roughtly) parabolically dependent; potential energy for an oscillating system; area of a surface given a characteristic dimension. Remarks Any even degree polynomial has the behavior of unbounded increase or decrease both left and right; they can have inflection points and therefore multiple local extrema. For large |x|, only the highest power dominates, so left branch and right branch tend to be mirror symmetric for large |x|. A Core Course on Modeling Week 4-Dealing with mathematical relations From graph shape to functional relation 8 Behavior Asymptotic increase left, decrease right – or vice versa Suggested parameterisation y=a+b tan 2 (c(x-x0)) Parameters The location of the asymptotes determines c and x0 The height of the apex is a; b determines the steepness. How to fit Let xa1 and xa2 the locations of the asymptotes. Then x0=(xa1+xa2)/2; c=/(xa2-xa1). The height of the apex is a; b tunes the steepness. Example No known examples. Remarks A Core Course on Modeling Week 4-Dealing with mathematical relations From graph shape to functional relation Behavior Unbounded increase (decrease) left and right – monotonically or not Suggested parameterisation y = a x3 + b x2 + c x + d 9 or Parameters How to fit Brute-force method: substitute at least 4 points (xi,yi) into y=ax3+bx2+cx+d and solve linear set of equations for a,b,c,d in least-squares sense. Example For all coefficients ≠0: no common applications known. For only a ≠ 0: the volume or the mass of an object, given its characteristic dimension. Remarks Although the cubic function (or higher, odd-degree polynomial functions) have little practical application, cubic parameter curves x=Fx(t), y=Fy(t) , 0t 1 (so called splines) form the working horse of most of computer aided geometric design: since they have 4 parameters, they can satisfy two continuity constraints on both ends (values and tangents), and form a smooth curve consisting of piecewise cubic curves. A Core Course on Modeling Week 4-Dealing with mathematical relations From graph shape to functional relation Behavior Asymptotic increase (decrease) left and right Suggested parameterisation y = c tan (a(x-b))+d Parameters How to fit 10 a and b shift the curve to the left or the right; a and c together determine the steepness in the inflection point; d is a vertical offset First find a and b such that asymptotes are on the right locations, use that tan(x) has asymptotes for /2 and -/2. Next adjust c to get the steepness right; finally adjust d to get the intersection with x-axis right. Example tan functions often occur in relation to geometric problems involving angles or ratios of lengths. E.g., find the height of a building from the length of its shadow and the angle of the sun above the horizon. Remarks An alternative parameterization is, for instance, y = x/((x-x0)(x-x1)). This function has two vertical asymptotes, for x=x0 and x1 respectively. However, it also has horizontal asymptotes; in our taxonomy it would therefore classify as ‘saturation both left and right, increasing or decreasing everywhere’ A Core Course on Modeling Week 4-Dealing with mathematical relations From graph shape to functional relation 11 Behavior Asymptotic decrease left, saturating increase right – or vice versa Suggested parameterisation several; simplest in use: y = c((a/x)12-2(a/x)6) Parameters c is a scale factor, determining the depth of the ‘dip’; a is the x-value for which the minimum is reached. How to fit Find the location of the dip; its x-coordinate is a. Next substitute the y value of the minimum to adjust c. Example The force between particles (atoms, molecules) if often a combination of attraction at long distance andd repulsion at short distance. This form for the interaction was proposed by, and named after E. Lennard-Jones. Remarks http://en.wikipedia.org/wiki/Lennard-Jones_potential A Core Course on Modeling Week 4-Dealing with mathematical relations From graph shape to functional relation Behavior Linear increase left, saturating decrease right – or vice versa Suggested parameterisation y = C x * logistic curve (x) 12 Parameters C is overall scale factor; should be 1 if x and y are in same units.Logistic curve can have various parameterizations. How to fit Find overall scale factor C from slope left hand part; next divide by Cx and find parameters for logistic curve as described with logistic curve. Example Income as a function of selling price: if the price is to low, income is low despite large volume; if the price is too high, market (share) will be too small. Remarks There are no immediate interpretations of the curve with x -x of with y -y. A Core Course on Modeling Week 4-Dealing with mathematical relations From graph shape to functional relation Behavior Suggested parameterisation 13 saturation both left and right, increasing or decreasing everywhere. When monotonous, a logistic curve is a likely candidate. in standard form: y=1/(1+exp(-x)) Parameters Standard version has no parameters: asymptotes for y=0 and y=1. Standard inflection point for x=0 and slope 1. How to fit For arbitrary asymptotes, inflection point and slope, use Richards generalised logistic curve; see http://en.wikipedia.org/wiki/Generalised_logistic_curve Example Applications in ecology (population growth), chemistry (autocatalyse), neural networks, medicine (tumor growth), physics (Fermi distribution), economy (price elasticity) Remarks Depending on the application, other parametrizations can be y=a arctan (bx +c)+d, or piecewise linear (ramp function) . If the function can have a vertical asymptote (that is, is not monotonous), a two-branch hyperbola like y = 1/x could be tried. A Core Course on Modeling Week 4-Dealing with mathematical relations From graph shape to functional relation Behavior 14 saturation left or right, and a vertical asymptote; monotonically increasing or decreasing. Suggested parameterisation one branch of an (orthogonal) hyperbola y=a+b/(x-c) Parameters a and c define asymptotes; b defines slope. How to fit Find vertical asymptote; this defines c. Find horizontal asymptote; this defines a. Slope is controlled by b; sign of b defines which the quadrants. Example In physics, the product of P and V (pressure and volume) for an amount of gas with constant temperature is constant. Both are non-negative, so only one branch of the hyperbola. Remarks A Core Course on Modeling Week 4-Dealing with mathematical relations From graph shape to functional relation 15 Behavior monotonically increasing or decreasing with inflection point, no saturation Suggested parameterisation y=x 1/3 Parameters How to fit Example Characteristic dimension of an object with volume x Remarks Compare with y=x1/2=xon;y defined for x>0. Applications of square root: mechanics (fall time of a point mass for given height); applications involving Pythagoras’ theorem; characteristic dimension of a surface with given area. A Core Course on Modeling Week 4-Dealing with mathematical relations From graph shape to functional relation Behavior Suggested parameterisation Parameters 16 saturation both left and right, approached from the same side; (1) no vertical asymptotes y=a exp (-(x-b)2/2c2) (Gaussian), or y = a / (1+(x-b)2/2c2) (Lorentzian) b is location of maximum; c relates to width of half maximum; a is height of maximum. How to fit Example Gaussian: statistics, normal distribution; Lorentzian: distribution of energy in spectra, forced resonance; geometric distribution of light from a point source over a surface. Remarks The Lorentzian has a ‘thicker’ tail than the Gaussian. It counts as a pathological distribution in statistics, because it has no mean and its variance is infinity. A Core Course on Modeling Week 4-Dealing with mathematical relations From graph shape to functional relation Behavior 17 saturation both left and right, approached from the same side; (2) vertical asymptote Suggested parameterisation y = 1 / ((x-b)2/2c2) Parameters b is location of vertical asymptote; c relates to width of peak How to fit Example Remarks Distribution of light from a point source over a surface containing the light source