Questions tagged [computational-physics]

Questions with this tag should be about computational physics, which is the study of physical situations with the use of software (commercial or in-house). Please note that details of writing and/or debugging code is OFF-TOPIC and should be asked at either Computational Science, Code Review or Stack Overflow.

Filter by
Sorted by
Tagged with
3
votes
2answers
9k views

How to calculate the velocity of fluid at the outlet when density and the pressure drop are known?

I have a U- like pipe. Its inlet has atmospheric pressure $p_o=10^{5} \, Pa$. Vacuum is applied to the other end with a pressure gradient $\nabla p_v=-30 \cdot 10^{3} \, kPa/s$. The total time of the ...
2
votes
2answers
48 views

Algorithm for solving electromagnetic problems using only forces

Is there any fundamental issue to solving electromagnetic problems with the following algorithm? (practicality aside) i) Set position, velocity, mass and charge for a set of particles. ii) Compute the ...
0
votes
0answers
33 views

Approximating the wave function of a bound state using a numerical method

Looking at the Schrödinger Equation $$i\hbar\frac{\partial\Psi}{\partial{t}}=\frac{-\hbar^2}{2m}\left(\frac{\partial^2\Psi}{\partial{x^2}}+\frac{\partial^2\Psi}{\partial{y^2}}+\frac{\partial^2\Psi}{\...
0
votes
1answer
247 views

Maxwell's equations UPML in FDTD with inhomogeneous media

I'm looking at matching the UPML (uniaxial perfectly matched layer) defined in Taflove&Hagness' Computational electrodynamics to an inhomogeneous media (inhomogeneous w.r.t. both $\varepsilon$ and ...
4
votes
1answer
44 views

Algorithm to calculate diffusion coefficient

According to the Einstein relationship, the diffusion coefficient $D$ is $$\lim _{t\rightarrow \infty} \frac{\langle \left(\mathbf{r}(t)-\mathbf{r}(0) \right) ^2\rangle}{6t} = D$$ I have run a MD ...
3
votes
2answers
355 views

Einstein's equation: Black hole solution

Let Einstein's equations satisfy $ R_{\mu \nu } = 0 $. Suppose we solve it numerically with the aid of a computer. Can we know from the numerical solution if there is a black hole in the solutions? ...
0
votes
2answers
1k views

Calculating internal energy of formation

I'm working on some code to simulate combustion at constant volume instead of constant pressure and I need to calculate the internal energy of formation for the species involved because I can only ...
0
votes
2answers
165 views

How to draw quiver plot for complex-valued electric field?

I have a matrix of complex numbers for the electric field inside a medium. Since I want to draw the quiver plot of these elements, it will be completely different if I only use the absolute part. Then ...
9
votes
2answers
327 views

Numerical Berry curvature for bosons

I am trying to numerically compute the Berry Curvature for a generic quadratic Bosonic Hamiltonian of the form $$H = \sum_{ij} A_{ij} b_{i}^\dagger b_j + \frac{1}{2} \sum_{ij}\left( B_{ij} b_i b_j + \...
7
votes
2answers
1k views

Interpretation of Stiffness Matrix and Mass Matrix in Finite Element Method

I would like to have a general interpretation of the coefficients of the stiffness matrix that appears in FEM. For instance if we are solving a linear elasticity problem and we modelize the relation ...
2
votes
0answers
60 views

$E\times B$ drift in strongly nonuniform fields

Potential is defined as $\{\phi,\, 0,\, A,\, 0 \}$; fields are static and depend only on the axial coordinate $x$: $E_x=-\partial_x\phi$, $B_z=\partial_x A$. Charged particle moves in the $\{x,y\}$-...
3
votes
2answers
150 views

Lattice Boltzmann Method: How is shear flow handled in D2Q5?

I've implemented 2-dimensional, incompressible, high-reynolds fluid-flow using the Lattice Boltzmann Method on a D2Q9 lattice. My main goal is just visual plausibility, not quantitative accuracy. The ...
0
votes
1answer
129 views

Master equation for the mechanical modes

Consider the standard model of optomechanical systems with a single optical cavity mode coupled to a mechanical oscillator, which is canonically modeled as a FP cavity with one fixed mirror and one ...
0
votes
0answers
30 views

Physics Event Generators computational Complexity

The computational core of physics event generator is the code that numerically calculates,from first principles, the fully differential cross section $e$. In general terms, a cross section $e$ ...
0
votes
1answer
267 views

FEM: Distributed loads over adjacent quadratic bar elements

I am an electrical engineering student trying to teach myself Finite Element Methods (FEM) through a couple of textbooks and independent study. While I believe that I understand the basic ideas ...
1
vote
0answers
50 views

Question about the VEGAS-algorithm for numerical integration

Disclaimer: I am not quite sure if this question belongs to Physics SE, if not feel free to move it. Question: I am currently using the VEGAS-algorithm (See e.g. here and here) and i am trying to ...
1
vote
1answer
156 views

COMSOL Cherenkov radiation

As indicated in the title of the discussion, I would like to know if it would be possible to simulate through software based on the finite element method COMSOL Multiphysics the movement of a particle ...
3
votes
1answer
1k views

Determing Velocity of Moons

I have a question that I believe is relatively easy to answer, I am working on an $N$-body simulation of a fictional star system and am having trouble finding the velocity of moons so that they will ...
3
votes
2answers
145 views

Is numerical lattice wavefunction smooth? — graphene tight binding case

I tried to follow exactly Sec. II.K [page 112-113, Hamiltonian after Eq. (113)] of the standard Review of Modern Physics paper on graphene, which is a tight-binding model of a graphene stripe under ...
4
votes
2answers
214 views

Canonical rotations that do not produce computational singularities

Intro On the topic of dynamical systems associated with 3-dimensional rotation of rigid bodies, you will always encounter singularities in the equations of motion that will produce computational ...
0
votes
0answers
63 views

Root Mean Square Displacement of Diffusion and Radial Diffusion Function

I read, that for normal diffusion the root mean square displacement $\sqrt{\langle x^2(t)\rangle}$ (for particles at the origin) can be interpreted as the mean distance the particles have with respect ...
0
votes
1answer
92 views

Analytic solution to the Kepler problem from position + velocity initial conditions

I am writing a javascript program (web page) that uses iterative simulation to show the motion and mechanics of a satellite in orbit around the earth. So far, using only circular orbits, it has been ...
0
votes
0answers
39 views

Solving the Lane-Emden equation via Chebyshev differentiation matrices

Problem So I'm trying to learn spectral methods but I can't quite proceed for some reason. In particular, I have been trying to solve the Lane-Emden equation (which I know how to solve via ...
1
vote
1answer
52 views

Discrete Harmonic Oscillator matrix representation of $x$ for Quantum Simulation

(The paper I'm referring to in this question is "Quantum simulations of one dimensional quantum systems") I've been trying to understand the paper above, specifically on constructing a ...
4
votes
0answers
95 views

Computer coding of Perdew Burke and Ernzerhof (PBE) method

I have been assigned the task to write a computer code to implement the Perdew Burke and Ernzerhof (PBE) method. Does anyone know a good reference which can make the coding of this method easier?
0
votes
1answer
154 views

Efficient numerical evaluation of Wigner function

Suppose we want to calculate the Wigner function of some state $|\Psi\rangle = \sum_{n=0}^{N_{max}} c_n|n\rangle$ ($|n\rangle$ are the eigenstates of the Harmonic oscillator) numerically. Starting ...
0
votes
0answers
37 views

Which are the right configurations in the Markov chain of a Hamiltonian Monte Carlo algorithm?

I have a question about the Markov Chain Hamiltonian Monte Carlo (MCHMC). Hamiltonian Monte Carlo is known as Hybrid Monte Carlo too. I'll describe the steps of the algorithm. 1) We have at the ...
2
votes
1answer
54 views

Computational Complexity of Crystallisation?

If we look at crystallisation as a tiling problem, i.e. filling the space with a given set of tiles of arbitrary shape. Then the time that it takes to solve this problem has to be bounded below by the ...
1
vote
1answer
67 views

Matrix product state (MPS): Creating and understanding a specific 2-site Ising ground state?

I've been trying to better understand matrix product states (in order to implement them in code in the near future), so I'm considering small examples. I was wondering if I could get some ...
0
votes
1answer
55 views

Double spherical pendulum simulation difficulties

I've been working on a simulation project of mine that I kind of need help with. So, as made obvious by the title, I am attempting to simulate the motion of a double spherical pendulum. I am writing ...
1
vote
0answers
53 views

Solving the Poisson-Schrodinger equations numerically

I need to find the solution to the Poisson- Schrodinger equation in the newtonian approximation, which are basically coupled differential equations given by: \begin{equation} \nabla^2 V=8\pi G M^{2}\...
0
votes
0answers
30 views

Position Based Dynamics - Cloth Balloon Constraint

I am attempting to implement the cloth balloon constraint from section 4.4 of this paper: https://matthias-research.github.io/pages/publications/posBasedDyn.pdf It is my understanding that after ...
0
votes
0answers
15 views

Degeneracy in linear tetrahedron method

In the linear tetrahedron method for the calculation of density of states, how does one circumnavigate the infinity error that would arise if two or more k-vertices of the tetrahedron have the same ...
0
votes
0answers
12 views

Operator constructions in DMRG?

I've been reading this paper to get a better understanding of DMRG: https://arxiv.org/pdf/1008.3477.pdf My questions come from equations 4, 5, and 9 on page 9 and 10. Eq (4) states that: $ \langle a_l ...
1
vote
0answers
27 views

How to find density of states (DOS) for a nanoribbon (NR)?

I have a nanoribbon (NR) which is constructed of $N$ 1D chains. The Hamiltonian is written as the following:(for only N=3) $$ H= \begin{bmatrix} H_0&H_{12}&0\\ H_{21}&H_0&H_{23}\\ 0&...
2
votes
2answers
243 views

How can I express velocity as a function of position in a damped oscillation? [closed]

In a damped oscillation that obeys $x(t)=Ae^{-bt/2m}\cos(ωt)$ which shows the position of the oscillating object as a function of time, how can I express the velocity of the oscillating object as a ...
0
votes
0answers
12 views

Are PMLs also used for soft-matter structural dynamics modelling as they are commonly used in Wave Propagation modelling?

Numerical modelling of waves by FDTD method makes use of PMLs to establish absorbing boundaries. I recently began modelling soft-material structural dynamics (for biological cells) using FEM where the ...
0
votes
1answer
82 views

Are the orbits in my simulation correct? [closed]

I'm creating a simulation of our solar system. I used data from https://nssdc.gsfc.nasa.gov/planetary/factsheet/ and I supplied the planets with perihelion and aphelion values. But I'm afraid the ...
0
votes
1answer
97 views

Boltzmann distribution in Ising model

I've written in Matlab a code for a Ising model in 1 dimension with 40 spins at $k_{B}T=1$. I record the energy of every step in a Metropolis Monte Carlo algorithm, and then I made an histogram like ...
0
votes
1answer
30 views

Energy Spectrum of lattice Model

Here the author has done numerical calculation and has plotted energy spectrum and wave function for Kiteav Chain whose hamiltonian is given by $$H=-\mu\sum_n c_n^\dagger c_n-t\sum_n (c_{n+1}^\dagger ...
3
votes
3answers
206 views

Simulation of relativistic probe passing through an external solar system

I recently read about the Breakthrough Initiative to launch "StarShot", a nano-probe that is designed to travel to Alpha Centauri at $0.2c$. One of the challenges to be solved involves the precise ...
4
votes
1answer
224 views

Solving the Schrödinger equation numerically on a non-uniform grid

I am currently developing a numerical solver, which solves the standard, one-dimensional, time-independent Schrödinger equation $$\frac{-\hbar^2}{2m}\frac{d^2\psi}{dx^2} + V(x)\psi = E\psi \tag{1}$$ ...
0
votes
1answer
55 views

Simulation of the Delta Kicked Rotor in Momentum Space

I am trying to work through this paper which goes through the Atom Optics Kicked Rotor. Starting with the Hamiltonian: $$ H = \frac{p^2}{2m}+ K \cos(2k_Lx)\sum \delta(t-nT)$$ This corresponds to a ...
0
votes
1answer
48 views

Transmission coefficient of a Gaussian wave packet through a potential barrier

I have simulated the scattering of a gaussian wave packet with a potential barrier (Crank-Nicolson), and through many simulations I have determined the dependence of the transmission coefficient with ...
0
votes
0answers
38 views

Virial theorem and gravity simulation?

I've been trying to build a gravitational simulation using a newtonian law of gravitation and have just been going over what the initial conditions should be. Then I remembered the virial theorem and ...
3
votes
1answer
139 views

Number of ionic steps in plane wave DFT

What is the significance of increasing (and decreasing) the number of ionic relaxation steps in a plane wave DFT calculation?
0
votes
0answers
62 views

How to implement variational Monte-Carlo?

I try to implement variational Monte-Carlo for an assignment on a simple case : a spinless particles in a linear potential. Consider a single spinless particle in a one dimensional chain described by ...
0
votes
0answers
30 views

Critical exponents in cosmological phase transitions: existing and useful?

I'm working on phase transitions in the early universe. Generally, a particle physics model in form of a Lagrangian is taken, the one-loop corrections in the potential for zero and finite temperature ...
0
votes
0answers
16 views

Struggling to converge the potential of a binary alloy system using the Coherent Potential Approximation. Stuck with the troubleshooting

I'm trying to converge a dilute fcc alloy consisting of Cu and U, with the Uranium concentration at 0.01%, using Hubert Ebert's SPR-KKR program (https://www.ebert.cup.uni-muenchen.de/old/index.php?...
0
votes
0answers
24 views

Doubt on Morris-Thorne $r_{0}$ radius and plots of energy conditions

I'm studying a particular shape function for Morris-Thorne Wormhole (MTW) with a variable redshift function. The nature of those functions isn't important, but I'm struggling to understand a ...

1 2
3
4 5
26