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.

Filter by
Sorted by
Tagged with
1 vote
0 answers
37 views

I need MATLAB or Mathematica code to solve this integral over limit 0- λ

I want the code to integrate equation(1) or (2) over the limits using mathematical or mathlab to get equation (3) as the answer of $Z$ vibrational partition function, giving the following additional ...
user avatar
-3 votes
0 answers
32 views

Will we ever be able to control weather? [closed]

More specifically, will we be able to understand weather dynamics to such a computational detail that we will be able to influence the weather patterns? E.g. inducing rain during droughts over a ...
user avatar
2 votes
0 answers
49 views

Numerical solution to the Tolman-Oppenheimer-Volkoff equations for any equation of state (numerical or analytical)

I've been working on a code to solve the Tolman-Oppenheimer-Volkoff (TOV) equations for a while and recently I've got it right but only for one specific equation of state, the bag model, which is not ...
user avatar
1 vote
0 answers
31 views

Calculating the species mass consumption from implicit reaction-term in diffusion-reaction equation

The 1D diffusion equation with a chemical source term has the following form: $$\frac{\partial Y}{\partial t} = D \frac{\partial^2 Y}{\partial x^2} - k Y,$$ where $Y$ is the molar concentration of the ...
user avatar
2 votes
0 answers
28 views

Problem with Time Evolving Block Decimation for small finite chains

