# Questions tagged [computational-physics]

Computational physics is the study and implementation of numerical algorithms to solve problems in physics for which a quantitative theory already exists.

354 questions
Filter by
Sorted by
Tagged with
134 views

### OpenMP: parallelizing calculation of pair interaction forces

I recently started to learn OpenMP. Albeit I have developed some intuition I still have some doubts on how to proceed under certain circumstances that are very useful for computational physicists. My ...
47 views

81 views

### Finding the extrema of a transition probability function for a quantum walker on a graph

The goal Implement some Python code to find the extrema points of a function that is strongly oscillating. The background Let $G$ be a connected graph with $n$ points with Laplacian matrix $L(G)$. We ...
57 views

### Electrostatic Force - Simulate Trajectory of Test Particle using Runge Kutta - Force always Repels

In the center of a 2D-Plane a positive static charge Q is placed with position r_prime. This charge creates a static electrical Field E. Now i want to place a test particle with charge Q and position ...
67 views

### Numerical minimization of the action in python

I want to find the trajectory $x(t)$ which minimizes the action $S = \int_{t_i}^{t_f} L(x(t), \dot{x}(t)) \mathrm{d}t$ numerically. I am trying to do it by discretizing the action so it is more of a ...
112 views

### How can I implement second order derivatives of shape functions of a 3D elements?

I am developing an Abaqus UEL with 3D 8 nodes brick elements and I need second order derivatives of the shape functions, I have already mapped the first order derivatives from the element coordinates ...
240 views

### Draw magnetic field lines or vector field of a magnetic dipole - Python/Matplotlib

In the Wikipedia article on magnetic moments, subsection "Effects on environment" defines the magnetic field H of a magnetic dipole moment. Additionally the magnetic field lines of this ...
87 views

### Why does FDTD and FIT disregard Gauss's law?

This is a reformulation of a question I asked a couple of days ago. I'm posting it again because I believe the previous post was very unclear, I will probably delete the previous question. My question ...
64 views

### Python routine to calculate shape resonances of H2

I am currently doing a project in which my aim is to write a program that can be used to calculate single and multi-channel shape resonances. So I'm looking at bound states and quasi-bound states. ...
48 views

### Simulating a combustion process

I want to try simulation-(and not experimental)-driven approach to design custom fireplace fuel burners. What software applications, libraries, code and model templates can I use to model and ...
45 views

### Integrating a wavelike equation with absorbing boundary conditions

I am trying to numerically solve the following equation: $\frac{\partial^{2} \phi}{\partial t^{2}}-\frac{\partial^{2} \phi}{\partial x^{2}}+V(x) \phi(x, t)=0$ On some domain, with: $\phi(x, 0) = I(x)$ ...
68 views

### Error too large in leapfrog method for solving the wave equation of a vibrating string

I have been trying to figure out what I did wrong for the last two days. I do not know if I actually did something wrong or if the error is supposed to be this large in usual leapfrog problems. I ...
71 views

### Acoustic Simulation, how are boundaries handled?

I don't have a background in numerical modeling so this question is rather broad. What I am interested in is modeling the propagation of an ultrasonic acoustic wave in 3d space. The basic 3d wave ...
46 views

143 views

### Why are fluid simulations so hard?

Fluid simulations solving the hydrodynamic (HD) or the magneto-hydrodynamic (MHD) equations are very useful in physics, the latter being particularly useful for modeling plasmas. Of course these ...
53 views

### Why is perfect sampling not used in large-scale lattice model simulations?

The statistical physics literature is replete with papers describing simulations of lattice models, such as the Ising model. Typically, these are done through Monte Carlo methods, such as the ...
138 views

### Conserve energy by message passing?

There are $N$ particles with positions $x_i(t)$ and velocities $v_i(t)$ and mass 1. There is a potential function $U_{i,j}(x_i, x_j)$ between each pair of particles, which is $0$ unless the particles ...
340 views

90 views

### Best practice for ADTs in computational science with Fortran

I have been writing a software package in Fortran for solution of the Vlasov-Poisson system in 2D2V. I want this software to be useful beyond its current application (e.g. systems with different ...
104 views

### Solving 1D wave equation with finite difference method

I've written a code in Python to solve the 1D wave equation with the finite difference method (the explicit and the implicit methods). I'm trying to perform a mesh convergence study to estimate the ...
70 views

### Cauchy Lorentzian simulation on FFT with oscillation

Recently I do simulation on Lorentzian Function with FFT Lorentzian Function is 2a/(x**2+a**2) ...
65 views

### Sum of random variables - Check your derived distribution against a numerical calculation/histogram

Consider independent random variates $X_0, X_1, . . .$ each uniformly distributed on the support $[0, 1)$ Let's say $Y = X_0 + X_1$, where $X_0$ and $X_1$ are independent uniform random variables with ...
106 views

### Trouble Making 3rd-Order Sympletic Integrator for Planitary N-Body Problem (A Hamiltonian System)

I am doing a solar-system simulation. I am using Ruth's 3rd order sympletic integrator to avoid the problem of Energy Drift (which I had with RK4), but the the planets quickly leave orbit, and energy ...
26 views

### Negative binomial expansion of general symbolic polynomial

Using Sympy, I would like to compute the negative binomial expansion of a general symbolic polynomial, e.g., $(x_1 + x_2 + x_3 + 4 x_4)^{-1}$. I understand that I can go by recursively partitioning ...
58 views

### Problems with simulation of a spatial filter 4f setup (Python)

I have a question about my code which computes numerically the output field of a 4f setup with a pinhole in the middle which works as a spatial filter. My setup consists of two lenses with 50mm focal ...
163 views

### More efficient way to calculate magnetic field using Biot-Savart

I am writing a program in python that is supposed to calculate the magnetic field along a conducting coil that is made up of a bunch of points, and the magnetic field is generated by other conducting ...
353 views

### Finite-difference software for solving custom equations

Are there any good, easy to use, software for simulating the evolution of systems of generic differential equations? I know there are custom programs for various specific circumstances (such as ...
28 views

97 views

### Why is Time evolving block decimation so efficient?

I have a short question about Time evolving block decimation (TEBD). During a lecture I was told that this method is very efficient in evolving 1D quantum spin systems with only nearest neighbor ...