# Tag Info

## Hot answers tagged computational-physics

### Why do my satellites fall out of orbit?

Start with fewer bodies, can you simulate two masses with a spring or an earth/moon system? Track the total kinetic energy and potential energy of the system to verify that your integrator is (...
• 2,985

### Speeding up 3 body problem acceleration calculation

Welcome to Scicomp! For all following points, always measure and compare. Don't fall for premature optimization! It is the root of all evil. Is the time you spend on optimizing your code worth your ...
• 2,985

### Solving non-linear partial differential equation numerically: $u_{xx}+u_{yy}=\mathrm{e}^{u}$

You can use something like MethodOfLines.jl to solve your problem. You can modify the following example, something like this ...
• 400
Accepted

### Understanding leapfrog integration algorithm

In the second code the full time stepping is given by three lines in main() ...
• 465

### Is my differential equation solving code wrong?

The cross product with $H$ acts like a complex unit in the plane that has $H$ as normal, especially if you select $H$ to be a unit vector. Components parallel to $H$ remain unchanged. What you should ...
• 6,109

### Understanding leapfrog integration algorithm

The first code is wrong if you have multiple particles that interact. Due to the structure of the loop, the interaction forces with particles at the start of the list are computed with the updated ...
• 6,109

### Euler's Method for fast moving particle trajectory

I tried to modify your code as little as possible and include the comments by @lightxbulb. I changed the indices in the time stepping loop and modified $F$ and $B$ so that they are being updated in ...
• 786

### How to leverage the GPU for parallel 3-body problem computations

CUDA has an example repository with codes for different use cases. There are samples for dealing with matrix operations like the approach you took above. One of the advanced use cases listed is the ...
• 2,985

### Redefining velocity field to make it divergence free on the grid level

In finite element simulations, we have similar issues for simulations where the spatial mesh changes, e.g. for adaptive meshes that change between time steps. There you have that the solution from one ...
• 786

### Isolating decaying solutions to nonlinear second-order ode

Eliminating the constants, the approximation close to $x=0$ is $y(x)=\pi+xy'(x)$ with $y'$ nearly constant. Or one could multiply the leading terms with $2x^2y'$ and integrate  2x^2y'y''+2xy'^2-2\...
• 6,109

### H(curl) conforming Nédélec-Elements to satisfy div(B)=0

The answer you are looking for is found in the notion of weak divergence. Recalling some basic facts about distributions, we say that a function $u$ has a weak divergence if for any smooth function ...

### Different Results for Double Pendulum

You should make sure your integration is precise enough. I suggest you use the DOP853 algorithm of solve_ivp, which of higher order, and set tight error tolerances, e.g. rtol=atol=1e-12. Then assess ...
• 1,943
1 vote
Accepted

### Exact Riemann Solver for Multi-Component 1D Euler Model

I finally found the solution. In the reference [3] the procedure is very detailed, it was just I did not know that mass fractions (Y) do not change across shocks or rarefactions. They just change ...
• 11
1 vote

### Non-dimensionalizing the Ideal MHD System

It depends on what kind of physics you're interested in, but typically for MHD I tend to normalize the magnetic field energy to match the fluid energy: \begin{gather} e_0 = m_0 n_0 V_0^2\\ P_0 = e_0\\ ...
• 2,794
1 vote

### Will hashing become vulnerable to quantum computers?

As Wolfgang pointed out, your description seems to conflate hashing with encryption. Hashing produces a small, fixed size value in a given range. The popular SHA256 uses 256 bits. A "secure" ...
• 1,008
1 vote
Accepted

### Lattice Boltzmann method parallelization

DISCLAIMER: For an in-depth discussion, see Chapter 13.4 in Krüger, which addresses this in 40+ pages. Here, I merely outline two basic ideas. The core LBM consists of the steps Free stream/...
• 1,083
1 vote

### Precession of Mercury Python simulation

It's quite easy to get the necessary precession for Mercury if you take gravitational and kinematic time dilation/length contraction into account. The Newtonian acceleration vector is: ...

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