Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in calculation of volume intgral flux #27

Open
Balavarun5 opened this issue Sep 22, 2017 · 2 comments
Open

Error in calculation of volume intgral flux #27

Balavarun5 opened this issue Sep 22, 2017 · 2 comments
Assignees
Labels

Comments

@Balavarun5
Copy link
Contributor

commit hash : ba250f5

Issue : Error in calculation of the volume integral flux using Integrate() function.

Calculation of the volume integral flux in the code is done using an Integrate() function.

This function evaluates the integral using quadrature method by taking in the coefficients of the integrand and number of quadrature points.

The term F(u) in integrand represents the flux, when the integral is carried out using the quadrature method, F(u^n), the flux at the quadrature points needs to be calculated.

To do this, first the wave equation for an element is to be calculated and then the value of this function at the quadrature points mapped in the element needs to be calculated.

This is done by taking the amplitude at the LGL points in each element (known) and obtaining the amplitude as a function of xi by representing it as a linear combination of the Lagrange basis polynomials.

U(x) = a_i L_i(xi)

Where the coefficients a_i are the value of the function at the LGL points.

Error

The error in calculating the volume integral using this method is not trivial.

threshold = 8e-9

The error of calculating the volume integral flux for an initial wave amplitude e ** (- x ** 2 / 0.4 ** 2)
and Lagrange basis polynomials calculated using 8 LGL points is plotted against the number of quadrature points below.

image

Possible error

The amplitude equation e ** (- x ** 2 / 0.4 ** 2) is calculated using the Lagrange basis polynomials (polynomials of order 7).

@mchandra
Copy link
Contributor

mchandra commented Oct 8, 2017

How are you computing the reference solution with which you are computing the error?

@amanabt
Copy link
Member

amanabt commented Oct 9, 2017

I wrote a test code for finding the error between the integral image, calculated using the volume_integral_flux function and analytical integral.
I used scipy.integrate.quad to calculate the analytical integral.
You may find the test python notebook at this address volume_integral_error_analysis.ipynb

I experimented with varying image and image and some relationships between image and image. Below are the plots for various conditions.

image
image
image
image
image

Clearly, for the case of image the error goes below image. So, we may try to use this condition to minimise our error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants