Skip to content

Commit b390f5c

Browse files
committed
updated figure5-8 loglog plotter
1 parent da4bbe3 commit b390f5c

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

scripts/pseudo-spectrum/figure_5-8-loglog.py

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def trap(z):
4343
Tend, nslices, maxiter, nfine, ncoarse, tol, epsilon, ndof_f = par.getpar()
4444

4545
nsteps = [1, 2, 4, 8, 12, 16, 20]
46-
nsteps = [1, 10, 50, 100, 1000, 10000]
46+
nsteps = [1, 10, 25, 50, 75, 100]
4747

4848
ndof_c_v = [16, 24, 30]
4949
xaxis_f = np.linspace(0.0, 1.0, ndof_f+1)[0:ndof_f]
@@ -90,6 +90,7 @@ def trap(z):
9090
elif figure==8:
9191
u0coarse = solution_dedalus(np.zeros(ndof_c), ndof_c)
9292
filename = 'figure_8.pdf'
93+
sys.exit("Cannot compute exp(lambda*dt) for Dedalus, because the matrix A_f is not accessible.")
9394
else:
9495
sys.exit("Value of figure should be")
9596

@@ -123,27 +124,15 @@ def trap(z):
123124
fs = 8
124125
ms = 4
125126
fig = plt.figure(1)
126-
#plt.plot(dt_f_v[0,:], norm_l2[0,:], 'bo-', label='m='+str(ndof_c_v[0]), markersize=ms)
127-
#plt.plot(dt_f_v[0,:], norm_l2[1,:], 'rx-', label='m='+str(ndof_c_v[1]), markersize=ms)
128-
#plt.plot(dt_f_v[0,:], norm_l2[2,:], 'cd-', label='m='+str(ndof_c_v[2]), markersize=ms)
129-
#plt.loglog(dt_f_v[0,:], norm_l2[0,:]-np.abs(np.exp(np.multiply(A_f_eig[0,:],dt_f_v[0,:]))), 'bo-', label='m='+str(ndof_c_v[0]), markersize=ms)
130-
#plt.loglog(dt_f_v[0,:], norm_l2[1,:]-np.abs(np.exp(np.multiply(A_f_eig[1,:],dt_f_v[0,:]))), 'rx-', label='m='+str(ndof_c_v[1]), markersize=ms)
131-
print(norm_l2[1,:])
132-
print(A_f_eig[1,:])
133-
print("\n")
134-
print(norm_l2[2,:])
135-
print(A_f_eig[2,:])
136-
137-
plt.loglog(dt_f_v[0,:], norm_l2[2,:]-0.0*np.abs(np.exp(np.multiply(A_f_eig[2,:],dt_f_v[0,:]))), 'cd-', label='m='+str(ndof_c_v[2]), markersize=ms)
138-
#plt.plot(dt_f_v[0,:], 1.0 + 0.0*dt_f_v[0,:], 'k:')
127+
plt.loglog(dt_f_v[0,:], norm_l2[0,:]-np.abs(np.exp(np.multiply(A_f_eig[0,:],dt_f_v[0,:]))), 'bo-', label='m='+str(ndof_c_v[0]), markersize=ms)
128+
plt.loglog(dt_f_v[0,:], norm_l2[1,:]-np.abs(np.exp(np.multiply(A_f_eig[1,:],dt_f_v[0,:]))), 'rx-', label='m='+str(ndof_c_v[1]), markersize=ms)
129+
plt.loglog(dt_f_v[0,:], norm_l2[2,:]-np.abs(np.exp(np.multiply(A_f_eig[2,:],dt_f_v[0,:]))), 'cd-', label='m='+str(ndof_c_v[2]), markersize=ms)
139130
plt.legend(loc='best', bbox_to_anchor=(0.5, 0.5), fontsize=fs, prop={'size':fs-2}, handlelength=3)
140131
plt.xlabel(r'$\delta t = \Delta t$', fontsize=fs)
141-
#plt.ylabel(r'$|| \mathbf{E} ||_2$', fontsize=fs)
142132
plt.ylabel(r'$|| \mathbf{E} ||_2 - | \exp(\lambda_{m+1} \delta t) |$', fontsize=fs)
143133

144134
plt.xlim([0.0, dt_f_v[0,0]])
145-
plt.ylim([1e-2, 1e1])
146-
#plt.xlabel([0, maxiter])
135+
plt.ylim([1e-3, 1e1])
147136
plt.gcf().savefig(filename, bbox_inches='tight')
148137
call(["pdfcrop", filename, filename])
149138
plt.show()

scripts/pseudo-spectrum/figure_plot_solution.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,3 @@
111111
plt.gcf().savefig(filename, bbox_inches='tight')
112112
call(["pdfcrop", filename, filename])
113113
plt.show()
114-
plt.show()

0 commit comments

Comments
 (0)