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
2
votes
0answers
30 views

Kirchhoff Diffraction for backwards wave propagation

Classic Kirchhoff Diffraction integral for a monochromatic wave is formulated with a restriction that it's only applicable to a point that's outside of the volume enclosed by the integration surface ...
0
votes
0answers
46 views

Problems with Sun-Earth-Moon simulations in vPython

I'm trying to simulate the Sun-Earth-Moon system using the Verlet algorithm with vpython. I'm using natural units and a cartesian coordinate system, and am having trouble working out the physics. I ...
0
votes
1answer
20 views

Determining Characteristics of Spatial Light Modulator (SLM)

im quite lost somehow. I know this is a really basic thing and I know I should be able to do it, but something is going on with me and I tend to have problems with everything these days. Anyway: I ...
0
votes
0answers
19 views

How to calculate a volume integral from a data file containing $x$, $y$ and $z$ coordinates and electric field value at each $(x,y,z)$? [migrated]

I have a data file from a simulation that contains $E$-field values at different coordinates $(x,y,z)$. I want to calculate the integral $\int E^{2} dV$ over a cylindrical volume in Python or MATLAB. ...
0
votes
0answers
58 views

Calculating the Lyapunov exponents for the seir epidemic model [migrated]

I am trying to numerically calculate the Lyapunov exponents for the seir epidemic model given as: $$ s^{'} = b - bs - \beta si \\ e^{'} = \beta si - (\alpha + b)e \\ i^{'} = \alpha e - (\gamma + b) i ...
2
votes
5answers
143 views

Creating a pendulum simulation in C#

I'm working on a game that involves swinging around a pole, and I want to simulate the physics, not just hard code the rotation. I figure a pendulum is a fairly decent model to start with, but I ...
1
vote
2answers
66 views

A clarification on acceleration and velocity

This is one of those questions which require an answer that does not take practical limitations into account. It is a theoretical physics question, perhaps. If there are any loopholes used, please ...
1
vote
0answers
25 views

What is the lalsuite and how can I use it? [closed]

I want to install the lalsuite package from https://git.ligo.org/lscsoft/lalsuite. How can I install it? How can I use it in Python? In "https://github.com/benjaminlackey/eosinference/commit/...
0
votes
0answers
23 views

Saturn's moons - getting a stable harmonic model for Mimas and Encyladus

I have built a HTML/Javascript solar system model. It is working well with real time animation. https://abetz-rouse.com.au/planetarium I don't want to get into the deficiencies of my choice of ...
0
votes
0answers
13 views

Looking for input to a simple transformative Ab initio molecular dynamics (AIMD) trajectory simulation

I'm looking for a simple Ab initio molecular dynamics (AIMD) simulation of some small molecular system that I can run myself on a desktop computer. I want a molecular system that actually changes ...
0
votes
1answer
37 views

Developing FEM/FDTD for Computational Electromagnetics

I am looking to create my own code/model for modeling electromagnetic problems via Finite Element Method and Finite Difference Time Domain method. I have been reading through the literature and ...
2
votes
1answer
48 views

Two-mass spring system in $x$-$y$ plane motion [closed]

I wrote a coupled differential system that describes two masses coupled by one spring. Both masses are free to move in x-y plane. To test the model, I plotted a position of two masses in x-...
2
votes
1answer
72 views

Is $\phi^4$ theory unstable?

I tried to write a simulation of a $\phi^4$ theory for 2+1 dimensions. But whatever values I gave for the coupling constant it always seems to blow up. i.e. a wave-like equation with a mass and ...
4
votes
2answers
86 views

Planck's law question

I was reading Wikipedia article about Planck's Law and I wanted to make the same graph as here. I took this equation $$ B(\nu,T)=\frac{2h\nu^3}{c^2}\frac{1}{e^{\frac{h\nu}{kT}}-1}$$ but I got ...
3
votes
2answers
117 views

On using Python to solve Time Independent Schrodinger Equation, the eigenfunctions have their values “pushed” to one of the boundaries?

I am having trouble using numerical methods to solve Time Independent Schrodinger Equation. I am considering a quartic potential function: $$ V(x) = x^4 -4x^2.$$ $$ -\frac{d^2\psi(x)}{dx^2} + V(x) \...
0
votes
0answers
16 views

Why does this Non-Standard FDTD implementation lead to infinite increase in the magnitude of an EM pulse?

I have been working on a Particle-In-Cell Framework in Python and have noticed an issue where the magnitude of a Gaussian Wave Packet increasing infinitely as the simulation updates. Currently, I am ...
-2
votes
1answer
65 views

Resampling step of population annealing

I am trying to have a better understanding of the population annealing algorithm. In the section POPULATION ANNEALING, the steps of the algorithms are described. In Step 2 (Resampling (Split/Remove) ...
3
votes
0answers
25 views

No sign problem in quantum Monte carlo simulations of 1D systems?

I've heard many times people saying that there is no sign problem in the quantum Monte Carlo simulations of 1D locally interacting quantum systems. I think this means, for any 1D locally-interacting ...
-1
votes
1answer
51 views

Programming Languages for Theoretical and Mathematical Physics [closed]

I am a physics major and will be specializing in both physics and mathematics. I mainly have interests in Mathematical Aspects of Quantum Field Theory, Topological Phenomena in Condensed Matter ...
1
vote
1answer
40 views

Taking curl numerically of a Hamiltonian writtein in Fourier space

I have a Hamiltonian given in 2D k-space $$ H = \sum_{\vec k} \begin{bmatrix} a_k^+&b_k^+ \end{bmatrix} \begin{bmatrix} h_{11}&h_{12}\\ h_{21}&h_{22} \end{bmatrix} \begin{bmatrix} a_k\\b_k ...
2
votes
2answers
219 views

What can be derived from the metric tensor? [closed]

I am working on a computational project about General Relativity. In this process, I want to code 'the stuff' that can be derivable from the metric tensor. So far, I have coded Riemann Tensor, Weyl ...
1
vote
1answer
61 views

Calculating classical scattering angle using Gauss-Legendre quadrature

In Goldstein problem 3.5, We have to calculate the scattering angle, $\Phi(s)$, given as a function of input parameter, using Gauss-Legendre Quadrature. The full question is as follows; Compute ...
0
votes
0answers
23 views

Matrix Product Operator of a Hamiltonian

I encounter a problem in finding the $W^{[1]}$ and $W^{[N]}$ for a Matrix Product Operator(MPO). Suppose the system is governed by the following Hamiltonian, we can directly write its MPO down: \begin{...
0
votes
2answers
26 views

Estimating parameters for diode model from experimental data

I have got a set with experimental data of the voltage drop on a diode an its corresponding current. The general model of a diode is $$ I = I_s \left( e^{V/nV_T} - 1 \right)\ , $$ and I want to ...
2
votes
0answers
57 views

Determine tetrad of local inertial frame numerically

Let $g_{\mu\nu}$ be a metric of a curved spacetime. However, we do not know its analytical form. We only know $g_{\mu\nu}$ and its derivatives from a former numerical simulation and the underlying ...
0
votes
0answers
16 views

Finding aerodynamic coefficients of an airfoil using numerical data measured in wind tunnel

I am trying to find all the aerodynamic coefficients of an airfoil at different angles of attack. I have .DAT files for data which have 4 columns of data all in order {angle of attack[deg], Lift[N], ...
0
votes
3answers
56 views

Definition of pressure in Euler's equation for incompressible inviscid fluid

In fluid dynamics, Euler's equations describe an inviscid fluid. For an incompressible fluid with a constant and uniform density it reads (cf. Wikipedia article): $$ \begin{align} {\partial\mathbf{...
5
votes
2answers
106 views

What do we exactly mean when we say that a problem has an analytical solution?

What do we actually mean when we say that a certain problem has or does not have an analytical solution? I ask this because some systems that are said to have an analytical solution actually are no ...
0
votes
1answer
36 views

Numerical errors in highly eccentric motion in gravitational field

I am trying to solve the following problem: A test particle at coordinate $\vec{r_0}=(1,0)$ is thrown with initial velocity $\vec{v_0}=(0,v)$ and is influenced by a gravitational field $\vec{F}=\frac{...
0
votes
0answers
21 views

How many bits of storage would be required if we are in a simulation?

The answers here didn't really address what I was looking for (How many bits are needed to simulate the universe?), so... If we are in a simulation, can we presume the simulation only needs to be ...
0
votes
0answers
31 views

What is the model of pressure underlying Bernoulli's principle? / How do you define stress for an incompressible, inviscid fluid?

If I'm correct Bernoulli's principle says that for a given streamline $\vec{\gamma}(t) \overset{\mathrm{def}}{=} \vec{\gamma}_0 + \int_0^t\vec{v}(\vec{ \gamma}(\tau))\mathrm{d}\tau$ in an ...
2
votes
1answer
41 views

Ripples appear when solving Fokker-Planck equation [closed]

I'm solving a Fokker-Planck equation with Python by solving AB=C where A is coefficient matrix, B is the vector of unknowns, and C is the right-hand side. The Fokker-Planck is below: $$ \frac{∂ρ(x,y,t)...
0
votes
0answers
11 views

How do I add a refractory period in neuronal spikes generated via Poisson process?

Spikes can be generated via MATLAB code as below ...
1
vote
0answers
26 views

Poincare section for the duffing Oscillator

I have used the 4th Order Runge-Kutta method in order to estimate the values in which the Duffing Oscillator is chaotic. According to Wikipedia, the Duffing Oscillator is chaotic for values of $\alpha$...
0
votes
1answer
44 views

Truncation Problem of Density Matrix Renormalisation Group (DMRG)

I am wondering that is there any restrictions for the truncation in DMRG algorithm. Currently I am using DMRG to calculate ground state energy per site of a many-body system described by on-site ...
0
votes
0answers
92 views

What value of the magnetic moment of the muon does the standard model predict?

I’ve become intrigued by the recent results regarding the measurement of the magnetic moment of the muon, $g$. It appears to be 2.00233184122(82). What does the standard model predict that $g$ should ...
2
votes
0answers
24 views

Propagation of a Standard Deviation

I've got a simulation that tries to calculate the highest energy eigenstate of a Hamiltonian and obtains a value $\langle A\rangle$ as its best effort. I do this once each time for a number of ...
1
vote
0answers
20 views

Attempting To Discretize the Potential of a Point Charge

So as a personal project I am trying to create an program that discretizes the field of a point charge. I want to use the relaxation method but I am not sure what types of boundary conditions I should ...
3
votes
0answers
67 views

Continuum solutions for the Dirac equation in Coulomb potential - numerical codes

Following the representation used in [1, pag. 11] the solution of the Dirac equation in polar coordinates for energy $E$ is of the type: $$ \psi_{E\kappa m}(\bf{r})= \dfrac{1}{r} \Bigg( \begin{matrix} ...
0
votes
0answers
26 views

Numerical Approach to find the Many-Body Ground State Wavefunction of Tight-Binding model

I encounter a problem in finding the many-body ground state wave-function of the tight-binding model in python. The Hamiltonian of tight-binding model is follow: \begin{equation} H = -t \sum_{<ij&...
1
vote
1answer
120 views

How do I simulate 2 atom interaction? [closed]

I want to build a rough atom interaction simulator, where is push 2 (or more) atom towards each other and they should behave some have physically correct - attract, bond or repel with some force. So ...
0
votes
2answers
40 views

How do I find the energy of sound from Audacity?

For a project, I recorded the sounds of a boccee ball impacting with some ping pong balls in a container using Audacity. I also used a sound pressure level meter to record the maximum dB C that was ...
0
votes
0answers
26 views

$S$-Parameter Phase in Matlab

I'm trying to plot the phase of S-parameters on Matlab. The data I have is the coupling matrix (M) of the system and from that I have extracted S11 and S21 (column 1 in image is frequency and column 2 ...
0
votes
0answers
29 views

Fixed point of non-linear system: infinite eigenvector

I've come across a $2d$ non-linear dynamical system (autonomous) the stability properties of which I would like to understand better. Computing the stability matrix, its eigenvalues and eigenvectors, ...
0
votes
0answers
13 views

Monte Carlo Heat Bath Local Minima

I am working on a problem where I am trying to find the configuration of a statistical system with the lowest energy. The system is similar to Ising model, it compromises of a lattice where each link ...
3
votes
1answer
33 views

Mean value using importance sampling in Monte Carlo simulations

I'm studying Monte Carlo simulations from Mark Newman's book Monte Carlo Methods in Statistical Physics, and I've arrived at the concept of importance sampling. I'm having some trouble understanding ...
4
votes
0answers
72 views

Cross product of operators in exponential: numerical solution

Short version: Numerical solution to a quantum system. I have my discretised wavefunction is real space $\psi(\mathbf{r})$ and in momentum space $\tilde\psi(\mathbf{k}) = \mathcal{F} \left [ \psi(\...
0
votes
1answer
75 views

Gauss law for positive charge densities

I am trying to write a PIC (Particle In Cell) code to simulate plasma physics. I am starting with the simplest case, which is a 1D system with a longitudinal field $E = E(x)$. I am using this article ...
11
votes
1answer
532 views

Why use Crank-Nicolson over Matrix Exponential when solving Schrödinger's equation?

For Schrödinger's equation, $$\psi(x,t+\Delta t)=e^{-i H\Delta t}\psi(x,t)\approx\frac{1-\frac{1}{2}i H\Delta t}{1+\frac{1}{2}i H\Delta t}\psi(x,t).$$ The right-most expression is the Crank-Nicolson ...
1
vote
1answer
70 views

Can anyone expound this Projectile Motion computation please?

I have this formula for projectile motion that I'm using in Unity game engine for getting the low or high Velocity of a projectile depending on how close or distant the target is (as long as it is ...

1
2 3 4 5
29