14

The CFL condition states that the "mathematical domain of dependence" must be (asymptotically) contained in the numerical domain of dependence. For hyperbolic problems, this provides a bound $\Delta t < C \Delta x$ that is useful at all resolutions. For a parabolic problem, it merely requires that $\Delta t \in o(\Delta x)$ in the limit $\Delta x \to 0$. ...


10

This phenomenon is often called "ringing" and plagues methods that are not $L$-stable. This can be seen in this motivating example from Hairer & Wanner (1999) "Stiff differential equations solved by Radau methods". Consider the equation $$ \dot y = -50 (y - \cos t) $$ and apply explicit Euler with time step near the stability limit, implicit midpoint ...


9

The best way to do this is (as you said) to just use the definition of periodic boundary conditions and set up your equations correctly from the start using the fact that $u(0)=u(1)$. In fact, even more strongly, periodic boundary conditions identify $x=0$ with $x=1$. For this reason, you should only have one of these points in your solution domain. An open ...


8

This makes no sense. Let us assume that $g(z)=0$ has exactly one solution $z=z^\ast$, then your boundary condition $g(u|_\Gamma)=0$ is equivalent to $u|_\Gamma=z^\ast$, i.e., a linear Dirichlet condition. On the other hand, if there are multiple solutions of $g(z)=0$, then you are saying that the value $u|_\Gamma$ could have multiple values, but this does ...


6

