Fusion of Engineering, Control, Coding, Machine Learning, and Science

Gentle Introduction to Gradients and Level Curves (Surfaces)


In this introductory optimization tutorial, we provide a gentle introduction to gradients and level curves (surfaces). Gradients are fundamental mathematical objects that appear in many scientific, mathematics, engineering, and physics fields, such as optimization, signal processing, control theory, fluid dynamics, physics, etc. The YouTube video accompanying this tutorial is given below.

Gentle Introduction to Gradients and Level Curves from Control Perspective

What is a Gradient?

Let us first explain the mathematical concept of a gradient. Let us consider the following function

(1)  

where and are independent variables, and is a real scalar value. This function is illustrated in the figure below.

Figure 1: Function (1).

Now, the question is:

What is the gradient of this function at a certain point?

From the mathematical point of view, the gradient is a vector defined by the following equation

(2)  

where

Let us compute the gradient of the function (1). The gradient is given by the following equation

(3)  

The gradient at the point is equal to

(4)  

This gradient is shown in the figure below (red arrow).

Figure 2: Gradient vector of the function (1) at the point and . The gradient is illustrated by the red arrow.

When the function depends on variables: , , …, , then the gradient is defined by

(5)  

For presentation clarity, let us return to the example of the function of two variables. Everything explained in this tutorial can easily be generalized to the case of functions depending on three or more variables. Several important facts about this gradient should be observed:

To properly understand gradients, it is also important to introduce the concept of level curves for the case when the function depends on two variables and the concept of level surfaces for the case when the function depends on three or more variables. Consider the function . The level curve of this function is defined by

(17)  

where is a constant. Obviously, the equation (17) defines a curve that is the intersection of the function with the horizontal plane parallel to the xy plane with the distance of from the xy plane.

In the case of the function defined by (1) the level curves are obviously circles centered at with the radius of :

(18)  

The figure below illustrates the level curve.

Figure 3: Level curve of the function (1).

In the same manner, we can define the level surfaces for functions with three or more variables. For example, for the function

(19)  

The level surface is given by the following equation

(20)  

Obviously, this is a sphere with the radius of centered at zero.

Why are the level curves and level surfaces relevant to the concept of gradients?

Because of this reason:

Figure 4: Level curves, gradients, and tangent lines.
Exit mobile version