Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercise 1: Assign the arguments to the three plt.plot() methods in the cell below using the following conditions for y(x): 1. v(n = 1) 2.
Exercise 1: Assign the arguments to the three plt.plot() methods in the cell below using the following conditions for y(x): 1. v(n = 1) 2. y(n = 1.5) 3. y(n = 2) Hnt: The method that returns the sin of its argument is np.sin() and can be called using the statement np.pi (1 mark) In (): import numpy as np #importing the numpy module import matplotlib.pyplot as plt #importing the matplotlib.pyplot module #define variables length = 1 #Length of the box in meters position = np. linspace(0, length, 100) #defining an array for the position axis that will span the length of the bo def psi(x, n, a): #wave function for the particle in a box return (np.sin((n*pi*x)/a) #Condition 1 plt.plot("x=1", "Y=", label = "$\psi (n = 1)$") #Condition 2 plt.plot("x=1.5", "Y=", label = "$\psi (n = 1.5)$") #Condition 3 plt.plot("x=2", "Y=", label = "$\psi (n = 2)$") ## Methods to decorate the plot ## plt. legend (fontsize = 14) pit.xlabel("Position", fontsize = 14) plt.ylabel("V(x)", fontsize = 14)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started