Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started