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
1 answer
113 views

Different Results for Double Pendulum

In this study, (Hidden Fractals in the Dynamics of the Compound Double Pendulum) the authors provide various fliptime fractals (of a double pendulum) for different length combinations. However, when I ...
MaximeJaccon's user avatar
0 votes
1 answer
57 views

Exact Riemann Solver for Multi-Component 1D Euler Model

I am concerned looking for an exact Riemann solver for compressible 1D multi-component Euler equations, supplied with the ideal gases equation of state and under the assumptions: Mechanical ...
ReroDani's user avatar
2 votes
1 answer
281 views

Why do my satellites fall out of orbit?

I have set up Newtonian Gravity in my Game Engine, allowing me to simulate the gravitational attraction between celestial bodies. I have the following variables defined: ...
ZeunO8's user avatar
  • 121
0 votes
0 answers
30 views

Problems performing 1D-FDTD for dispersive dielectric uisng lorentz model in Julia

So I am trying to model a dispersive dielectric using the Lorentz model in Julia, more specifically I am trying to obtain the frequency-dependent reflectivity of the material. I am ultimately trying ...
Emre Durmus's user avatar
2 votes
1 answer
98 views

How to properly compute a differential cross section?

I'm currently in the process of computing a differential cross-section for the scattering of a 420 MeV electron by an O-16 nucleus (with a Wood-Saxon charge distribution). The problem is that the ...
Athkor's user avatar
  • 21
0 votes
1 answer
77 views

Non-dimensionalizing the Ideal MHD System

Non-dimensionalization is a really frustrating topic for me, and I imagine many others, because in school it was glossed over while being really important to implementing a simulation. I'm writing a ...
Ashamandarei's user avatar
1 vote
0 answers
77 views

Regarding the difference between Metropolis-Hastings and Wolff algorithm (synchronous vs asynchronous) applied to Ising Model?

I am trying to self-learn concepts at the intersection of physics and programming. When reading up on the Ising Model, I find that the typical programming tutorial (such as this one) covers the ...
user23358153's user avatar
2 votes
1 answer
397 views

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

I have a 3-body simulation which must run millions of times. As far as I know, the GPU shines when it gets to preform simple operations on huge matrices/arrays. Currently I'm debugging and running my ...
Remeraze's user avatar
4 votes
2 answers
165 views

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

I am currently working with convection equation $\frac{\partial C}{\partial t}+u\frac{\partial C}{\partial x}+v\frac{\partial C}{\partial y}=0$. I assume that the velocity field is incompressible i.e. ...
KnobbyWan's user avatar
  • 173
0 votes
0 answers
89 views

How to minimize a numerical integration in python?

I need some help to minimize a numerical integration. It's about a classical problem in physics (hydrogen atom). It can be solved analytically but I need to solve it numerically in Python. We have an ...
Rubens Filho's user avatar
2 votes
1 answer
191 views

Speeding up 3 body problem acceleration calculation

I want to find optimizations to my code for the 3BP, and more specifically computing accelerations. I'm using a data-driven approach, so I have a bodies structure ...
Remeraze's user avatar
2 votes
0 answers
78 views

Preventing an Overflow in Exponential Integrating Factor

