Skip to content
Snippets Groups Projects
Commit 3ad6b2bf authored by Yifan Wang's avatar Yifan Wang
Browse files

add an example of waveform

parent 443d1fc2
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id: tags:
``` python
%matplotlib inline
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
fig_width_pt = 3*246.0 # Get this from LaTeX using \showthe\columnwidth
inches_per_pt = 1.0/72.27 # Convert pt to inch
golden_mean = (np.sqrt(5)-1.0)/2.0 # Aesthetic ratio
fig_width = fig_width_pt*inches_per_pt # width in inches
fig_height = fig_width*golden_mean # height in inches
fig_size = [fig_width,fig_height]
params = { 'axes.labelsize': 24,
'font.family': 'serif',
'font.serif': 'Computer Modern Raman',
'font.size': 24,
'legend.fontsize': 20,
'xtick.labelsize': 24,
'ytick.labelsize': 24,
'axes.grid' : True,
'text.usetex': True,
'savefig.dpi' : 100,
'lines.markersize' : 14,
'figure.figsize': fig_size}
mpl.rcParams.update(params)
```
%% Cell type:code id: tags:
``` python
!./SEOBNRE --m1 10 --m2 10 --f-min 20 --e0 0.1 --distance 400 --verbose --outname sim1.dat
```
%% Output
f_0 = 2.000000e+01Hz (1.970196e-03[1/M])
Generation took 15 seconds
%% Cell type:code id: tags:
``` python
!./SEOBNRE --m1 10 --m2 10 --f-min 20 --e0 0 --distance 400 --verbose --outname sim2.dat
```
%% Output
f_0 = 2.000000e+01Hz (1.970196e-03[1/M])
Generation took 5 seconds
%% Cell type:code id: tags:
``` python
eccdata = np.loadtxt('./sim1.dat')
data2 = np.loadtxt('./sim2.dat')
```
%% Cell type:code id: tags:
``` python
plt.plot(eccdata[:,0],eccdata[:,1],label='e=0.1')
plt.plot(data2[:,0],data2[:,1],label='no ecc')
plt.xlim(-3,0.1)
plt.xlabel('Time [s]')
plt.ylabel('Strain')
plt.legend()
```
%% Output
<matplotlib.legend.Legend at 0x119a46bd0>
%% Cell type:code id: tags:
``` python
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment