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
2 votes
1 answer
149 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
80 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
648 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
916 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
75 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
  • 151
1 vote
0 answers
75 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
29 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
78 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
52 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
258 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 ...
jasone's user avatar
  • 11
2 votes
0 answers
84 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
111 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
57 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
102 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
155 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
39 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
116 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
27 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
39 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
24 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
556 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
100 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
67 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
60 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
104 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
60 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
39 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
73 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
38 views

What is meant exactly by the domains in this context and how can I simulate their size?

I was working on a problem from "Computational Physics using python: Chapter 17." The problem is concerned with simulating the thermodynamics behind the spin of electrons and the resulting ...
Belal Bahaa's user avatar
0 votes
0 answers
93 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
49 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
0 votes
0 answers
53 views

Help with code for FDM Couette flow of two fluids on python

I'm trying to solve numerically with a python code a very simple BVP that represent the velocity field of two fluids between two plates where the driving force of the momentum transport is only for ...
user avatar
3 votes
1 answer
464 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
146 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} = -\...
Photon's user avatar
  • 33
4 votes
1 answer
119 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
0 votes
0 answers
45 views

Problem with the simulation for pulse propagation solving schrodinger equation using split step method

Based on this code, I was trying to work on a project for my coursework, but I am not able to understand the result. I am not sure, if i am doing anything wrong with the code but the data doesn't make ...
Rima's user avatar
  • 101
1 vote
0 answers
60 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
52 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
0 votes
0 answers
80 views

Advice for a beginner to a computational physics problem

I am a beginner in computational physics but have a background in physics, math, and programming (from online courses, videos, and textbooks) and I would like to know how should I: Approach and think ...
Physics Compiler v2's user avatar
0 votes
0 answers
58 views

Eigenvalues of same operator expressed in two different orthonormal basis are coming out different

I have an operator $H$. I express $H$ as a matrix in the orthonormalized $\{ |e > \}$ basis. Then I diagonalize it to obtain eigenvalues, let's say for example $H$ is $6 \times 6$ and the ...
Snpr_Physics's user avatar
1 vote
2 answers
102 views

Numerical code to solve LLG is not preserving norm

I am new to this thread. I am trying to do a simple exercise on solving the LLG equation. The equation reads: $\frac{d\vec{m}}{dt} = -\gamma(\vec{m} \times\vec{H})$. Given a normalized input state ($...
rahman62's user avatar
0 votes
0 answers
113 views

Solving the TOV equation using Python code: How to manage with the pressure at the surface?

I wrote the code to solve the TOV equation using the Euler method but I got a negative density and pressure! I could not fix the while loop correctly (steps until reaching the surface.) Can anyone ...
user44695's user avatar
1 vote
0 answers
151 views

Solving PDE on a non-uniform grid with Crank-Nicolson scheme

I am solving a 1D diffusion-type equation with the finite-difference Crank-Nicolson (CN) scheme, and I need to densify the spatial grid around the central point. One could change the spatial variable ...
ottavio 's user avatar
1 vote
0 answers
75 views

Solving PDE on a non-uniform grid with Crank-Nicolson scheme

I am solving a 1D diffusion-type equation with the finite-difference Crank-Nicolson (CN) scheme, and I need to densify the spatial grid around the central point. One could change the spatial variable ...
ottavio 's user avatar
0 votes
0 answers
49 views

How to specify the value of pressure in a point in solving steady stokes equation numerically?

I try to solve the steady-Stokes equation numerically on , that is \begin{aligned} -\nabla \cdot \mathbb{T}(\mathbf{u}, p) & =\mathbf{f} \quad \text { on } \Omega=[0,1]*[-0.25,0], \\ \nabla \cdot \...
吴yuer's user avatar
  • 151
1 vote
1 answer
133 views

Free Time Dependent Schrodinger Equation with Inhomogeneous Dirichlet boundary

There exists a FFT-based method to solve the poisson equation in inhomogeneous Dirichlet boundary condition using the sine-transform. For example, Which fourier series is needed to solve a 2D poisson ...
WhatsupAndThanks's user avatar
2 votes
1 answer
99 views

3D turbulent divergence free initial velocity field

I'm trying to build a DNS so simulate non-Newtonian turbulent channel flow using the Lattice Boltzmann Method. Most of the papers I use initialise the system using the analytical solution of the ...
DvB's user avatar
  • 21

1
2 3 4 5
10