I'm going to write this as an answer although it doesn't directly answer the question. Plugging the second equation and the third equation into the first, and plugging the third into the second, together give: $$ \begin{align} \frac{\partial^2 c}{\partial t^2} &= \frac{\partial^2}{\partial x^2}\frac{\partial c}{\partial t} + \frac{\partial b}{\partial ...


6

A two-point flux like this is not convergent if the mesh is not "orthogonal", in the sense that the edge/face between two cells is orthogonal to the line segment joining the cell centroids. If your mesh is orthogonal, you would use the distance between centroids for $h_{ij}$ above. If you would like a method to work on more general meshes within the cell-...


6

The solutions for the equation are in $$\psi \in \mathbb{C}^{3M}\times\mathbb{R}^+ \enspace .$$ If the number of electrons is small enough you can just use any traditional method. Like a domain discretization method (Finite Difference, Finite Element, Boundary Element), or a pseudospectral method. Since solving this equation is not more difficult than ...


6

Such problems (sometimes called lateral Cauchy problems) are in general not well-posed (meaning they either lack a solution, or there are infinitely many of them, or the solution is unstable under perturbations of the boundary conditions). For parabolic (or dissipative) equations, it makes sense to study the stationary limit (simply omit the term $u_t$ in ...


5

I get $u''=-n^2 u$, and the condition holds with $K=0$. By the way, Kreiss' conclusion holds for any linear operator; no ellipticity must be assumed.


5

As Jed says, limiters are not usually an efficient approach for parabolic/elliptic problems. WENO is much more expensive than simple piecewise-polynomial interpolation, so I would first try vanilla interpolation and see if you actually have oscillations. WENO is really designed for situations in which the solution is discontinuous; yours is not. In case ...


5

The sources you are looking at are all looking at hyperbolic problems. The issues are different for elliptic problems and "limiters" are generally not the preferred tool. I outlined some of the methods and tradeoffs in this answer. As for time integration, $L$-stability is the important property to prevent bad overshoots for parabolic systems. ...


5

A nice reference for this is Chapter 10 of LeVeque's finite difference book. Of course, it only covers basic finite difference approaches, and there are plenty of others (all within the method of lines framework). The method of lines is indeed applicable in multiple dimensions, and two-dimensional problems are discussed in the reference just given. Most ...


5

On your first question: I assume that by "usual discretization matrix" you mean either the 3-point finite difference discretization in 1d, or what you get using linear finite elements. In either case, it's not actually the Crank-Nicolson scheme that determines this. It's true that for the two spatial discretizations mentioned above, the spatial error is $O(h^...


5

Parabolic PDE's such as those in the book can usually be solved using the Method of Lines. First you create some mesh for the $x$ direciton. I will assume that you used some uniform spacing since the plots don't show any characteristics that show the need of non-uniformity. Next you recast your equations with only the time derviative on the left hand side ...


5

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 is complete, this is just a rephrasing of his suggestions in, I hope, a more beginner friendly language. So, if you do accept an answer it should be his ;) Your ...


5

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 $$\frac{\partial C}{\partial t} = \frac{1}{2}\frac{\partial^2}{\partial x^2}C^2.$$ This equation is often referred to as the porous medium equation or the slow ...


4

Let $$A = \left(\begin{array}{ccccc} -2 & 1 \\ 1 & -2 & 1 \\ &&\ddots\\ &&1 & -2 & 1\\&&&1&-2\end{array}\right)$$ be the standard Laplacian matrix. Your system can be written in traditional time-stepping form as $$u^{n+1} = \left(I + \frac{h}{(h')^2}A\right)u^n \doteq Mu^n,$$ where $$u^n = \left(\begin{...


4

As Hui pointed out above, to apply Neumann boundary conditions correctly you should utilize ghost points and extend your $n^{th}$ order discretisation stencil to your domain boundaries. Utilising forward/backward difference or extrapolation at the boundary will degrade your solution. Assuming a $2^{nd}$ order central difference scheme the Neuman boundary ...


4

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 PDE in question is non-dispersive, i.e. waves of any frequency and wavenumber will travel equally fast - at speed $a$. However, after discretisation, this is ...


4

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 have never looked into the details. In general, discretization and linearization steps do not commute.) In the following I assume that the equation is actually ...


3

I think that one key point to understand the answers is that, with the parabolic PDE that you wrote, we have some control on the "quantity of $u$", i.e. $\int_{\Omega} u $: If you integrate the PDE, you have $$\int_{\Omega} u_t = \int_{\Omega} \Delta u + \int_{\Omega} f(x,t) = \int_{\Omega} f(x,t)$$ because $\int_{\Omega} \Delta u = \int_{\partial \Omega} \...


3

Providing a whole detailed solution is out of the scope of this site, but asking for references is on-topic, so here is what I would suggest to get started: There are many good books on finite difference methods (for instance, "Finite Difference Methods for Ordinary and Partial Differential Equations: Steady-State and Time-Dependent Problems" by LeVeque, or ...


3

You want to solve for 3 to 10 particle systems (3D per particle)? As far as I am aware, mean field theories do not work especially well for so few particles, but it seems there has been DFT work on diatomic molecules. Is this a system where Born-Oppenheimer is valid? If so, I might be inclined to expand the electronic wavefunction using a linear combination ...


3

The Crank-Nicolson discretization of this equation will read $$ \frac{T^n-T^{n-1}}{\Delta t} = \frac 12 \left[ \partial_x \left((T^n)^{5/2} \partial_x T^n\right) + \partial_x \left((T^{n-1})^{5/2} \partial_x T^{n-1}\right) \right] $$ which is a nonlinear, time-independent, elliptic partial differential equation in $T^n$. The way to solve such ...


3

It depends on how you define "projection" and what scheme you are using. But let's investigate the backward Euler method. There, you need to solve the following discrete problem in every time step: $$ (v_h,U_h^n) + \Delta t (\nabla v_h, \nabla u_h^n) = (v_h, U_h^{n-1}). $$ The question is what to use in the first time step: Either $$ (v_h,U_h^1) + \...


3

Yes, with Dirichlet boundary conditions you always have exponential convergence to the staedy state. Any PDE book will have a proof. For a nice explanation from a numerical perspective, see chapter 2 of LeVeque's FDM book.


3

The confusion was the misleading variables $F_{j-1/2}$ and $F_{j+1/2}$ with f_left and f_right, which are completely different. f_left and f_right are the interpolated fluxes at a one single face. They must be then upwinded using the advection speed to compute the Flux at a specific cell face. Which means if $C>0$ we take f_left, otherwise we take ...


3

So after browsing the paper a bit, I think that the answer is essentially what Christian Clason stated in his comment. It seems that the original question refers to the statement just above Equation (3) in the article linked by kwesi : There, the authors say that the advection-diffusion equation (Equation (1) in the paper) $\frac{\partial c}{\partial t} + \...


3

You really don't want to solve the heat equation with an explicit time stepping scheme. You need to choose the time step so incredibly small that you won't make any progress towards the end time. (Explanation in lecture 27: http://www.math.tamu.edu/~bangerth/videos.html .)


3

While i agree with Wolfgang that its best to choose Crank-Nicolson time stepping, i think it is incorrect to assert explicit time stepping results in 'incredibly small' time steps or even to suggest your script is not functioning because of explicit time stepping. You can make it work just fine, but you need to get your discretization correct and to ...


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