Question: In the following code modify 3 parameters to make calculated slope equal 0 . 6 7 . Do not modify inherent values of B ,

In the following code modify 3 parameters to make calculated slope equal 0.67. Do not modify inherent values of B, instead change other values such as array length as appropriate to make slope equal 0.67. Modify only and exactly 3 values.from numpy import zeros, linspace
import matplotlib.pyplot as plt
from scipy import stats
N_t =6
B =[0.022,0.036,0.06,0.101,0.169,0.266]
dB = zeros(N_t -1)
t = linspace(0, N_t-1, N_t)
for i in range(0, N_t-1):
dB[i]= B[i+1]- B[i]
print("B =", B,"
","dB =", dB)
copy_dB = dB[:(N_t -1)]
copy_B = B[:(N_t -1)]
copy_t = t[:(N_t -1)]
slope, intercept, r_value, p_value, std_err = stats.linregress (copy_B, copy_dB)
print('slope =','%.3f'% slope, 'intercept =','%.4f'% intercept)
plt.figure(1)
plt.plot(copy_t, copy_dB,'bo')
plt.xlabel('t'); plt.ylabel('dB')
plt.figure(2)
plt.plot(copy_B, copy_dB,'bo')
plt.xlabel('B'); plt.ylabel('dB')
plt.figure(3)
plt.plot(t, B,'bo', t, B[0]*(1+slope)**t)
plt.legend(['data', 'equation'], loc = 'upper left')
plt.xlabel('t'); plt.ylabel('dB')

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!