Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

I have a function w(x), and a) I need to calculate the derivative in each point within [-2,2]. b) I need to plot the derivatives.

I have a function w(x), and

a) I need to calculate the derivative in each point within [-2,2].

b) I need to plot the derivatives.

A solution for a, and b seperately please.

This is what I have currently.

a)

image text in transcribed

b)

image text in transcribed

import matplotlib.pyplot as plt import numpy as np def w(x): sum e for i in range(3): sum += np.cos((7**i)*np-pi*x)/(2**i) return sum np.linspace(-2,2,20) dx = x[1]-x[@] y = list(map(W, x)) dydx = np-gradient(y, dx) print(dydx) 1 2 import matplotlib.pyplot as plt import numpy as np 3 4 5 6 7 8 def w(x): sum = 0 for i in range(3): sum += np.cos((7**i)*np.pi*x)/(2**i) return sum 9 10 11 12 1 X = np.linspace(-2,2,100) dx X[1]-x[@] list(map(w, x)) dydx np.gradient(y, dx) 13 = 14 15 O in 17 18 19 20 plt.plot(dydx) plt.ylim([-20,20]) plt.xlabel("X") plt.ylabel("Y") plt.show() import matplotlib.pyplot as plt import numpy as np def w(x): sum e for i in range(3): sum += np.cos((7**i)*np-pi*x)/(2**i) return sum np.linspace(-2,2,20) dx = x[1]-x[@] y = list(map(W, x)) dydx = np-gradient(y, dx) print(dydx) 1 2 import matplotlib.pyplot as plt import numpy as np 3 4 5 6 7 8 def w(x): sum = 0 for i in range(3): sum += np.cos((7**i)*np.pi*x)/(2**i) return sum 9 10 11 12 1 X = np.linspace(-2,2,100) dx X[1]-x[@] list(map(w, x)) dydx np.gradient(y, dx) 13 = 14 15 O in 17 18 19 20 plt.plot(dydx) plt.ylim([-20,20]) plt.xlabel("X") plt.ylabel("Y") plt.show()

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_2

Step: 3

blur-text-image_3

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 Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students explore these related Databases questions

Question

=+With whom does the firm have to negotiate?

Answered: 3 weeks ago