Question: Kindly help edit my Python codes. It does not plot the required graph of y against x. Thanks. t is a variable with the given

Kindly help edit my Python codes. It does not plot the required graph of y against x. Thanks. t is a variable with the given range in the codes.

import matplotlib.pyplot as plt import numpy as np import math

#Constants h1=(6.626e-34/2*math.pi) m= 500 m1=str(m) k1=0.3 q1=1.5 c=(math.pow(h1,2)/(4*math.pow(m1,2)*math.pow(q1,4))) c1=int(c)

t = np.linspace(0, 200, 100)

x = np.linspace(-2, 2, 100)

y_p = (1/((1+c1*t**2)**(1/2)))*(math.exp(-((x-(h1*k1*t/m1))**2/(2*q1**2(1+c1*t**2))))) y=str(y_p)

fig = plt.figure(figsize = (12, 7)) # Create the plot plt.plot(x, y, alpha = 0.4, label ='Y', color ='red', linestyle ='dashed', linewidth = 2, marker ='D', markersize = 5, markerfacecolor ='blue', markeredgecolor ='blue')

plt.xlabel('x axis') plt.ylabel('y axis')

# Add a Legend plt.legend()

# Show the plot plt.show()

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!