Question: PLOT A GRAPH OF THE GIVEN CODE IN PYTHON. Q: For given x (0), say, x (0) = 1.0, write a program to compute the

PLOT A GRAPH OF THE GIVEN CODE IN PYTHON.

Q: For given x (0), say, x (0) = 1.0, write a program to compute the sequence x (1) , x (2) , x (3) , , x (N) , up to a suitably large value of N, e.g., N = 20, or higher where necessary, using the recurrence relation x (k+1) = f(x (k) ), k = 0, 1, 2, 3, , where f(x) = 2x 3+5 3x2 . Plot the results on the graph in terms of N values.

CODE:

def fun(x):

return (2.0*x*x*x+5.0)/(3.0*x*x);

x0=1.0;

for i in range(1,21):

x0=fun(x0);

print("x",i,"=",x0);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!