subject

Python problemMake a function defined as: def GaussIntegration(fcn, a, b, n=4): Purpose: use the Gauss Integration method to estimate the integral of fcn(x), between the limits of a and b.
fcn: the function we want to integrate
a and b: the lower and upper limits of integration
n: The number of integration points used. The only acceptable values are 2, 3 and 4. If a value other that 2, 3 or 4 is passed, use n = 4.
return value: the estimate of the integral
Write and call a main() function that uses your GaussIntegration function to estimate and print the integral of:
x - 3 * cos(x) , with a = 1, b = 3 and n = 4
x - 3 * cos(x) , with a = 1, b = 3 and n = 5
cos(2x)*x3, with a = 2, b = 3 and n = 2

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 10:50
The volume v and paper surface area a of a conical paper cup are given by where r is the radius of the base of the cone and h is the height of the cone. a. by eliminating h, obtain the expression for a as a function of r and v. b. create a user-de ned function that accepts r as the only argument and computes a for a given value of v. declare v to be global within the function. c. for v ! 10 in.3 , use the function with the fminbnd function to compute the value of r that minimizes the area a. what is the corresponding value of the height h? investigate the sensitivity of the solution by plotting v versus r. how much can r vary about its optimal value before the area increases 10 percent above its minimum value?
Answers: 1
question
Computers and Technology, 23.06.2019 22:50
What is an rss reader used for? for creating a user account on a social new site
Answers: 2
question
Computers and Technology, 24.06.2019 06:50
What are the things you are considering before uploading photos on social media?
Answers: 1
question
Computers and Technology, 24.06.2019 14:30
Which computer network component connects two different networks together and allows them to communicate? a is a node (or a device) that connects two different networks together and allows them to communicate.
Answers: 1
You know the right answer?
Python problemMake a function defined as: def GaussIntegration(fcn, a, b, n=4): Purpose: use the Ga...
Questions
question
Mathematics, 22.07.2019 08:30
question
Mathematics, 22.07.2019 08:30
Questions on the website: 13722363