Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

5
votes
1answer
934 views

What determines the usual chemistry textbook plots of atom orbitals?

In elementary chemistry textbooks you often have pictures like the following one: Are there any conventions how to get them? I am not sure, but I guess that it are contour plots with only one iso-...
0
votes
0answers
28 views

Any good resources and books on using AMBER for biomolecular simulations?

I learning AMBER for bio molecular simulations. Apart from the AMBERs official tutorials and manual, I have not able to locate some book which guides a beginner into using AMBER proficiently. Are ...
0
votes
0answers
53 views

How to add red noise to a CFD simulation?

I am using a piece of code to simulate magnetohydrodynamics (MHD). I would like to drive waves on the boundary of my domain. I can drive sinusoidal waves easily by simply specifying: $$v = v_0\sin(\...
3
votes
1answer
276 views

General case Kutta condition

I'm working on a 2D inviscid fluid simulation using a "panel method", with Potential being used to enforce the no-through boundary condition. I'm trying to incorporate the Kutta condition, which says ...
0
votes
0answers
42 views

Social Force Model for Pedestrian Dynamics by Euler Method

The social force model is a model using Newtonian forces to describe the movement of individuals. As seen page 1 Each individual feels the following forces: A driving force towards the goal $$ m_i\...
1
vote
0answers
56 views

How to solve potential flow with FEM, stream function, and the Kutta condition?

I'm trying to solve two-dimensional potential flow over airfoils with the finite element method, using the stream function formulation ($\Delta\psi = 0$, $u = -\partial\psi/\partial y$, $v = \partial\...
0
votes
0answers
24 views

Compute a Boltzman partition function

I'm trying to calculate total energy of a system $$ E(v, h) = -\sum a_iv_i - \sum b_jh_j - \sum_{i,j} v_ih_jw_{ij} $$ Python equivalent looks like this ...
0
votes
1answer
34 views

ISING2D with Mathematica. Searching a correct way to compute the heat capacity (mean values over several iterations)

I'm trying compute the heat capacity $C_v$ out of my simulation for the 2D-Ising model which is given by $C_v = \frac{\langle E^2 \rangle - \langle E \rangle^2}{T^2N^2}$ ($E$: Energy, $T$: ...
1
vote
1answer
196 views

Numerical Sensitivity in Density of States of Tight-binding model

I'm working with the tight-binding model, and I'm trying to learn the basics of how to compute the Density of States (DOS) $N(E)$ numerically. The DOS is given by $$N(E) = \frac{1}{N}\sum_k \delta(...
0
votes
0answers
23 views

Determining the pseudo-time period of a system of $n$-pendulums via Kane's method in Python

We can use Kane's method to integrate the equations of motion for a system of $n$ pendulums with arbitrary masses and lengths (see derivation). In particular, if $(x_i,y_i)$ denotes the Cartesian ...
1
vote
0answers
84 views

How to simulate water, falling under gravity, and impinging on a curved surface, which is kept/present in a domain, containing air?

TL;DR: How do I simulate a hole, at the bottom of a (full) water tank? I am attempting to simulate water, flowing out of a hole/slit, at the bottom of a tank (Water Domain) (under the influence of ...
0
votes
1answer
75 views

Poincare map for Arnold-Beltrami-Childress Magnetic Field in Python

I want to plot the Poincare map for Arnold-Beltrami-Childress magnetic field for parameters $A=1, B=0.816, C=0.5773$ in Python for the Poincare section $z=0$. Also, I am not able to understand what ...
0
votes
1answer
55 views

coupled equations with finite difference method

I have these three differential equations in which I need to solve numerically: $$ \frac{dn_0}{dt}= -n_0(t)W_{01}(t) + n_1(t)K_{10} $$ $$ \frac{dn_1}{dt}= -n_1(t)W_{12}(t) - n_1(t)K_{10} + n_2(t)K_{...
0
votes
1answer
351 views

Proper boundary conditions for potential flow around cylinder

I am computing the stationary, incompressible, inviscid and irrotational flow around a circular cylinder using a discretization in general coordinates. I derived a PDE and proper boundary conditions ...
5
votes
1answer
449 views

Help with Fourier beam propagation method

I am working on implementing the Fourier beam propagation method in C++. I am really more of a programmer than a physicist but I think I have a good understanding of what I am trying to do. Here is ...
0
votes
1answer
66 views

Particle Collision to Static paticles

I have a system of particles with equal distance with each other and another at random positions which is moving with time. I want to know: a) The method by which I can reduce the number of particles ...
3
votes
2answers
123 views

How to simulate basic semiconductor models using the Drift-diffusion model on Python?

I'm trying to simulate basic semiconductor models for pedagogical purposes--starting from the Drift-diffusion model. Although I don't want to use an off-the-shelf semiconductor simulator--I'll be ...
5
votes
1answer
48 views

Mass matrix and BDF time integration

I have a system of nonlinear equations on the general form: \begin{align} \mathbf{M}(\bar{y})\dot{\bar{y}} =\bar{f}(\bar{y},t) \end{align} Where $\mathbf{M}(\bar{y})$ is a matrix and $\bar{f}$ is a ...
1
vote
0answers
36 views

Numerically solving a system of parabolic PDEs and 1st order ODEs

I'm trying to solve the following system of differential equations numerically. What are the available finite difference approaches and matlab solvers to solve such a system? Other approaches to solve ...
2
votes
1answer
86 views

Numerically solving a partial differential equation

I am trying to numerically solve the following PDE, $$\frac{\partial u^A}{\partial t} = c_1\frac{\partial^2 u^A}{\partial^2x} \,,$$ where $c_1$ is a constant. The above can be discretized using the ...
1
vote
2answers
68 views

Guaranteed equality between binary results with increasing MPI processes

Testing on an MPI scientific code for compressible flow dynamics I noticed that the results may depend on the number of processors used for the calculation. In fact, comparing the binary files they ...
3
votes
2answers
83 views

Computational cost comparison of DNS and SPH

I may be incorrect, but it seems like commercial graphics codes typically use smoothed particle hydrodynamics (SPH) to produce stunning simulations and not continuum based methods. Why is this? Is SPH ...
6
votes
1answer
218 views

Putting N hard spheres randomly in given volume

I need to put $N$ spheres with given radius $R$ randomly in a Volume $[-0.5,0.5]^3$, without any overlap of spheres. If I choose values so that all the spheres will occupy ~57% of the total volume, I ...
1
vote
1answer
62 views

Defining dimensionless tempearture for Periodic flow systems

Given a flow inside a square duct with constant temperature at the walls $(T_{w1} = T_{w2} = T_w)$ the physical property in terms of temperature that repeats itself in a periodic fashion is the $\...
-2
votes
1answer
151 views

Solving Schrodinger equation numerically

Here is the Schrodinger equation that is to be solved: A 1D hard wall potential in $[0, 1]$. The potential within the potential well is given by a linear combination of Gaussian dips $$v(x) = - \...
1
vote
0answers
61 views

Split step Fourier method to solve Schrödinger equation for moving potential

I'm trying to use the excellent Schrodinger Python class by Jake VanderPlas (https://jakevdp.github.io/blog/2012/09/05/quantum-python/) to simulate a wave packet within a moving Gaussian potential. I ...
3
votes
0answers
48 views

Should I expect computational gains using a second-order splitting method here?

I am trying to solve a three-dimensional baroclinic transport problem. The hydrodynamic (three-dimensional shallow water) equations are: \begin{align} \nabla \cdot \vec{v} = 0, \tag{1} \\ \frac{\...
35
votes
6answers
3k views

Are there simple ways to numerically solve the time-dependent Schrödinger equation?

I would like to run some simple simulations of scattering of wavepackets off of simple potentials in one dimension. Are there simple ways to numerically solve the one-dimensional TDSE for a single ...
1
vote
2answers
48 views

How to calculate $g_r$ when using the cell method algorithm

I have a self-written MD code in C++. I am simulating atoms using the Langevin dynamics model. I use the linked-cell method to speed up the simulation; as a result, atomic interactions are only ...
1
vote
1answer
39 views

What are the things I should keep in mind before doing an analysis of my gromacs simulation?

I did a liquid argon simulation at 100k. I forgot during analysis that I need to accommodate for the Periodic Boundary Conditions before doing any analysis which included distance. What are other such ...
1
vote
1answer
33 views

Loss of energy when using Roe Solver for solving onedimensional Shallow Water Equations

I have written a Roe solver with Harten entropy fix code in Matlab to numerically solve the one-dimensional Shallow Water Equations. : \begin{eqnarray} \dfrac{\partial h(x,t)}{\partial t} + \dfrac{\...
2
votes
1answer
90 views

Artificial neural networks for Temperature prediction

Imagine I want to consider the temperature for a process given several input varibales. The temperature can be anywhere between 400 and 500 K. Consider I have experimental data to train the network ...
4
votes
1answer
69 views

Symplectic Algorithms for Hamilton’s Equations as opposed to just Volume-Preserving

this might be a silly question, but if we’re trying to numerically solve Hamilton’s equations with some discrete scheme, sometimes when the scheme preserves phase space volume (Hamilton’s eqns are ...
6
votes
1answer
144 views

Pressure definition/convergence issues for the Incompressible Navier-Stokes when using a stabilized P1-P1 finite element formulation

I believe this might be a recurring topic, but i have not found a post that directly related to this issue. I come from a finite volume background and my experience is more with predictor-corrector ...
1
vote
0answers
213 views

Which solvers for BVP in python are the best? Is there something better that scipy.integrate.solve_bvp?

I am trying to solve a boundary value problem with Python. I have been using scipy.integrate.solve_bvp but the result that it is giving me is completely wrong. Basically my code is as follows: ...
0
votes
1answer
157 views

Boole's Rule in python

This is my first post in this forum so please forgive me if it is not the way it should be. My problem is about implementing "Boole's rule" into python. I have succesfully implementet trapezoidal and ...
1
vote
0answers
30 views

How to numerically transform a 2D Fourier spectrum with arbitrary frequency shift to center frequency?

Suppose $F(u,v)$ is the center frequency Fourier representation of some $f(x,y)$ in 2D. $$ f(x,y)=\int\limits_{-\infty}^{\infty}\int\limits_{-\infty}^{\infty}F(u,v)e^{2\pi i (xu+yv)}dudv $$ In ...
1
vote
1answer
100 views

Simple model of Saturn's rings

I’m trying to figure out how to model the rings of Saturn using a particle system for a gravity simulator that I’m making. Using the code below, I’ve managed to create a, if not perfect, decent ring ...
5
votes
1answer
143 views

How is rigid bodies implemented in finite element codes

I am writing a finite element code for structural analysis, and I want to implement rigid bodies. How is this usually done? Say that I have a square mesh, with one half of the mesh being defined rigid ...
4
votes
1answer
118 views

How can I apply Euler's Method to predict a point in time rotating around multiple axis'

I am xposting this from my original stackoverflow question where I was presented with a coding challenge that I have been able to narrow down extensively and I think it lies with Euler's Method. Here'...
4
votes
1answer
172 views

Resources for solving fluid-structure interaction problems

I would like to get started solving Fluid-Structure interaction problems. I already have some experience with Finite Elements, including my own MATLAB and Julia software packages for developing ...
6
votes
1answer
72 views

Eigenvalue problems with extremely small gaps

I'm interested in numerically diagonalizing a class of structured, symmetric eigenvalue problems with potentially extremely small eigenvalue gaps. The question I have is how to design a numerically ...
2
votes
1answer
43 views

Two variables integration matlab

I'm trying to solve physical problem in quantum mechanics of helium atoms, the solution require numerical integration over 2 variables. However when i'm trying to run the next code ...
5
votes
2answers
643 views

A Question About the Rhie-Chow Interpolation Used for Solving the Incompressible Navier-Stokes Equations on Unstructured Grids

When using the SIMPLE method on a mesh with a collocated variable arrangement, the following interpolation is used for the advecting velocities: \begin{equation} u_f = \overline{u}_f - \overline{D}_f\...
1
vote
0answers
75 views

Finite difference methods for coupled 2nd order nonlinear pdes

I have a system of coupled nonlinear PDEs that I cannot figure out how to solve in a smart way using FDM, so I was hoping someone here might have a clue. The equations go as: \begin{align*} \frac{1}{...
2
votes
2answers
112 views

Algorithm to generate water flow map, given a terrain

I've posted the same question at GameDev Stack Exchange, but unfortunately I am not getting any response. So I am going to post ( and reword) it here. Hopefully I can get an answer! I have a terrain (...
1
vote
2answers
1k views

How does one calculate reaction force in FEA?

I wrote a UEL (User Element in Abaqus) for one element and compared to a reference UEL which used standard FEM, where the results agreed satisfactorily, except the reaction force. The stress, strain, ...
7
votes
2answers
1k views

Efficiently finding all (x,y,z) points within certain distance of point P

I am using Python, and I have a Pandas dataframe with hundreds of thousands, if not millions, of $(x,y,z)$ coordinates. I am looking to find an efficient method to index the original dataframe so that ...
1
vote
1answer
102 views

Finding the lowest $n$ eigenvalues of a band-diagonal Matrix

I have a real sparse matrix of the form $$ \left( \begin{array}{ccc} h_{11} & h_{12} & 0 & h_{14} & & & \\ h_{21} & h_{22} & h_{23} & 0 & h_{25} & & ...
1
vote
0answers
47 views

Jacobian Elements for Coupled Drift-Diffusion System using Vertex-Centered Finite Volume

I'm trying to solve the fully coupled drift-diffusion system using Newton's Method. Although I eventually plan to potentially use a Jacobian-Free Newton-Krylov approach, this is still something that I ...