Preliminary definitions: I have a code that uses TEBD (https://en.wikipedia.org/wiki/Time-evolving_block_decimation) to perform time evolution of a given Matrix Product State (MPS), lets call it $|\...
user avatar
1 vote
1 answer
91 views

What FEM solver should be used for matrix-valued FE spaces?

I am pretty new to using FE solvers. I am trying to solve a system of (up to) 9 complex equations. We write these as a matrix equation (here), (with the implied sum over $j$, for each component ...
user avatar
  • 21
-1 votes
0 answers
28 views

OTOC for Bose Hubbard model

I need some help with numerical computation of Out of Time Ordered Correlators for Bose Hubbard model in one dimension. I'm dealing with a 3 site model with 12 bosons. I was able to write down a ...
user avatar
1 vote
0 answers
57 views

Finding the weak form of a PDE with a tensor argument

I am trying to solve for the order parameter ($A$) in the Ginzburg Landau equations. I had asked on the math SE site but was recommended to ask here. We are trying to solve the following equation, (...
user avatar
  • 21
1 vote
1 answer
121 views

Huygens Fresnel Diffraction integral using dblquad in python

I am attempting to create a python function to assist in calculating the following numerical integration of the Huygens Fresnel integral in the form of ...
user avatar
2 votes
0 answers
51 views

How "kinematic" rigid bodies are implemented in physics engines

In most physics engines there's this concept of "static" bodies, which act as rigid bodies with infinite mass. Then there are "kinematic" bodies that act as static bodies, but ...
user avatar
-1 votes
1 answer
58 views

The local and average Nusselt number in a square cavity

I am in the process of programming the local & average Nusselt number in a left vertical wall but my Matlab script gives me inappropriate values and it doesn't change with changing of Rayleigh ...
user avatar
0 votes
1 answer
73 views

Who can explain the minimum image convention in molecular dynamic simulations?

How to choose the cutoff radius so that the atoms do not interact with its periodic image? Especially when simulating macromolecules (proteins).
user avatar
0 votes
0 answers
29 views

How can I couple MCNP with FLUKA? To attain reactor dynamics and simulate an ADS experiment? (Under Subcritical fast system)

I'm new in Particle Physics based Computing. I want to simulate an ADS experiment (Accelerator Driven System) in subcritical fast system. I was advised to simulate the experiment with FLUKA with MCNP ...
user avatar
2 votes
1 answer
103 views

Numerical diagonalization of Hamiltonian

Framework I am trying to diagonalize the Bogoliubov-de Gennes Hamiltonian. The problem is that the Hamiltonian contains a Laplacian. This could be solved by using a discretized Laplacian. How I tried ...
user avatar
  • 21
2 votes
1 answer
115 views

Can't solve second order differential equation with scipy

Most of my knowledge about numerically solving differential equations is long forgotten. Unfortunately I stumbled upon a physics problem where I need to do exactly that. I'm trying to describe the ...
user avatar
  • 31
0 votes
0 answers
36 views

Kaplan-Glass Determinism Test - Python

I have projected a 2-dimensional phase space onto a graph and attempted to coarse grain the embedding. I'm attempting to perform the Kaplan-Glass Determinism Test. Link: http://www.medicine.mcgill.ca/...
user avatar
0 votes
1 answer
144 views

Can I use periodic boundary conditions for `U` but not for `p`?

Cross-posted from Stack Overflow. (https://stackoverflow.com/questions/70686368/can-i-use-periodic-boundary-conditions-for-u-but-not-for-p) I am trying to numerically compute the drag force around a ...
user avatar
1 vote
0 answers
67 views

Poisson equation fast solver on large grids

Below is kind of a broad question. Was given Poisson equation with BC, on meshgrid of NxM. Rewrote as system of N*M linear equations, Converted to sparse format (CSR/CRS/Yale), solved using Conj Grad ...
user avatar
  • 326
0 votes
0 answers
21 views

How to determine the minimum grid length | Numerical Plasma physics

I am trying to understand the attached python 3X code. The following dispersion relation is given $$\epsilon (k, \omega) = 1 - \frac 1 2 \left[ \frac{\omega_p^2}{(\omega-kv_0)^2} + \frac{\omega_p^2}{(\...
user avatar
  • 101
0 votes
0 answers
25 views

Need help in attempting to solve an MHD eigenvalue problem

Background I am attempting to numerically solve the ideal MHD equations in normal mode form for a Harris current sheet. The linearized perturbed MHD equations can be written in a normal mode form: $$ -...
user avatar
  • 101
0 votes
0 answers
25 views

Need help implementing constrained transport method for MHD riemann slver

I tried implementing constrained transport method to 1st order Godunov solver and when I run it on 2D rotor test case, the solver becomes unstable and crashed. The solver is able to maintain ...
user avatar
  • 101
1 vote
1 answer
185 views

Schrodinger's Equation differential

I am working on a modified version of Schrodinger's equation (time-independent) where $\frac{d^2ψ}{dx^2}=-2(E-V)ψ$, where I have to consider $V = 0$ at all times. I have been asked to use Python in ...
user avatar
5 votes
1 answer
106 views

Are Python/MATLAB/Mathematica numerical eigenvectors affected by eigenvalue degeneracies outside region of calculation?

I have a discretized 2D mesh over which I calculate eigenvalues and eigenvectors of some Hermitian 2 x 2 matrix at each point along a closed loop parameterized by parameter t. The eigenvectors are ...
user avatar
0 votes
1 answer
70 views

Scipy Find Peaks

I am trying to find the peaks. I have list x_period and y_power. I find the peaks from the ...
user avatar
3 votes
1 answer
42 views

Bounds condition for IFT to obtain a $1/f$ time-series

I am coding a function to obtain a randomized time-series from a given $\frac{1}{f}$ law. The randomization is obtained by introducing a random phase in the function. I experience a problem in the ...
user avatar
  • 61
1 vote
1 answer
256 views

Numerical Solution of the Schrödinger equation for hydrogen

I'm trying to solve the Schrödinger equation for the hydrogen atom in the following form numerically: $$\left[-\frac{\hbar^2}{2m}\frac{d^2}{dr^2}+V(r)+\frac{\hbar^2l(l+1)}{2mr^2}\right]R(r)=ER(r).$$ ...
user avatar
0 votes
0 answers
64 views

Numerov method for 1D potential barrier problem: numerical errors

I wanted to solve a 1D potential barrier problem. It seemed easy enough to do: set a travelling wave coming from the left, part of it gets reflected by the barrier, and part of it gets gets ...
user avatar
0 votes
0 answers
32 views

Using Pymc3+Theano+astropy for Bayesian inference with integral expressions

This is my first time using Pymc3 or Theano, so I apologize if this question is straightforward. I'm interested in using Bayesian inference to see how effective the (non) observation of something can ...
user avatar
0 votes
1 answer
131 views

Computing eigenvalues of Schrodinger equation with spin

I want to solve a 2-dimensional particle in box problem with two electrons in the quantum well.I would like to take into account spin of electrons and Coulomb interactions to compute singlet and ...
user avatar
0 votes
3 answers
85 views

How can I plot a rainbow?

I'm trying to write a program that can simulate a rainbow. So far I've got figured out how to determine the change in the refractive index depending on the wavelength, the angular deviation of the ...
user avatar
  • 1
1 vote
0 answers
244 views

How to compute the Eigenvalue and Eigenstates of Quantum well with Effective mass using finite difference method in Python?

I want to compute the eigenvalues and eigenstates of a quantum well with different effective masses of electron in the barrier and in the quantum well. As can be seen [1]: https://github.com/mholtrop/...
user avatar
0 votes
1 answer
45 views

Convoluted exponential gaussian probability function from Igor Pro

I am trying to figure out the exact formula for a three convoluted exponential gaussian probability function from the software Igor Pro, from my research. Unfortunately all I the closest equation from ...
user avatar
0 votes
1 answer
160 views

How does one obtain tortoise coordinates by integrating with GNU Scientific Library (GSL)?

I’m trying to to obtain the values of the tortoise coordinates (Eddington-Finkelstein Coordinates) integrating the expression: $\frac{dr^*}{dr} = (1 - rS/r)^{-1}$ using the GNU Scientific Library (GSL)...
user avatar
  • 53
0 votes
1 answer
89 views

Simulating the behavior of falling peas

I hope this is the right place for my question. I am a university student who designed a pea-pouring machine.Now I‘m really interested in simulating the behavior of those peas. Basically, they are ...
user avatar
1 vote
0 answers
50 views

Weird behavior in for solving TISE in harmonic oscillator potential using the shooting method

I was solving the time independent Schrödinger equation using the shooting method for harmonic oscillator potential. This is the code that I wrote for that with the results (code is written in julia): ...
user avatar
0 votes
0 answers
33 views

Astrophysics context : Introduction of a factor $\Delta\ell$ when summing equal distants $C_\ell$

I have the following formula which is the error on a $C_\ell$ : $$\sigma_(C_{\ell})=\sqrt{\frac{2}{(2 \ell+1)\Delta\ell}}\,C_{\ell}\quad(1)$$ where $\Delta\ell$ is the width of the multipoles bins ...
user avatar
-1 votes
1 answer
167 views

Can someone help or point me out to C++ source code for a two body orbit simulation using symplectic integration?

I've professional experience with physics simulations and C++ programming, although I don't have specific experience with astrophysics simulations. I'm trying to build a two-body evolving system ...
user avatar
  • 19
3 votes
0 answers
88 views

Numerical Soultion to Background equations of cosmology

I am trying to solve the background equations of cosmology numerically using Runge-Kutta Dormand Prince method with simplified assumption $8\pi G=1$ and $c=1$. The equations are $$\ddot a = - \frac{1}{...
user avatar
  • 39
0 votes
1 answer
73 views

Does the leap-frog algorithm conserve energy for n-body problems?

The leap-frog algorithm is able to conserve to a certain extent the energy of a system, which flucutates as a cosine around a stable value. Is this true if we apply the algorithm to a n-body ...
user avatar
0 votes
0 answers
29 views

How to solve nonlinear second order ODE in Matlab? [duplicate]

I am working on simulating a car suspension system using Matlab. Specifically, I have to derive equation of motion using the Lagrange method and then use ode 45 to solve it. However, while using ...
user avatar
2 votes
1 answer
95 views

Changing randomly a unit vector

For studying a spin model on a lattice, I have to generate a random unit vector starting from a pre-exstisting one. There are multiple ways to do it, but the book I use suggests generating a random ...
user avatar
1 vote
0 answers
52 views

Reproducing a paper's result for Topological Insulators

For the past weeks I have been trying to reproduce Agarwala's results but I've been unsuccessful. From this paper I am trying to reproduce the first and last columns of Fig.2, by implementing eq.2; ...
user avatar
1 vote
2 answers
291 views

Dyadic operations, fourth order tensors and Tensor algebra

I am trying to understand the dyadic operation for a while since I am interested in Elasticity problems. I believe an intuitive understanding (rather than assuming) will give me good problem solving ...
user avatar
0 votes
0 answers
76 views

How to distinguish primary hosts (stars) and orbiting satellites (planets) and tertiary bodies (moons) by their mass and trajectory?

I posted this question in the astronomy stackexchange. There are no responses, and it was suggested that I pose the question here. The "too long, didn't read" was taken from a comment, and ...
user avatar
  • 11
0 votes
1 answer
58 views

Is there a unit of measure for computational complexity; through quantum computers? [closed]

I'm concerned with trying to determine whether the same computational processes on a Turing computable algorithm can be ascertained for a quantum computer in some form of actual 'metric' for how many ...
user avatar
3 votes
2 answers
240 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 ...
user avatar
  • 68
0 votes
0 answers
51 views

Comparison of computational complexities of MD versus MC simulations

In my humble understanding MD simulations of systems with short-range(like LJ interactions) and long-range(electrostatic) has a computational complexity $O(N . log(N))$. What will be the computational ...
user avatar
3 votes
2 answers
127 views

Efficient schemes for solving the extended Saddle point problem

I am interested in knowing some efficient techniques for solving the following extended Saddle point problem. \begin{align} \begin{bmatrix} A & B^T & C^T \\ B & 0 & 0 \\ C & ...
user avatar
  • 590
3 votes
1 answer
198 views

Finite element method for high-frequency electromagnetics

I am writing a project about the Finite element method for use in high-frequency solutions of Maxwell's equations. This could be for use in antenna design and similar. I have some trouble ...
user avatar
  • 33
0 votes
1 answer
461 views

N-body problem with differents solvers (RK2, RK4, Euler symplectic, Stormer-Verlet) : planets drift to infinity

I'm trying to write an integrator for the 2 and 3-body problem. I choose to start from a generalisation to N-body problem so I can just pass my bodies to the same integrator in the two cases. I'm ...
user avatar

1
2 3 4 5
8