Let’s use it to assess the precision of our solution: \ = pvec p = 0 p = 0 p = 0 p = 0 # Compute the exact solution p_e = p_exact_2d ( X, Y )Īt the beginning of the notebook, we have imported the l2_diff function from our module file module.py. Consider as an example the Poisson equation in three dimensions: This is especially true when solving multi-dimensional problems. However, for very large systems, matrix inversion becomes an expensive operation in terms of computational time and memory. ![]() When the size of the matrix is not too large, one can rely on efficient direct solvers. Their implementation is a bit more complicated in the sense that they require the inversion of a matrix. ![]() In the previous chapter we have discussed how to discretize two examples of partial differential equations: the one dimensional first order wave equation and the heat equation.įor the heat equation, the stability criteria requires a strong restriction on the time step and implicit methods offer a significant reduction in computational cost compared to explicit methods. insert ( 0, './modules' ) # Function to compute an error in L2 norm from norms import l2_diff % matplotlib inline Import numpy as np import matplotlib.pyplot as plt from scipy.sparse import diags import sys sys.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |