Write a function my_der_calc(f,a,b,N,option), with the output as [df,X],where  f(x) is a function that equals x(1-x), a and b are a scalars that represent the 1st and last point of your grid respectively, and Nis an integer that represents the number of grid points, and optionis the string that can take on the text forward, backward or central differencing.  Thus, you are writing a function that can perform forward, backward or central differencing, the choice is determined by the input option Let xbe an array starting at a, ending at b, containing Nevenly spaced elements, and let y be the array f(x) The output argument, df, should be the numerical derivatives computed for xaccording to the method defined by the input argument, option The output argument Xshould be an array that is the same size as df containing the points in xfor which df is valid Remember, the forward difference method “loses” the last point, the backward difference method loses the first point, and the central difference method loses the first and last points. So you have to use forward or backward differences depending on whether it is the 1st or last point. Plot df .vs X, notice the functional form of your plot. Compare with the actual form with the derivative of the given function, if the calculated derivative is not within 1×〖10〗^(-3) of the given function derivative add more points until the calculated derivative is less than or equal to 1×〖10〗^(-3) of the given function’s derivative Write a derivative function that doesn’t use numpy arrays

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
  • Write a function my_der_calc(f,a,b,N,option), with the output as [df,X],where  f(x)
    is a function that equals x(1-x), a and b are a scalars that represent the 1st and last point of your grid respectively, and Nis an integer that represents the number of grid points, and optionis the string that can take on the text forward, backward or central differencing.  Thus, you are writing a function that can perform forward, backward or central differencing, the choice is determined by the input option
  • Let xbe an array starting at a, ending at b, containing Nevenly spaced elements, and let y be the array f(x)
  • The output argument, df, should be the numerical derivatives computed for xaccording to the method defined by the input argument, option
  • The output argument Xshould be an array that is the same size as df containing the
    points in xfor which df is valid
  • Remember, the forward difference method “loses” the last point, the backward difference method loses the first point, and the central difference method loses the first and last points. So you have to use forward or backward differences depending on whether it is the 1st or last point.
  • Plot df .vs X, notice the functional form of your plot.
  • Compare with the actual form with the derivative of the given function, if the calculated derivative is not within 1×〖10〗^(-3) of the given function derivative add more points until the calculated derivative is less than or equal to 1×〖10〗^(-3) of the given function’s derivative
  • Write a derivative function that doesn’t use numpy arrays
AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education