Menu

[Solved]Consider Integral Ar Elx Ed 0 Write Python 3 Program Calculate E X Values X 0 3 Steps 01 U Q37226371

Consider the integral ar Elx- ed 0 (a) Write a python 3 program to calculate E(x) for values of x from 0 to 3 in steps of 0.1

Consider the integral ar Elx- ed 0 (a) Write a python 3 program to calculate E(x) for values of x from 0 to 3 in steps of 0.1 Use the Trapezoidal rule method (an example is shown below) and a suitable number of slices. def f (x): return x**4 – 2*x + 1 N = 10 a=0.0 b 2.0 h(b-a) /N s0.5*f (a) 0.5*f (b) for k in range (1,N) print (h*s) (b) When you are convinced your program is working, extend it further to make a graph of Ex) as a function of a. Part (a) and (b) need to be done in the same program. Show transcribed image text Consider the integral ar Elx- ed 0 (a) Write a python 3 program to calculate E(x) for values of x from 0 to 3 in steps of 0.1 Use the Trapezoidal rule method (an example is shown below) and a suitable number of slices. def f (x): return x**4 – 2*x + 1 N = 10 a=0.0 b 2.0 h(b-a) /N s0.5*f (a) 0.5*f (b) for k in range (1,N) print (h*s) (b) When you are convinced your program is working, extend it further to make a graph of Ex) as a function of a. Part (a) and (b) need to be done in the same program.

Expert Answer


Answer to Consider the integral ar Elx- ed 0 (a) Write a python 3 program to calculate E(x) for values of x from 0 to 3 in steps o… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *