Question

# must be python programming. consider function f(x) = sin(x) in the range of 0to pi. create...

must be python programming.

consider function f(x) = sin(x) in the range of 0to pi. create a python code to calculate f’ (derivative of f(x)) in this range and plot these points. calculate the error at all the discrete points. Please do not use Numpy

you can use matplotlib

from scitools.std import *

n = int(sys.argv[1])

x = linspace(0, pi, n+1)

s = sin(x)

plot(x, s, legend=’sin(x), n=%d’ % n, hardcopy=’tmp.eps’)

#### Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
• ### R Programming language Write a function as: y=sin(x) and plot this function using two ways. The...

R Programming language Write a function as: y=sin(x) and plot this function using two ways. The range is from [-pi, pi]. ( in R Programming language)

• ### Using python 3 Define a Python function that takes in a value (x) and evaluates f(x):...

Using python 3 Define a Python function that takes in a value (x) and evaluates f(x): f(x)=(1/(1+x^2)) Use this function to create a plot of f(x) for 0≤x≤10 using matplotlib.pyplot

• ### Python Programming language. Complete the problems below using Jupyter Notebook. Problem Needs to be solved from...

Python Programming language. Complete the problems below using Jupyter Notebook. Problem Needs to be solved from number #1 link provided for the Data: -----> https://docs.google.com/spreadsheets/d/1TqhyxFKQlOHAyXpQBL-4C96kgZFBoMwUgE8-b33CqPQ/edit?usp=sharing PROBLEMS # 0.0 Import the libraries (pandas, matplotlib, and seaborn) Include the code line: %matplotlib inline #Include the code line: plt.style.use(“ggplot”) #Load the data using pandas #Inspect the data using head(), dtypes ANSWERD: import pandas as pd import matplotlib.pyplot as plt import seaborn as sns plt.style.use('ggplot') %matplotlib inline df = pd.read_csv() print(df.head()) print(df.dtypes) # 1...

• ### (10 pts) Write a function to call python modules (either re-write or re-use the program you...

(10 pts) Write a function to call python modules (either re-write or re-use the program you developed before) to calculate the derivative of In(1+x) at X = 1 using the forward difference, central difference and extrapolated dif- ference methods. Also use this function to create a similar log-log plot that compares the absolute value of the approximation error (you can ignore the rounding error) as a function of the size of the intervals used for these three methods. Choose the...

• ### USE MATLAB Create a code that follows the following criteria for a function of range of...

USE MATLAB Create a code that follows the following criteria for a function of range of -10 to 10. x ≥ 1 ; f (x) = tan (x) x < 1 ; f (x) = e x Afterwards, plot the function

• ### Find the Fourier Series for the function on inverval (-pi,pi) f(x) = 1-sin(x) + 3cos(2x)

Find the Fourier Series for the function on inverval (-pi,pi) f(x) = 1-sin(x) + 3cos(2x)

• ### PROBLEM 4 [points:20] Consider the function f(x) = x Draw a graph (can insert and crop...

PROBLEM 4 [points:20] Consider the function f(x) = x Draw a graph (can insert and crop a hand-drawn picture for this part) . Find'define the domain and the range of f Your plot above and answers below must be consistent with each other and domain/ range you defined. Domain: Range: Is fonto? Explain. Isfone-to-one? Why? Is /bijective? .Calculate the values gf.at x-0,x-0.5,x1, and x-2.

• ### *PLEASE DO IN MATHEMATICA* {:1, ifr+ 13. Consider the function f(x)- nction,f(x)-e-r/rifx#0 a. Plot the graph of this function using Mathematica. b. Use the limit definition of the derivative and LHo...

*PLEASE DO IN MATHEMATICA* {:1, ifr+ 13. Consider the function f(x)- nction,f(x)-e-r/rifx#0 a. Plot the graph of this function using Mathematica. b. Use the limit definition of the derivative and LHopital's Rule to show that every higher-order derivative of f at r 0 vanishes. c. Find the MacLaurin series for f. Does the series converge to f? {:1, ifr+ 13. Consider the function f(x)- nction,f(x)-e-r/rifx#0 a. Plot the graph of this function using Mathematica. b. Use the limit definition of...

• ### Consider a square wave f(x) of length 2L over the range?0,2 L1 as shown in Figure...

Consider a square wave f(x) of length 2L over the range?0,2 L1 as shown in Figure l. Formally f(x) can be written as where H(x) is the Heaviside step function Since f(x) (2L x), the function is odd, such that aoan0 Find the Fourier series expansion bin] of the square wave given in Figure 1 and plot the summation of the first 7 (odd) terms of the series from n1 to n 13. Please provide the MATLAB code and plot...

• ### Use PYTHON to compute the problem please = Consider the equation f(x) 1/4 – x* (1...

Use PYTHON to compute the problem please = Consider the equation f(x) 1/4 – x* (1 – x²) – sin(x) 0 a). Show by a simple test that a root exists between x = 0 and x = 1 b). Perform three iterations beyond the starting values using the secant rule. c). Estimate the derivative at your answer b. Compare to the correct value.