Question: *** PLEASE EXPLAIN ALL LINES OF CODE USING THE # OPTION IN YOUR CODE. MAKE SURE TO DEFINE A MAIN() FUNCTION BELOW. I AM USING

*** PLEASE EXPLAIN ALL LINES OF CODE USING THE "#" OPTION IN YOUR CODE. MAKE SURE TO DEFINE A MAIN() FUNCTION BELOW. I AM USING SPYDER.***

*** PLEASE EXPLAIN ALL LINES OF CODE USING THE "#" OPTION IN

YOUR CODE. MAKE SURE TO DEFINE A MAIN() FUNCTION BELOW. I AM

You will write three Python files named hwwapy,hwwbpp, and hwwc.py. Those programs will fulfill all of the requirements given in parts a,b, and c below. You will place those four python files into a single compressed file named firstname_lastname_hw2.zip. You will upload the .zip file to the Homework 2 dropbox. You will test your functions and using the particular numerical values and function calls given. When we grade your assignment, we will run your program with those given numerical values, looking for correct answers. For now, you may not use any of the powerful functions available in python modules, with two exceptions: you may import functions from the math module and the copy module. You must include reasonable comments in your code. See your MAE 3013 textbook or online materials for a reminder of: The Secant Method for finding the solution (root or zero) or a nonlinear equation The Simpson's 1/3 rule for numerical integration The Gauss-Jacobi and Gauss-Seidel methods for solving a set of linear equations a) Write a function defined as: def Simpson(func, a, b, npoints = 30): Purpose: use Simpson's 1/3 rule to estimate the integral of func(x), between the limits of a and b. func: the function we want to integrate a and b: the lower and upper limits of integration npoints: The number of integration points used in the range a to b (inclusive). Npoints must be an ODD number. If npoints is not ODD, then add 1 to make it odd! return value: the estimate of the integral Write and call a main() function that uses your Simpson function to estimate the value of the integral. The main function will print the value of integral. Use the following 3 test cases: 2x3sin(x)cos(2x)x3cos(2x)x3witha=2,b=3andnpoints=9witha=3,b=4andnpoints=27witha=2,b=3withnpointsunspecified

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!