The following is the Discrete Spectral Vorticity Evolution PDE for incompressible flow: $$ \frac{\partial \Omega_{pq}}{\partial t} = \nu \left( \frac{\partial^2 \Omega_{pq}}{\partial x^2} + \frac{\...
Jacob Ivanov's user avatar
2 votes
1 answer
177 views

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

To start with, I need to solve this partial equation numerically, but I do not know how to do that. If I try a finite difference method, I face a problem that $u_{i,j}$ is also located in exponential, ...
Evgeny's user avatar
  • 21
2 votes
1 answer
184 views

Need help with the python code: Calculating Madelung constant CsCl crystal structure

Need help with the code to estimate the Madelung constant for CsCl lattice: Cs at (0,0,0) Cl at (0.5, 0.5, 0.5) Answer: Converged value I am getting is 0.465. ...
chola's user avatar
  • 21
4 votes
1 answer
662 views

Is my differential equation solving code wrong?

I am trying to simulate LLG equation without damping. The equation is $$\frac{d\vec{m}}{dt} = \vec{m}\times\vec{H}$$ I am solving in spherical coordinates as LLG equation is known to have problems in ...
User's user avatar
  • 141
2 votes
2 answers
1k views

Understanding leapfrog integration algorithm

The leapfrog.cpp is an implementation of leapfrog integration algorithm where f() function is being integrated: leapfrog.cpp <...
user366312's user avatar
0 votes
1 answer
76 views

In level set fluid structure interaction method why can we rewrite the elastic force in this form while there is no shear force?

when we consider a Immersed Membrane Without Shear, we can define a regularized elastic energy as $$\mathcal{E}(\varphi)=\int_{\Omega} E(|\nabla \varphi|) \frac{1}{\varepsilon} \zeta\left(\frac{\...
吴yuer's user avatar
  • 193
1 vote
0 answers
77 views

Solving perturbed Einstein Boltzmann equations using RK4

I'm trying to learn to numerically solve the perturbed Boltzmann-Einstein equations in cosmology using the RK4 method. These are the equations: $$\dot{\Theta}_{r,0}+k\Theta_{r,1}=-\dot{\Phi}$$ $$\dot{\...
hidenori's user avatar
0 votes
0 answers
42 views

OpenFOAM- write interval changed after restarting simulation

I am running a pimpleFoam simulation on a supercomputer. I have to submit it as a job which has an allocated time. The simulation I was running ran out of this allocated time. So then I restarted it ...
Bernhard Listing's user avatar
0 votes
0 answers
120 views

Damping not working in Verlet simulation with absolute constraint

I'm trying to build a simple physic simulation with Verlet intergration, which I'm currently implementing as such: ...
silverfox's user avatar
  • 101
1 vote
1 answer
56 views

Will hashing become vulnerable to quantum computers?

My knowledge of these subjects is reasonable but limited so please correct anything I say that is wrong. As I understand a hash, with today's technology, is virtually irreversible. Also, any good hash ...
Ethan's user avatar
  • 111
1 vote
1 answer
295 views

Euler's Method for fast moving particle trajectory

I'm trying to figure out how a magnet affects the trajectory of a particle travelling near the speed of light downwards toward the ground. The equation for the force of the magnetic field is pretty ...
summersfreezing's user avatar
2 votes
0 answers
99 views

How can we symbolically working out $\phi^4$ theory green's function/propagator and consequences in python?

I am having some difficulty calculating Green's function symbolically in Python for $\phi^4$ theory. The specific rendition of the $\phi^4$ theory I have in mind can be written as follows. $\mathcal{L}...
kevin Tah N.'s user avatar
0 votes
1 answer
127 views

Lattice Boltzmann method parallelization

I'm learning about the lattice Boltzmann method (LBM) and how it can be parallelized. On Wikipedia, they say, "The LBM was designed from scratch to run efficiently on massively parallel ...
Medulla Oblongata's user avatar
0 votes
0 answers
59 views

What happens at the interface between a solid and a fluid?

I am doing an MPM simulation of water colliding against a solid, I am currently encoding the model for collision forces and I am realising something isn't clicking. Let us assume the fluid experiences ...
Makogan's user avatar
  • 263
1 vote
1 answer
105 views

Isolating decaying solutions to nonlinear second-order ode

I need to solve a nonlinear ODE of the form $$ \frac{d^2 y}{dx^2} + \frac{1}{x}\frac{dy}{dx}-\frac{1}{x^2}\sin(y)\cos(y)+\frac{2}{\alpha}\frac{\sin^2(y)}{x}-\sin(y)=0 $$ numerically, subject to the ...
Ali Shakir's user avatar
0 votes
2 answers
163 views

Approximating the solution of a non-linear ODE using Python

This is my first time asking a question here, so please tell me if I have made a mistake or if anything is unclear. I am working on my high school research project on the motion of a ball falling ...
user1193197's user avatar
1 vote
0 answers
41 views

Stress and periodic boundary conditions

In the textbook definition of the stress tensor it is defined at each point in space and therefore position dependant. When three dimensional periodic boundary conditions are used, I have seen it ...
nameiki's user avatar
  • 11
2 votes
0 answers
137 views

How can I incorporate angular momentum in this code?

I'm currently working on the 3-body problem, and I was writing a code to plot the trajectories of all 3 bodies while also manipulating the angular momentum of the system. I found a code online and ...
Belal Bahaa's user avatar
1 vote
0 answers
30 views

How can the current-voltage relationship of a series of tunneling junctions be most easily computed?

I'm working on a research project with my professor where we're trying to figure out how to determine the necessary semiconductor composition for a solar cell to have a particular bandgap in order to ...
Mikayla Eckel Cifrese's user avatar
0 votes
0 answers
45 views

fdtd ansys Lumerical vs fresnel solution

I am comparing reflectance intensity of silicon structure with a hole. I am getting oscillating solution for 0 roughness factor in equation based model. but spectrum shape of fdtd and equation based ...
aawer's user avatar
  • 1
0 votes
0 answers
33 views

How can you plot a value in PYTEARCAT?

I've been working with Tensor calculus using the Python module PYTEARCAT. (See: https://arxiv.org/abs/2106.15016 and https://github.com/pytearcat/pytearcat.) It calculates quantities such as the Ricci ...
Sciencemaster's user avatar
2 votes
2 answers
1k views

Problems solving 2D heat equation using physics-informed neural networks

I am trying to solve 2D heat equation using the physics-informed neural networks approach. The training loss is decreasing, but my final network outputs make no sense. I am using Python/Pytorch. 2D ...
Abdeldjalil Latrach's user avatar
0 votes
1 answer
121 views

finding weak form of nonlinear differential equation for FEM simulation

The following is the well-known nonlinear differential equation for director's distribution at static equilibrium in liquid crystal displays(LCD). I want to obtain weak form of the given differential ...
Hari Sam's user avatar
0 votes
0 answers
48 views

I encountered some issues simulating the shape transition of silicon clusters using LAMMPS

== I have been trying to write an input file for lammps to simulate the shape transition of a nanoparticle of silicon using multiple potentials to obtain the best structure, which I will compare with ...
Hadjmohammad Abderahmane's user avatar
1 vote
0 answers
74 views

What architecture of CNN to solving a image regression problem (case study: solving Poisson equation)?

I've been working on solving Poisson problem using CNN model (you can ignore the Poisson problem part if you not familiar and jump to the image processing/CNN part). More specifically, I am solving ...
samueljohlal's user avatar
0 votes
0 answers
39 views

Energy potential involvign pressure and viscoscity?

Making a really long explanation short. I am looking for an energy density function for an incompressible isotropic fluid that involves both viscoscity and pressure. The reason is, there is a way to ...
Makogan's user avatar
  • 263
0 votes
0 answers
61 views

Absence of discontinuity in Specific Heat in liquid-gas transition (Based on the Ising Model)

I'm trying to do a model for the transition liquid-gas based on the Ising model and the metropolis algorithm, instead of using values of spins, I'm saying that a cell is occupied by a particle or not. ...
madcreatorfr's user avatar
0 votes
0 answers
54 views

Solving a minimization problem without flattening inputs?

I am reading this paper on improving time steps for solving simulation problems: https://www.math.ucla.edu/~jteran/papers/GSSJT15.pdf The authors developed this energy function: $$E(x) = \frac{1}{2\...
Makogan's user avatar
  • 263
0 votes
1 answer
119 views

Issues with Simulating the Orbits of Mars and Earth using MATLAB and Runge-Kutta Method

I'm trying to simulate the orbits of Mars and Earth in MATLAB using the 4th order Runge-Kutta method for numerical integration. However, the orbits appear as straight lines rather than the expected ...
Javadkhan's user avatar
0 votes
1 answer
61 views

Reverse engineering phase shift and numerical damping

I've been trying to validate the physics behind a particle system framework, but I'm having some difficulties. A particle system is a set of lumped masses connected by spring-damper elements. Linear ...
AlexBatch's user avatar
0 votes
1 answer
41 views

1 dimensional simulation of gravity fails

In 1D the force of gravity does not diminish with distance however here I use 1D to mean the point mass only moves in a line in 3D space, with the other mass stationary at the origin. I started by ...
user avatar
2 votes
1 answer
79 views

Best approach to simulating dynamics on networks

I have been recently getting into the field of various processes on networks. For example, stochastic processes like percolation, Ising models, various statistical-physics models; or deterministic ...
YeatTheorem's user avatar
0 votes
0 answers
113 views

Adding stability to MPM simulation?

I am writing a 2D implementation of MLS-MPM, I have fluids working perfetly fine, solids technically work as well, at low time steps. This is the fluid simulation at a large time step: https://i.stack....
Makogan's user avatar
  • 263
1 vote
0 answers
56 views

Need help implementing finite difference Beam Propagation Method to Solve 2-D Helmholtz equation

I am trying to implement beam propagtion method in a two-dimensional lattice to solve Helmholtz equation by following the scheme given this paper. I am using Matlab for implementation. The expected ...
Yashab Yadav's user avatar
3 votes
1 answer
692 views

Time and memory required to diagonalize a 18000 by 18000 matrix using numpy in python

Can someone give an estimate of the Time and memory required to diagonalize a 20000 by 20000 complex hermitian matrix using numpy in python ?
Snpr_Physics's user avatar
2 votes
0 answers
165 views

Poisson equation solution in a semiconductor structure

I am trying to solve the $\textbf{1-D}$ Poisson equation for a semiconductor structure at equilibrium (There is no external bias applied). $\textbf{Background}$ \begin{equation} \frac{d^2V}{dx^2} = -\...
0-0's user avatar
  • 33
4 votes
1 answer
134 views

Rank-1 correction of matrix exponential

I need to approximate the following in $O(d)$ time for $d\times d$ diagonal $A$ and rank-1 $B$ $$u^T \exp(-A+B) v$$ Here $u,v$ are vectors in $\mathbb{R^+}^d$, $A,B$ are positive semi-definite and $B$ ...
Yaroslav Bulatov's user avatar
1 vote
0 answers
73 views

SPH example codes for solving differential equations

I'm quite new to the smoothed particle hydrodynamics method, so I'm trying to find Matlab or Python code to help me understand it. Specifically, I want to know how to solve the one-dimensional ...
Medulla Oblongata's user avatar
1 vote
0 answers
55 views

How to calculate the reynolds number for airborne wind energy system?

I am asking for some help on how to calculate the reynolds number for an AWES. I know the formula of Re=rhovl/viscosity. I have selected the air foil as Clark y with chord length 3.72m (which will be ...
Yash Shah's user avatar

1
2 3 4 5
10