Question: I need a code in Python following the required logic , not using import quad etc. And find out the value of N when numerical

 I need a code in Python following the required logic ,

I need a code in Python following the required logic , not using import quad etc. And find out the value of N when numerical value has 2 decimals. your effort will be appreciated, ty.

make a numerical integration program in Python

. Exercise: Integrate f(x) = 2x2 + 3x from x = 1 to x = 5 and compare your numerical result with what you calculate analytically Strategy/Algorithm: Define a function, S(x), that will return 2x2 + 3x Define a variable N, the number of times that you will evaluate f(x) Create an array of N values of x between x 1 and x = 5 Create an array of N values of f(x) (by evaluating your function with the array of x values as argument) Define a variable, Ax = Sum all of the values in your array of f(x) values, and multiply that by Ax Note that for the last point, since Ax is a constant (the same for each value x), it factors out of the sum: IN-1 f(x,)x = . f(x) FEN-1 =0 10 Also, note that if you have a numpy array of values, you can easily find the sum without a for loop: an = np.linspace(1,5,100) theSum an.sum()

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!