New answers tagged

0

TEBD is an approximation method that relies on an ansatz for the wavefunction in terms of matrix-product states. If you consider the formula for MPS in the link, you see that the different degrees of freedom are coupled in a "one-by-one style". This works good for spin chains as these use short-range interaction potentials, typically nearest ...


4

The correct dynamic equations in the polar coordinates should be $ \dot{v_r} = \omega^2 r - \alpha/r^2 \\ \dot{\omega} = - 2 v_r \omega /r\\ \dot{\theta} = \omega \\ \dot{r} = v_r $ Here is the fixed Python code: from math import * import numpy as np from matplotlib import pyplot as plt from scipy.integrate import odeint def vec(w,t): r,vr,theta,omega=...


0

Yes, tens of minutes for the model to run is a lot. If you are using a gradient based minimization algorithm such as BFGS to calculate the parameters, you might consider using the adjoint method for computing the gradient very efficiently.


2

50 is a lot of parameters. You could try doing a basic first order sensitivity analysis to determine whether you can drop any of these. Using Bayesian Optimization to minimize a cost function is one way of dealing with the problem you've encountered. But remember that your standard L2 norm might have counterintuitive behaviours in high dimensions (see On the ...


2

For debugging the code, there is a set of analytic solutions here for several reduced models corresponding to subsets of terms on the right-hand side. These analytic solutions have to be reproduced by the code. Verification testing of this kind is a standard practice for debugging simulation models. Reduced model 1: $ m \ddot{x} = - \gamma \dot{x} $ Solution:...


3

The algorithm for perfoming a single HMC step is as follows: Input: Some initial configuration $\vec{y}_i$ and momentum $\vec{p}_i$. Output: Next configuration $\vec{y}_{i+1}$ and momentum $\vec{p}_{i+1}$ Draw a random momentum $\vec{p}_*$ from a Gaussian distribution. Numerically solve Hamilton's equations of motion for some time (i.e., perform some ...


0

Your initial and end points for the line are the same, thus you only have one line that "emanates" from it. To have multiple streamlines you need multiple seed points. You need to have a vertical line that spans your domain to obtain something similar to what you want.


3

Generally you should consider: Convection: $$ \Delta t_C \le CFL \cdot \alpha_{RK}(p) \cdot \frac{\Delta x}{(2k + 1)|\lambda|}. $$ Diffusion: $$ \Delta t_D \le DFL \cdot \beta_{RK}(p) \cdot \frac{\Delta x^2}{(2k + 1)^2\nu}. $$ Finally: $$\Delta t = \text{min}(\Delta t_C,\Delta t_D).$$ Here $\alpha$ and $\beta$ are scaling factors for different RK methods ...


Top 50 recent answers are included