3

This problem is too small to actually be sparse. Sparse handling has a big overhead because the indexing is not "direct", i.e. you don't necessarily know where the next value will be without branch checking. So you need it to be "sparse enough" that the O(n^3) dense LU-factorization cost shrinking to the purely non-zero terms overcomes ...


3

If your advection problem had Dirichlet of Neumann boundary conditions, the linear system would be tridiagonal and you could apply the Thomas algorithm. With periodic boundary conditions, however, we lose this. If c(x) is a constant independent of x, the matrix would be circulant and linear systems could be solved efficiently using FFTs. An even better ...


2

odenumjac calls your function in a vectorized manner it seems, and your function is not vectorized. You can easily change that by changing the second index of f in your function to : instead of 1, for instance: f(10,:) = 2*(x(end-1,:) - x(end,:)); I thought the setting joptions.vectvars=1 would not allow the vectorised call (see one of your other questions). ...


2

It seems that the Jacobian ratio is defined as the ratio between the maximum and minimum Jacobian determinant in an element [1, 2]. And, that a value between 0.33333 and 1 is good-enough [3]. Nevertheless, for linear elements, the Jacobian is constant and thus the same over each element. As mentioned by @GustavoCosta, 3 descriptors commonly used for element ...


Only top voted, non community-wiki answers of a minimum length are eligible