5.5 Graphical Presentation of Functions

In chapter 6 we will show interactive simulations, which visualize functions in the plane, curves in space , surface and time-dependent surfaces. At this point we will give a short overview about the fundamental possibilities for visualizing functions.

5.5.1 Functions of 1 to 3 Variables

Functions of one Variable

Functions y = f(x) are represented graphically in a two dimensional system of coordinates, on which the independent variable is usually shown on the abscissa and the dependent variable y = f(x) on the ordinate. An interval on the x-axis is mapped to an interval on the y-axis. The mapping is only unique, if there is only one function value y1 = f(x1) for a certain value x1 of the independent variable. If one wants to for example show a circle one has to use two unique functions y1 and y2 for the parts of the circle above and below the abscissa:

x2 + y2 = r2 y 1 = +r2 - x2;y2 = -r2 - x2

y = f(x) with Linear or Logarithmic Scaling of Axes

The special character of a function can be underlined if one uses logarithmic scaling on one or both axes. With single-logarithmic presentation exponential functions appear as lines and with double-logarithmic presentation powers as lines. In addition one can highlight regions of interest on the abscissa or ordinate using logarithmic stretching or compression. One also uses logarithmic scaling if one or both of the variables cover a very large range of values.

Fig5.4 provides a simulation showing a number of preset functions next to each other in linear-linear, linear-logarithmic and double-logarithmic scale. The formula field is editable, which allows you to study arbitrary functions in comparison.

Further details and suggestions for experiments are given in the description pages.

Figure 5.4: Choice of different functions in linear and logarithmic coordinates. The picture shows the exponential function. a and b are adjustable parameters

Parameter representation of curves in Plane and Space

To show curves in the plane, that are non unique w.r.t. the mapping from x to y, one uses the parameter representation, where both x and y are unique functions of a third independent variable , namely the parameter p.

x = f(p);y = g(p) p1 p p2

For the circle around the origin with radius r this is for example

x = rcosϕ;y = rsinϕ x2 + y2 = r2(sin2ϕ + cos2ϕ) = r2 1 = r2

where the parameter ϕ is the angle between the radius vector to the computation point and the x.

Using the parameter representation one can represent functions in the plane, that cover the coordinate ranges x and y multiple times such as spirals.

Extending the parameter representation to the three coordinates of space one can visualize space curves in this way:

x = f(p);y = g(p);z = h(p)

Thus the number line is mapped to a line in the plane or in space.

Unique Surfaces in Space

With z = f(x,y) on can represent surfaces in a three dimensional space. Thus the surface is a mapping of the xy-plane with a height profile that depends on x and y. On paper one can only show two dimensional projections of this surface. The technique of simulations extend this view quite dramatically, since it allows to change the projections interactively or automatically, such that the impression of three dimensions being present is received; we will use this approach intensively in the following.

Parameter Representation of Surfaces in Three dimensional Space

Via a parameter representation with two parameters one can represent surfaces in spaces, that are not unique with respect to a plane of reference, for example the surface of a sphere or a torus with respect to the xy-plane. In these cases one needs f1(x,y) and f2(x,y). In parameter representation one writes:

x = f(p,q);y = g(p,q);z = h(p,q)

Thus the two number lines p and q are mapped to a surface that lies in space.

Functions of 3 Variables

A density distribution for example of charge or mass in space is described via a function D of the three spatial coordinates x,y and z, i.e.. D(x,y,z). How can such functions of 3 variables be visualized? One obviously needs another variable beyond the three space coordinates.

A qualitative option consists of assigning to a regular space grid of points a colour coding for D(x,y,z) and to choose the density of points in such a way, that the space stays “transparent”. The grid is then projected on a surface and changing the projection as a function of time again increases the spatial impression.

A second option are surfaces in space on which D(x,y,z) has a constant value. Then one can stagger semi transparent surfaces inside of each other or the constant value of each surface can be changed as function of time. In the moving projection both possibilities yield a quantitative picture. In the first case one uses the opacity and in the second case the time as additional variable.

5.5.2 Functions of four variables: World line in the Theory of Relativity


A Physical event such as the ticking of the watch on my wrist takes place in a three dimensional space (x,y,z) and depending on the time t and can be considered as a four dimensional function E:

E = f(x,y,z,t)

In a simulation this can be represented for example by calculating for a cohort of three dimensional functions E(x,y,z,ti) for a number of discrete points ti in time two dimensional projections and displaying these one after the other. In general this method has of course limited applicability. It is relatively simple, when dealing with a chain of events, that have a lower dimensionality, for example in the case of a propagating surface in space during an explosion. In general one will restrict this method to a lower dimensional projection.

