# Tag Info

Accepted

### Type of Rosenbrock method by its coefficients

A search for the specific coefficients listed led me to the method ROS3PRL from J. Sieber, Konvergenzanalyse und Numerische Tests für die Prothero–Robinson–...
• 1,114
Accepted

### Continuous vs discontinuous space-time FEM

More concretely, it can be shown that discontinuous Galerkin (dG(r)) schemes lead to strongly A-stable time stepping schemes and continuous Galerkin (cG(r)) schemes are A-stable time stepping schemes, ...
• 786

### Help implementing finite difference scheme for heat equation

Don't worry about programming skills, everyone's a beginner at some point. It's a good start actually. I'm just going to give some hints assuming that this is an exercise. Actually, choward's answer ...
• 151
Accepted

First off, the PDE can be rewritten instead as $$\frac{\partial C}{\partial t} = \frac{\partial}{\partial x}C\frac{\partial C}{\partial x}$$ or, by applying the product rule in reverse again, as $$\... • 10.3k 5 votes ### "Optimal" domain partitioning in domain decomposition algorithms We use domain decomposition because we want to exploit the power of more than one processor. As a consequence, the right question to pose is: "How do we need to partition the domain so that we ... • 55.8k 5 votes Accepted ### Time discretisation after splitting a 4th order equation The introduction of w is just a reformulation of your initial problem. If you use (2), this means that you make the 4th-order diffusion term explicit, which may potentially lead to stability issues. ... • 1,943 4 votes Accepted ### spurious oscillations Crank-Nicolson The two problems you mention indeed have different roots. The first one is a consequence of numerical dispersion and the other one of numerical instability. Let me elaborate a little: Problem #1: The ... • 221 4 votes Accepted ### 1D FEM for nonlinear diffusion coefficient You would need to linearize the problem. I prefer to do it before discretization but it's possible to do also after discretization. (I'm a bit skeptical of linearization after discretization because I ... • 2,104 4 votes Accepted ### Is there a simple way to add a sparse matrix to an LU decomposition of a dense matrix? There is another factorization you could consider: the Hessenberg upper-triangular reduction. It's usually used as a preprocessing step in the QZ algorithm, but it has other uses as well. Consider the ... • 1,723 4 votes ### Is there a simple way to add a sparse matrix to an LU decomposition of a dense matrix? And just a few minutes after asking I found an answer. The procedure above is called "updating LU". This question has a nice generic answer with links to other more specific questions. full ... 4 votes Accepted ### Is this a diffusion equation, or something else？ This equation is a variation of the heat equation. The fractional derivative is a nonlocal operator, which implies that the equation has "memory": whereas in a traditional ODE (or time ... • 55.8k 3 votes ### Two-dimensional heat equation with Neumann boundary conditions: any hope to find an analytical solution? Expanding (sort of) on @MPIchael's answer, you can pick any smooth function you like and plug it into the heat equation to give a problem to then work the other way. In numerical methods, we call this ... • 10.9k 3 votes Accepted ### Dirichlet boundary conditions in the 1D Heat Equation No, you did not overlook anything. You actually have to know specific g_L(t) - boundary condition at the left boundary (x=-1) g_R(t) - boundary condition at the right boundary (x=1) \eta(x) ... • 8,692 3 votes Accepted ### Help implementing finite difference scheme for heat equation So your first big issue is one you bring up in point (4), where you say you get the error 'u(0, t[m]) = 0 "can't assign to function call"'. You're trying to store data by assigning data to a function. ... • 4,258 3 votes Accepted ### Nondimensionalization of a multi-component chemical diffusion equation The important part of D are not its entries (because they depend on the choice of basis vectors you choose -- whether you work with concentrations of the three elements individually, or linear ... • 55.8k 3 votes ### Continuous vs discontinuous space-time FEM The closest answer that I know to your question is that different choices of basis and test functions are going to have different stability properties. In some cases, you can show that the Galerkin-in-... • 10.3k 3 votes Accepted ### Where am I making a mistake in solving the heat equation using the spectral method (Chebyshev's differentiation matrix)? The answer is quite simple: You have to set the Neumann boundary condition u_x(-1,x)=0 explicitly Add following line (fifth line): ... • 1,388 2 votes ### heat equation on bounded and unbounded domain This question is more related with mathematics than Scientific Computing. But I will mention some things that come to my mind. I am not trying to be rigorous here, though. You are mentioning more ... • 8,524 2 votes ### Trying to compute the error from comparing two arrays I would highly suggest that you use the norm functions in numpy via ... • 556 2 votes ### Trying to compute the error from comparing two arrays You can just do something to the effect of "\mathtt{np.max(np.abs( BS - u ) )}". This computes the L_\infty norm of the error, which seems to be what you're after. It'll save you the heartache/... • 1,512 2 votes ### How suitable is multigrid method for time-dependent PDEs? This statement seems a bit reductive for what is a rather large and involved problem. But multigrid, although it was developed for and is ideal for elliptic problems, is still just about the best we ... • 2,089 2 votes Accepted ### Derivation of a parabolic PDE using Alternating Direction Implicit method Yes, this is correct in the sense that it is second order in both time and space. It is not the only way to handle the f(x, y, t) term, however. From the equations you wrote, it appears that the ... • 1,114 2 votes Accepted ### 3d schrodinger equation weak form The solutions of the Schroedinger equation are complex-valued, so your inner product needs to be$$ (u,v) = \int_\Omega \bar u(x) v(x)\; dx, $$and the norms then become$$ \|u\| = (u,u)^{1/2}. $$... • 55.8k 2 votes ### Stability condition for explicit time FEM for parabolic pdes Well, boy, do I have the resource for you :-) Take a look at lectures 26 and 27 at https://www.math.colostate.edu/~bangerth/videos.html • 55.8k 2 votes ### Two-dimensional heat equation with Neumann boundary conditions: any hope to find an analytical solution? TL DR:$$u_1(x_1) = \cos(2\pi~(\frac{x_1}{L_1}) - \pi) + 1u_2(x_2) = \cos(2\pi~(\frac{x_2}{L_2}) - \pi) + 1u(x,t) = \exp(-a t) u_1(x_1) u_2(x_1)$$How to construct it: Sines and cosines are ... • 2,985 2 votes Accepted ### Backwards Difference Implicit Method for Nonlinear Parabolic PDE in Python Let's reconstruct this from first principles: Defining the ODE system In the method-of-lines discretization you solve an ODE system \dot U=F(U), U=(U_0,U_1,...,U_{M+1}), U_k(t)=u(x_k,t), and ... • 6,109 2 votes Accepted ### Objective function for PDE-constrained boundary control problem in cylindrical coordinates There are a couple of questions here, some of which pertain specifically to the geometry and input data for your problem and some have more to do with PDE-constrained optimization in general. Some of ... • 10.3k 1 vote Accepted ### How to insert a(x) function in non homogeneous parabolic pde for implicit method in Python? I'm not going to debug your code, but since$$(1-x)u_{xx}$$can be discretized, using second order, centered, finite differences with:$$(1-x_i) \frac{u_{i+1}-2u_i+u_{i-1}}{h^2} where $x_i$ is one ...
• 560
1 vote
Accepted

First off, I'd note that your initial condition doesn't satisfy the boundary conditions, so you might want to instead use $u_0(x) = e^{-x^2} - e^{-L^2}$. A great sanity check for problems like yours ...