Program to Plotting Exponential function

Program to Plotting Exponential function?

Exponential function:

In Mathematics, the exponential value of a number is equivalent to the number being multiplied by itself a particular set of times. The number to be multiplied by itself is called the base and the number of times it is to be multiplied is the exponent. This is a mathematical function helps the user to calculate the exponential of all the elements in the input array. This is about the Exponential function in Mathematics. We discuss here, how to write a Program to Plotting Exponential function.

How to calculate the exponential value of a number

The Python language allows users to calculate the exponential value of a number in multiple ways. 
Let’s look at each of them in detail!

1. ** operator

The double asterisk, ** operator is used to calculating the exponential value. Let’s take a look at how this can be used:
base = 2
exponent = 4
print ("Value of Exponential is:", base ** exponent)
Output: Value of Exponential is: 16
2. pow( )

In addition to this Python has included a built-in pow() function which allows users to calculate the exponential value. The function takes as input the base and exponent and returns the corresponding value.
syntax: pow(base, exponent)

Let's explain this concept with the help of an example:
base = 2
exponent = 4
print("Value of Exponential is: ", pow(base, exponent))
Output: Value of Exponential is:  16

3. exp( )
The exp() function in Python: It allows users to calculate the exponential value with the base
set to e. Python number method exp() returns exponential of x.
Here e is a Mathematical constant, with a value approximately equal to 2.71828.
The math that is imported math library must be imported for this function to be executed.

Let's explain this concept with the help of an example:
import math
exponent = 4
print("The Value of Exponential is: ", math.exp(exponent))
Output: The Value of Exponential is:54.598150033144236
Now Let's talked about how to plot the Exponential function.
Program to Plotting Exponential function:
Python Code:
import numpy as np
from matplotlib import pyplot as plt
x = np.arange(0,3.14,0.01)
a = 4b = 5y = np.exp(a*x+b)
plt.plot(x,y)
plt.xlabel('x values')
plt.ylabel('y values')
plt.title('exponential')
plt.grid(True)
plt.show()
Output:
 Program to Plotting Exponential function
 Program to Plotting Exponential function
Summary: In this section, we discussed how to plot the Exponential function in Python. The Exponential function definition, How to calculate the exponential value of a number. The Exponential of a number can be calculated in various ways. All of the ways discuss one by one with syntax, an example with code in python and output. It is one of the simplest ways to read Exponential working. Then defined the code to Plot an Exponential function. In this, The numpy Library used declare numpy as np and used in the code.