This is especially the case for describing phenomena in the special theory of relativity. In this theory the time t joins the three spatial dimensions as “fourth dimension”. In order for this variable to have dimensions of length one usually normalizes t via multiplication with the velocity of light c = 3 × 108m/sec:

E = f(x,y,z,ct) or E = f(x1,x2,x3,x4) 

A four dimensional chain of events – for example an exploding supernova – can only be visualized with difficulty as a whole. To capture this phenomenon in its entirety one would like to imagine the whole explosion in a single moment. In deed Homer and the pre-socratic philosophers speculated around 500 B.C. about the god-like possibility to recognize space and time as past, present and future, as unit. Around the year 520 Boethius formulated such thoughts in his work Comfort of Philosophy.

One circumvents this problem by doing away with two space dimensions for visualizations in the theory of relativity and plotting the chain of events on a plane diagram for example with the time dimension ct on the ordinate and on the abscissa the space dimensions x, in which the event only takes place. The event chain of a body that is moving in x-direction is then called world line.

Figure 5.5: World line (blue) of a point object (magenta), that is accelerated uniformly in one dimension. The black line shows the classically “possible” orbit , the blue line the orbit that can be realized according to the special theory of relativity. The red lines delimit the light cone of a light signal sent at the same time. The arrows originating from the object delimit its light cone. The constant acceleration can be adjusted with the slider.

This will be visualized with an example in Fig5.3, where a point object is moving with constant acceleration in x-direction. In red the limiting velocity of light, i.e. the worldline of light flash x = ct is shown and in black the event chain that would be possible according to classical mechanics, for which arbitrarily large velocities could be achieved and in magenta the actually possible event chain according to the theory of relativity, for which the velocity will approach the velocity of light but will not exceed it. The arrows show the respective light cones in which all events caused by the object happen – all as seen from an observer at the origin.

In this simulation the movement of the objects is shown as a function of time. Further details a given in the description of the interactive simulation.

In articles on the special theory of relativity the time is normally plotted on the ordinate and the space on the abscissa, such that the light cone opens up to the top. The classical acceleration parabola x = b 2t2 is however open to the right.

5.5.3 General Properties of Functions y = f(x)

In the following we define important properties of a function of one variable y = f(x) on its domain of definition D. A function f(x) is

Corresponding examples are shown in Fig.5.6:

The slope of the curve at a point is characterized via the direction of the tangent in the point and thus by the differential quotient f(x). At the maximum and minimum, i.e. at the extrema, the tangent is parallel the x-axis and the tangent of the slope angle is zero. At the turning point the slope attains its largest or smallest value with respect to its vicinity; in the example we have a turning point with a positive slope.

Figure 5.6 not translated yet!!

Figure 5.6: Properties of function graphs f(x) in an interval of the variable x. In the example on curvature the notations concave and convex are defined for a finite interval

The curvature of the graph of a function on an interval is defined as follows:

Concave function graph (negative curvature): all points of the graph lie above the chord connecting the end points of the graph on the interval; the slope increases with increasing x.

Convex function graph (positive curvature): all points of the graph lie below the chord connecting the end points of the graph on the interval; the slope decreases with increasing x.

The curvature at a point (x,y), considered as infinitesimal interval, is obtained as limit for vanishing width of the interval. It describes the change of the slope and therefore is equal to the second derivative f(x). Thus this quantity is as well as the curvature is a local quantity and in addition a function of x itself for those functions that can be differentiated twice. At the turning point the sign of the curvature changes; the curvature and thus the second derivative f(x) vanishes at the turning point.

The red curve in the second example has a kink at x0 , where no unique slope is defined, but only a right-sided and left-sided derivative exist. It is therefore only one-sided differentiable; its derivative is not continuous at x0. The blue curve in the first example diverges at the end of the interval; it is not bounded and has no supremum.

5.5.4 Exotic Functions

Functions can be of many different types. One of those, that is often given in textbooks and is both simple and exotic, gives food for thought, but is very well defined is given by

f(x) = 1forxirrational, 0for xrational Domain of definition: 0 x 1

This function can obviously not be visualized graphically, since there are infinitely many rational and irrational numbers in the domain of definition, such that the values of 0 and 1 are nested indissolubly on the ordinate. This function is not continuous at any point and cannot be differentiated anywhere. Kochcurve

A graphically attractive exotic function is the fractal Kochkurve, that is obtained as the limit of a combination of triangular lines. This function is contrast to the above mentioned one continuous, but does not have a well defined slope and thus no derivative.

The functions that are important for physics are however mostly well-behaved, with the exception of a few points. The following section demonstrates a few typical properties.