Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please answer using pycharm, and give explanations of whats happening. a) Write a function defined as: def Simpson(fen, a, b, npoints = 21): Purpose: use

please answer using pycharm, and give explanations of whats happening.image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

a) Write a function defined as: def Simpson(fen, a, b, npoints = 21): Purpose: use Simpson's 1/3 rule to estimate the integral of fen(x), between the limits of a and b. fen: 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 and print the integral of: with a = 1, b = 3 and npoints = 10 X-3 * cos(x) cos(2x).x? with a = 2, b = 3 and npoints = 23 b) Write a function defined as: def Secant(fen, x0, x1, maxiter=10, xtol=1e-5): Purpose: use the Secant Method to find the root of fen(x), in the neighborhood of x0 and xl. fen: the function for which we want to find the root x0 and xl: two x values in the neighborhood of the root xtol: exit if the Xnewest - Xprevious!

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

Database And Expert Systems Applications 22nd International Conference Dexa 2011 Toulouse France August/September 2011 Proceedings Part 1 Lncs 6860

Authors: Abdelkader Hameurlain ,Stephen W. Liddle ,Klaus-Dieter Schewe ,Xiaofang Zhou

2011th Edition

3642230873, 978-3642230875

More Books

Students also viewed these Databases questions