savefig ( fname = 'damped_well.jpg', format = 'jpg' ) plt. plot ( Time_list, X_list, label = r '$\alpha$ =' + str ( alpha / np. pi * x - 4 * alpha * v # updating accelration t += dt #updtaing time X_list. pi * x - 4 * alpha * v #acceleration t = 0 #initial time dt = 0.01 #time step size end_time = 7 X_list = #position list Time_list = #time list while ( t <= end_time ): #runnnig while loop till it reaches end_time x += v * dt # updating position v += a * dt #updating velocity a = - 4 * np. array () # taking three values of alphha for i in range ( 3 ): x = 1 #initial position v = 0 #initial velocity alpha = Alpha_array #indexing alpha value a = - 4 * np. figure ( figsize = ( 15, 12 )) #creating figures plt. use ( 'seaborn-dark-palette' ) import numpy as np plt. use ( 'Solarize_Light2' ) #i used to style so that i can make it as thumbnail of my bolgs style. Import matplotlib.pyplot as plt #importing libraries from matplotlib import style style. A damped harmonic oscillator is displaced by a distance x 0 and released at time t 0. \frac Now we will check the solution for the three values ΒΆ 1. Let say particle is oscillating in the x direction.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |