Skip to content
Snippets Groups Projects
Commit 77309782 authored by Laura Christine Kühle's avatar Laura Christine Kühle
Browse files

Replaced symbol 'x' with 'z' for Alpert's wavelet.

parent 020dfa8f
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,8 @@ TODO: Contemplate using Seaborn instead of matplotlib ...@@ -8,7 +8,8 @@ TODO: Contemplate using Seaborn instead of matplotlib
TODO: Double-check everything! TODO: Double-check everything!
TODO: Replace loops with list comprehension if feasible TODO: Replace loops with list comprehension if feasible
TODO: Combine initial projection and approx solution somehow TODO: Combine initial projection and approx solution somehow
TODO: Contemplate erasing inv_mass-matrix as it is identity -> Discuss TODO: Contemplate erasing inv_mass-matrix as it is identity
-> Done (No, because could be problematic for other functions)
TODO: Investigate why we need inverse mass matrix for initial projection, \ TODO: Investigate why we need inverse mass matrix for initial projection, \
but not A and B but not A and B
TODO: Investigate why there are no weights in approx calc TODO: Investigate why there are no weights in approx calc
...@@ -28,6 +29,8 @@ TODO: Make sure instance variables are only set in __init__() ...@@ -28,6 +29,8 @@ TODO: Make sure instance variables are only set in __init__()
TODO: Contemplate moving plots to pertaining files TODO: Contemplate moving plots to pertaining files
TODO: Discuss details plot! TODO: Discuss details plot!
TODO: Fix typo in Vectors_of_Polynomials -> Done TODO: Fix typo in Vectors_of_Polynomials -> Done
TODO: Replace symbol 'x' with 'z' for Alpert's wavelet -> Done
TODO: Check time efficiency of details plot
""" """
import numpy as np import numpy as np
...@@ -379,9 +382,9 @@ class DGScheme(object): ...@@ -379,9 +382,9 @@ class DGScheme(object):
for degree in range(self.polynom_degree+1)] for degree in range(self.polynom_degree+1)]
multiwavelet_coeffs = self.detector._calculate_wavelet_coeffs(projection) multiwavelet_coeffs = self.detector._calculate_wavelet_coeffs(projection)
wavelet = AlpertsWavelet(self.polynom_degree).get_vector(x) wavelet = AlpertsWavelet(self.polynom_degree).get_vector(xi)
wavelet_projection = [[multiwavelet_coeffs[degree][cell]*wavelet[degree].subs(x, 0.5) * value wavelet_projection = [[multiwavelet_coeffs[degree][cell]*wavelet[degree].subs(xi, 0.5) * value
for cell in range(len(coarse_projection[0])) for cell in range(len(coarse_projection[0]))
for value in [(-1)**(self.polynom_degree+degree+1), 1]] for value in [(-1)**(self.polynom_degree+degree+1), 1]]
for degree in range(self.polynom_degree+1)] for degree in range(self.polynom_degree+1)]
...@@ -391,8 +394,8 @@ class DGScheme(object): ...@@ -391,8 +394,8 @@ class DGScheme(object):
for degree in range(self.polynom_degree + 1): for degree in range(self.polynom_degree + 1):
leftMesh = coarse_projection[degree] * self.basis[degree].subs(x, -1 / 2) leftMesh = coarse_projection[degree] * self.basis[degree].subs(x, -1 / 2)
rightMesh = coarse_projection[degree] * self.basis[degree].subs(x, 1 / 2) rightMesh = coarse_projection[degree] * self.basis[degree].subs(x, 1 / 2)
leftTest = multiwavelet_coeffs[degree] * wavelet[degree].subs(x, 1 / 2) * (-1) ** (self.polynom_degree + 1 + degree) leftTest = multiwavelet_coeffs[degree] * wavelet[degree].subs(xi, 1 / 2) * (-1) ** (self.polynom_degree + 1 + degree)
rightTest = multiwavelet_coeffs[degree] * wavelet[degree].subs(x, 1 / 2) rightTest = multiwavelet_coeffs[degree] * wavelet[degree].subs(xi, 1 / 2)
newRowMesh = [] newRowMesh = []
newRowTest = [] newRowTest = []
for i in range(len(coarse_projection[0])): for i in range(len(coarse_projection[0])):
...@@ -431,6 +434,7 @@ class DGScheme(object): ...@@ -431,6 +434,7 @@ class DGScheme(object):
plt.xlabel('X') plt.xlabel('X')
plt.ylabel('Detail Coefficients') plt.ylabel('Detail Coefficients')
plt.title('Wavelet Coefficients') plt.title('Wavelet Coefficients')
plt.show()
def _plot_shock_tube(self): def _plot_shock_tube(self):
time_history = self.update_scheme.get_time_history() time_history = self.update_scheme.get_time_history()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment