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
3
votes
1answer
87 views

Computation of the heat kernel from Brownian motion

This question is rather simple but I have some difficulties to find code. Let us suppose that I wrote a routine, in a given language, that computes the evolution of a particle doing Brownian motion in ...
3
votes
1answer
451 views

ground state from the Schroedinger equation with a central potential what happens to the origin

I have code that attempts to implement a solution to the Schrödinger equation where there is a central potential (more or less im thinking of hydrogen), in 1-D using the numerov method to construct ...
3
votes
1answer
389 views

How to model the mixing of two fluids in a container?

In the context of a research project of mine, I am faced with the difficult task of modeling the mixing of two fluids in a container. I would like to achieve the following: Given a container (...
3
votes
1answer
576 views

How can I make velocity verlet algorithm more stable?

The answer to this question implies that reducing the time step would make it more stable. However I have tried reducing the time step but the system is still unstable(the total energy increases to a ...
3
votes
3answers
178 views

Numerical scheme with energy conservation?

I have a set of equations to integrate something in time $t$. At each time step I compute a scalar field $\phi(t)$ and a potential $V(\phi)$. I should also control the conservation of energy with an ...
3
votes
2answers
120 views

Finite volume discretization of non-conservative linear hyperbolic equation

Problem. Consider the one-dimensional adjoint Euler equations for $(x,t) \in \Omega \times [0,T]$ with $\Omega \subset \mathbb{R}$ and $T > 0$ $$ \varphi_t + \Big(\frac{\mathrm{d}F}{\mathrm{d} U}(x)...
3
votes
1answer
561 views

Numerical propagation of a density matrix using Liouville von Neumann equation

I want to look at time evolution of the density matrices of some, very simple, spin systems, but I am having trouble with my approach. I want to use a simple for-...
3
votes
2answers
226 views

How to Solve an Integral Equation for an Unknown Integrand numericlaly?

I am working on an astrophysical research in which we relate the cumulative number of Damped Lyman Alpha HI clouds/galaxies, namely their number densities, $\frac{dN_{DLA}}{dz}(>M, z=0),$ to the ...
3
votes
1answer
78 views

Is there any numerical application whose performance heavily depends on the division operation?

I am an undergraduate student majoring in computer science. Recently, I am interested in the division operation, which is not directly supported by some architectures. While some architectures ...
3
votes
2answers
509 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 ...
3
votes
1answer
147 views

Reasons to choose LES in stead of RANS models? (turbulence)

In oceanography, is there any particular reason why choosing large eddy simulations in stead of RANS (regardless of the type of flow)? In both cases, 2d simulations would be used (shallow water model)....
3
votes
1answer
179 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 ...
3
votes
2answers
128 views

Boundary conditions for solving Poisson's Equation with Experimental Data

I want to numerically (with Matlab) solve Poisson's equation : $ \frac{\partial^2u}{\partial x^2} + \frac{\partial^2u}{\partial y^2} = f(x,y)$ On a rectangular domain using experimental data. From ...
3
votes
0answers
59 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{\...
3
votes
1answer
560 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(...
3
votes
0answers
118 views

Non-reflecting boundary conditions for compressible Navier-Stokes equations

I have some questions about the implementation of non-reflecting OUTFLOW boundary condition for Navier Stokes equations. Following Poinsot, Lele "Boundary Conditions for Direct Simulations of ...
3
votes
0answers
125 views

Crank-Nicolson integrator: oscillations with complex matrix

I'm working on a Real-Time TDDFT implementation and I am currently comparing different propagation schemes for the propagation of the Kohn-Sham wave function, $$ \phi(t+\Delta t) = \hat{\mathcal{U}}\...
3
votes
0answers
97 views

How can I evaluate the accuracy of my n-body simulation?

I am making an n-body simulation in python. There are many different methods to numerically solve the system of differential equations governing the gravitational interactions between the $n$ ...
3
votes
0answers
67 views

Cavity Flow CFD Boundary conditions and strange waves

So I have a PDE that I use to describe how material flows through a volume(2D or 3D). $$\frac{\partial C}{\partial t} + \vec{u} \cdot \nabla C = (D' + D )\nabla^2C$$ Now using finite differences I get ...
3
votes
0answers
97 views

Journals that publish theoretical analyses of existing algorithms

In computational physics, the vast majority of papers has the following structure They propose some new algorithm, or improvement to an existing one They give numerical examples, ideally comparing ...
3
votes
0answers
58 views

Numerical Euler Rotation Equation

The problem I have may be really simple, but still getting a hard time solving it. So I have the Euler rotation equations: $$I_{1}\dot{\omega}_{1}+\left(I_{3}-I_{2}\right)\omega_{2}\omega_{3}=\...
3
votes
0answers
52 views

Coupled Diff Equation from Bose Einstein distribution

I am a student doing physics hons and have had very little experience in programming. This semester we are supposed to do a computational project in thermodynamics. I have to solve these two coupled ...
3
votes
0answers
92 views

Tracking the speed of 2D oscillations on a lattice

I wrote a Monte Carlo simulation of the 2D Lotka-Volterra model on a discrete lattice (with periodic boundary conditions). A video that I produced (which images the system after some number of monte ...
3
votes
1answer
332 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 ...
2
votes
3answers
463 views

Algorithm suggestion for PDE - example: heat equation

I want to solve the PDE equation numerically. For this, I started my study with something simple; heat equation $$ \frac{\partial u}{\partial t}=\frac{\partial^2 u}{\partial^2 x} $$ with the initial ...
2
votes
2answers
354 views

2d Euler manufactured solutions

Where can I find manufactured solutions for the 2d Euler equations, with the complete analytical terms, including the Jacobian of the source term ?
2
votes
3answers
137 views

combination of field and particle methods for fluid dynamics

In numerical fluid dynamics there are field methods like finite-volume, finite-element, etc. and particle methods like Smoothed-Particle-Hydrodynamics – SPH and others. Both approaches have advantages ...
2
votes
1answer
318 views

I need to scale variables to solve a 2D PDE. What are the physical considerations of scaling?

I am solving a boundary value problem in 2D via an implicit finite difference scheme. Unfortunately, although the problem is well-posed and should have a unique solution, the condition number of the ...
2
votes
2answers
2k views

Patankar's algorithms for Numerical Heat Transfer and Fluid Flow

I am looking for the algorithm of Patankar (for example, SIMPLE, SIMPLER, SIMPLEC and PISO) written in Fortran for the simulation of heat transfer and fluid flow.
2
votes
1answer
126 views

Do there exist “frameworks” as to how computational scientific experiments claim validity? Scientific method for computed science?

Do there exist "frameworks" as to how computational scientific experiments claim validity? Like "scientific method for computed science"?
2
votes
1answer
356 views

Object falling with air resistance using Runge-Kutta

I am not very familiar with differential equations, nor physics in general. I am trying to program an object falling with air resistance with the use of a numerical algorithm called Runge-Kutta. The ...
2
votes
1answer
111 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 ...
2
votes
1answer
51 views

Can 3rd order TVD admit perfect shift for Upwind 1D Advection equation?

I recently coded a 1 stage and 3 stage optimal TVD-RK explicit scheme using eqn 3.3 here http://www.ams.org/journals/mcom/1998-67-221/S0025-5718-98-00913-2/ on the equation Ux+Uy=0, where x and y ...
2
votes
1answer
65 views

Is this a proper implementation of point charge dynamics with ODEs

Since learning about point charges in my physics II class this semester, I want to be able to investigate not only the static force and field distributions but the actual trajectories of movement of ...
2
votes
1answer
101 views

Monte Carlo Metropolis method - trial step algorithm

I'm working on a Magnetization simulation and writing an algorithm using the metropolis method. I am using a change in energy and a Boltzmann distribution, but, my question is about the trial step. ...
2
votes
2answers
599 views

(Fortran) Integrating/summing over complicated 3D domain

I have some function $F(k_x,k_y,k_z)$ that I wish to numerically integrate over a polygon domain - physically, I am integrating over the first Brillouin Zone (BZ) of the FCC lattice (a truncated ...
2
votes
1answer
149 views

Inclined plate capacitor grid/ mesh

You can calculate the electric potential over every point in a defined space by solving Laplace's equation. To do this in a computer program you set up an 2-d array/ matrix and loop the internal ...
2
votes
1answer
74 views

Langevin equation in 4th order Runge-Kutta

I'm trying to figure out how to translate a piece of code from Velocity Verlet to Runge-Kutta, while treating the time step dependence of the thermal noise correctly. The Langevin equation for my ...
2
votes
1answer
91 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 ...
2
votes
1answer
82 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 ...
2
votes
2answers
166 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 (...
2
votes
1answer
88 views

Mysterious Mirroring in Analytical Solution of a delay differential equation (DDE)

I'm struggling now for several weeks with a very bizarre problem with a system of delay differential equations. First, here the system: $$\dot a = 1 - \Theta(b(t-\tau)-\kappa) \,- a(t) \\ \dot b = \,...
2
votes
1answer
125 views

Why FEM electric analysis gives only access to current density?

A Comsol study using frequency sweep on electric current physics yields only current density as accessible variables. I understand the underlying equation used is Ohm's law, i.e. $$\mathbf{J} = \...
2
votes
5answers
619 views

Open source FEM implementation for Windows

I am wondering is there any robust, well-tested, accurate open source FEM solver package for Windows? I would like to use to power the engine of my structural engineering application. The FEM package ...
2
votes
1answer
122 views

How does Multi Body Dynamics software work for flexible joints?

I need to model a "fishing rod" in 2 dimensions by joining several "rigid sticks" by flexible/elastic joints. The joints act as plate/torsion springs with different spring constants. The "fishing rod" ...
2
votes
1answer
450 views

Second order interpolation scheme

On a grid I am having the values of a physical quantity say for example Temperature, at the E,W,N,S and P node all of them being calculated using a second order discretization scheme. I want a second ...
2
votes
1answer
42 views

Numerical integration of the dataset of a function

The energy equation for a spherically symmetric system is given by $$\mathscr{E}=\frac{v^2(r)}{2}+\frac{c_s^2(r)}{\gamma-1}+\phi(r)$$ where $\mathscr{E}$ is the total energy, $v$ is the velocity of ...
2
votes
1answer
113 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 ...
2
votes
1answer
6k views

2D Ising Model in Python

I am trying to calculate the energy, magnetization and specific heat of a two dimensional lattice using the metropolis monte carlo algorithm. ...
2
votes
1answer
519 views

Defining Cauchy principal value in MATLAB (or Scilab/Maple)?

How to define a variable which is an integral involving cauchy principal value inside in any computer programming language? I want to know how to break down the procedure step by step from a ...