18 votes

Has anyone used Julia to write a PDE solver?

Yes, lots of people have. Automatic Jacobian sparsity handling shows up in the second tutorial of DifferentialEquations.jl, where it's able to run sparsity detection on normal Julia code to get the ...
Chris Rackauckas's user avatar
15 votes
Accepted

Adaptive gradient descent step size when you can't do a line search

I'll begin with a general remark: first-order information (i.e., using only gradients, which encode slope) can only give you directional information: It can tell you that the function value decreases ...
Christian Clason's user avatar
14 votes
Accepted

$L^2$-convergence of finite element method when right hand side is only in $H^{-1}$ (Poisson eqn)

Yes, this is the standard Aubin-Nitsche (or duality) trick. The idea is to use the fact that $L^2$ is its own dual space to write the $L^2$-norm as an operator norm $$\|u\|_{L^2} = \sup_{\phi\in L^2\...
Christian Clason's user avatar
14 votes
Accepted

Galerkin method: Test functions vs. Basis functions

Suppose that the solution $u$ of the PDE lives in some function space $X$. We'll write the PDE as a bilinear form $A(u, v) = f(v)$ for all $v$ in $X$, where $f$ is some element of the dual space $X^*...
Daniel Shapero's user avatar
12 votes
Accepted

Understanding the Courant–Friedrichs–Lewy condition

I have two extra points I would like to add to Wolfgang's answer. A formulation of the CFL condition that I find more useful than the classic formula is this: A necessary condition for the ...
David Wells's user avatar
11 votes

Is using iterative methods to solve a linear system always superior to inversing the matrix?

First off, there are basically no scenarios where one would ever actually compute and store $A^{-1}$ in memory, even for small problems. An LU factorization offers both superior efficiency and ...
whpowell96's user avatar
  • 2,444
10 votes
Accepted

How do I simulate an open end?

The problem you describe, how to prescribe non-reflecting or absorbing boundary conditions when solving partial differential equations (PDE) has been extensively studied. For complex (e.g. nonlinear) ...
Bill Greene's user avatar
  • 6,064
10 votes

What are the most important theorems in computational science?

You'll get everyone to give different answers to this question, and maybe that's alright. Here are some of my favorite ones: Taylor's theorem that a function (of sufficient smoothness) equals its ...
Wolfgang Bangerth's user avatar
10 votes

Why not use the convolution theorem for explicit timestepping?

This is a linear PDE, and so while this technique works here, it would not work for any nonlinear PDE. Often times when people are solving these equations it is to get experience with common solution ...
EMP's user avatar
  • 2,079
10 votes

What condition ensures the global continuity of the solution in the FEM?

For the linear elements you consider, you are mapping the shape functions from the reference cell to each of the cells of your mesh. The important properties you are using here are: The shape ...
Wolfgang Bangerth's user avatar
9 votes

Understanding the Courant–Friedrichs–Lewy condition

You are correct: If you satisfy the CFL condition, then all that guarantees is that your scheme is stable, i.e., the numerical solution does not go to infinity. But the CFL condition says nothing ...
Wolfgang Bangerth's user avatar
9 votes

Writing a single PDE from a gradient equation

Your equation is not well posed: For general functions $f_1,f_2$, there is no function $\Phi$ so that the equation can be satisfied. For example, if you had $f_1=f_2=x$, then you are looking for a $\...
Wolfgang Bangerth's user avatar
9 votes

Why in scientific papers convergence of finite difference and finite volume schemes is tested using multiple norms ($l_1$, $l_2$ and $l_{\infty}$)?

In finite dimensional spaces (say, in $\mathbb R^n$), all norms are equivalent and as a consequence, if something converges with a specific rate in one norm, it also converges with the same rate in ...
Wolfgang Bangerth's user avatar
8 votes
Accepted

How to numerically minimize a functional?

Variational problems like this are special cases of optimal control problems, for which there is a huge literature on solution methods and also a good amount of available software. To express it as in ...
JayMFleming's user avatar
8 votes
Accepted

Solving PDE implicitly or explicitly depending on stiffness

If you just slap together an implicit and an explicit method you will likely have order loss. You can do so with low order methods though, and Crank-Nicholson mixed with some other integrator is an ...
Chris Rackauckas's user avatar
8 votes

Limitations with dynamical systems vs. PDEs?

PDEs are a form of dynamical system where there is another continuous variable. Usually this is space, so you're looking at how things over time and space instead of just over time. Here's an ...
Chris Rackauckas's user avatar
8 votes
Accepted

Computation of diffusion time

It's easy to derive that equation from Fick's law. You have this diffusion equation as: $$\frac{\partial C}{\partial t} = D \nabla^{2} C$$ The mean square displacement weighted by the concentration ...
Mithridates the Great's user avatar
8 votes

Jacobians with automatic differentiation

Julia has a whole ecosystem for generating sparsity patterns and doing sparse automatic differentiation in a way that mixes with scientific computing and machine learning (or scientific machine ...
Chris Rackauckas's user avatar
8 votes
Accepted

What is the weak form of a vector type Laplace equation?

Your reasoning for vector type equation is correct when you wrote it down for each individual component. What occurs is that you need to write your interpolation basis function and your test function ...
BlaB's user avatar
  • 1,157
8 votes
Accepted

A priori FEM estimates without $H^2$ regularity

The usual argument for error estimates in the energy norm is to first use the best-approximation property to get things back to the interpolation error. That is, $$ \| u-u_h \|_{H^1} \le C \| u-u_I \...
Wolfgang Bangerth's user avatar
7 votes
Accepted

How to measure efficiency of the differential equations solver

There are many different ways to do this. One of the standard is a work-precision plot where you plot the amount of time or function calls that it takes in order to achieve a certain level of accuracy....
Chris Rackauckas's user avatar
7 votes
Accepted

Is a symmetric bilinear form necessary to ensure a weak formulation has a solution?

To understand the functional analysis (existence & uniqueness) part of the finite element method, it's helpful to see an analogy in linear algebra. In the world of linear algebra, when you ...
Paul's user avatar
  • 12k
6 votes

How do I program periodic boundary conditions?

Typically, you would add "guard cells", that is (for u) u(-1) and u(n+1) with your notation. Before each integration step: u(n+1) = u(0) u(-1) = u(n) and ...
Pierre de Buyl's user avatar
6 votes

conservative v non-conservative

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 : $$...
Coriolis's user avatar
  • 629
6 votes

Is this system of diffusion equations well-posed?

I think it might be ill-posed, since the time-dependent parts are linearly dependent. If you add your two time-dependent equations together, you get a time-independent equation: $(\alpha(x)u_x)_x + (...
David Ketcheson's user avatar
6 votes
Accepted

When is it safe to ignore the diffusion term in an advection-diffusion equation?

The stationary equation you show transports information from the right to the left via the advection term; it also diffuses slightly. If you switch off the diffusion term altogether, then you only ...
Wolfgang Bangerth's user avatar
6 votes
Accepted

Von Neumann stability analysis with a constant term

From your link, consider the definition of the round off error and the statement "Since the exact solution must satisfy the discretized equation exactly, the error must also satisfy the discretized ...
origimbo's user avatar
  • 2,249
6 votes
Accepted

Why is the continuous Galerkin Finite Element Method a poor choice for the inverse problem for the Navier-Lame equation?

The issue with finite elements in the current context is not that you have a first order differential equation, but with the kind of first order equation you have. In general, finite element methods ...
Wolfgang Bangerth's user avatar
6 votes
Accepted

treating "almost linear" nonlinear least-squares problems

If you change variables to optimize for the residual of the linear part, then the Hessian will be a low-rank update to the identity. Then L-BFGS would work very well. Specifically, your problem takes ...
Nick Alger's user avatar
  • 3,143
6 votes

Does a generic method for solving a system of PDEs exist?

No. Different discretizations are stable/unstable on different PDEs. There is no one size fits all approach to the whole class of PDEs. (Even for ODEs there are generic methods but which methods are ...
Chris Rackauckas's user avatar

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