Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

JFM notebooks for "nterfacial instability of low-density jet with surface tension"

199 views
ubuntu2004
Kernel: Python 3 (system-wide)
# import matplotlib.pyplot as plt # import numpy as no # import pandas as pd # from matplotlib import rcParams # config = {"font.family":'serif',"font.size":15,"mathtext.fontset":'stix'} # rcParams.update(config) # data = pd.readexcel() # t0 = data.iloc[:,1] # A0 = data.iloc[:,2] # t = [], A=[] # def FFT_Data(x,N) # return np.abs(fft(x))/N*2. # Am = [] # Am = FFT_Data(A,len(n)) import numpy as np from scipy.fft import fft import matplotlib.pyplot as plt # Define the time domain t = np.linspace(0, 2*np.pi, 200) # Define the signal (a sine wave with frequency 10 Hz) f = np.sin(10*t) # Compute the FFT of the signal F = fft(f) # Define the frequency domain freq = np.fft.fftfreq(len(t), d=t[1]-t[0]) # Plot the signal and its FFT fig, (ax1, ax2) = plt.subplots(nrows=2, figsize=(8, 6)) ax1.plot(t, f) ax1.set_xlabel('Time [s]') ax1.set_ylabel('Amplitude') ax2.plot(freq, np.abs(F)) ax2.set_xlabel('Frequency [Hz]') ax2.set_ylabel('Amplitude') plt.show()
Image in a Jupyter notebook