Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Modify the python code below to solve the following Integral: I/IO =1/8*[2C(u) + 1]^2 + [2S(u) + 1]^2 . where u = x*sqrt(2/z), C(u) =

Modify the python code below to solve the following Integral: I/IO =1/8*[2C(u) + 1]^2 + [2S(u) + 1]^2 .

where u = x*sqrt(2/z), C(u) = cos(t^2/2), S(u) = sin(t^2/2), x in range(0,5), z=2, =4

Use matplot lib to plot the points of I/I0 and X. Show a screenshot of I/IO results and plot.

-----------------------------------------------------------

from gaussxw import gaussxw def f(x): return x**4 - 2*x + 1 N = 3 a = 0.0 b = 2.0 # Calculate the sample points and weights, then map them # to the required integration domain x,w = gaussxw(N) xp = 0.5*(b-a)*x + 0.5*(b+a) wp = 0.5*(b-a)*w # Perform the integration s = 0.0 for k in range(N): s += wp[k]*f(xp[k]) 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions