You solve the 1D-advection equation with $c$ a constant velocity: $$\frac{\partial u}{\partial t} + c\frac{\partial u}{\partial x}=0~~~~~~~~(1)$$ When you discretize this equation (with an explicit ...

I don't remember exactly the formulation in finite-element but I believe you need to compute the determinant of the jacobian when you define the transformation between some element and the reference ...

What you mention is called hybrid parallelism. A cluster is composed of several nodes. A node is a group of sockets that share the same physical memory and a socket is a group of cores that we refer ...

According to the way you defined your stencil in your picture, I think you made a mistake in your formula, that should be : $$v_{i+1,j}=(0.1)v_{i,j-1}+(0.8)v_{i,j}+(0.1)v_{i+1,j}$$ You have switched ...

If you want your PC to perform numerical simulations, the processor is clearly the first component you should paid attention to. For this kind of application, Intel i7 and Intel Xeon are often used in ...

The numerical diffusion is not related to an equation specifically but is related to the way you discretize this equation. Depending on the discretization stencil you choose (upwind, downwind, ...

When you run your program with the parameters you specified, you don't get the error, but the solution at time $t=10$. To compute an error, you need to compare the numerical solution to the ...

At line 473 of the source code you provided : contrl - is the actual driver of the package. This routine contains the strategy for nonlinear equation solving. This code is written in Fortran 77 so ...

From a strict programming point of view, a complex number is composed of a real part and an imaginary part, that is to say, two real values. So I guess that real arithmetic applies here, except for ...

The integral function in MATLAB performs numerical integration. See the MATLAB help, it's straightforward to use. Actually, an analytical solution of your integral exists. The calculations are a bit ...

This is more of a Stack Exchange or Programmer Exchange question, see : here for C language or PHP, Javascript or C++, and more generally. Try to avoid global variables. It's better for maintaining ...

In the same way you would do to implement a comparison with zero. For instance, in numerical solvers, one sometimes needs to check whether a value reaches zero. That is not feasible in a formal way ...

First, your time step dt is a matrix. That is not possible. Just below your calculate the number of required time step to reach tMax. You do not know that. You do not know how many time step you will ...

If the exact solution is unknown, then yes you have to take the smaller grid as reference. Then you run your simulation with different mesh size, each one varying by a factor 2 and you compute the ...

In (very) short : Because basically a computer is composed of multiple electronic devices that consistently switch between two states (see transistors). For a human, this can be idealized by a state 0 ...

A similar subject here where I show the way to calculate the truncation error with the advection equation. A search gives me this. I think that could answer your question ?

If your data are regularly spaced, you do not need an interpolation procedure, you can directly plot a contour through a contour or a pcolor command. That why I don't understand why you need to ...

Each method has its pros and cons. LBM ans NS solvers are both efficient and reliable. The no-slip condition may be important for physical meanings, otherwise it may be enough for you to solve Euler'...

The magnitude plot may display the norm of the vector so it is obviously non-negative. You may be able to get what you are looking for by taking the dot product of your vector with the vectors from ...

In short, you can recognize a conservative formulation if a divergence operator is involved in the equation. For instance, the mass conservation equation is naturally written in conservative form : ...