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.

1
vote
2answers
143 views

Discussing the energy spectrum of Langevin Dynamics simulation of many atoms

UPDATED I've coded a multiparticle MD simulation in 3D. It is based on Langevin Dynamics, with random impulse and dissipation. I think the program works correctly now? I have attached the plots of ...
1
vote
0answers
89 views

Band structure of nonlinear Schrodinger equation with one dimensional potential

I have a nonlinear Schrodinger equation which reads: $$ \frac{1}{2} \frac{d^2u}{dx^2}+ |u|^2u + V(x)u = -i \frac{du}{dz},$$ where $V(x)=\cos(wx)+ i a \sin(wx)$ and $w$, $a$ are numbers. How to ...
1
vote
2answers
107 views

How to compute forces in multi-particle MD

Suppose we have a system of $N$ particles that interact via the Lennard-Jones potential $$V(r)=V_0\left[\left(\frac{r_0}{r}\right)^{12}-2\ \left(\frac{r_0}{r}\right)^{6}\right].$$ No other forces ...
0
votes
0answers
51 views

Does radioisotope decay affect computer systems?

It is known that there exist a number of radioisotopes of elements commonly used in computer systems. Is the decay of these materials known to affect device performance over time, or is its impact so ...
0
votes
3answers
228 views

Why there are people that still prefer fortran 77 over new versions?

I am reading some notes from a course in numerical analysis for physical sciences and it is my impression that there are still people that prefer Fortran 77 over new version due to the implicit ...
4
votes
0answers
92 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}}\...
1
vote
2answers
983 views

Solving the 1D Particle-in-a-Box using C++

I've just finished learning the physics behind the problem and would like to write a program in C++ than can solve the problem. I'm actually stuck at the start. I've quite a bit of research, the ...
1
vote
0answers
99 views

Solving complicated coupled ODE using RK4/ODE45 in Matlab

I have the following coupled differential equations also known as Guiding Center Approximation. It is used to explain the position- and velocity change of particles (electrons and protons, N = 1000) ...
2
votes
1answer
3k 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. ...
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 ...
7
votes
4answers
191 views

In Matlab, how can I be consistent with units?

I am modeling some aerodynamics equations and am using meters / centimeters, kilograms, and seconds. I've heard that, "matlab doesn't know units". So, how can I make sure that it does? Just ...
3
votes
1answer
365 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-...
1
vote
0answers
72 views

Numerical scheme to solve Maxwell equations with fixed potential boundaries?

We have a 2D electromagnetic field (in the sense that: $E=(E_x,E_y,0)$, $B=(0,0,B_z)$, and all derivatives with respect to $z$ are $0$), and we are considering a system made up of two walls at $x=-b$ ...
4
votes
1answer
105 views

How to force potential boundary conditions in the Yee scheme for solving Maxwell's equations?

Assume that we have a 2D electromagnetic field (in the sense that: $E=(E_x,E_y,0)$, $B=(0,0,B_z)$, and all derivatives with respect to $z$ are $0$), and that we are considering a system made up of two ...
1
vote
1answer
109 views

Matrix exponential by eigenvectors - implementation issues

I posted a similar question yesterday but I deleted it since I think that I had to reformulate it after some insights. I want to calculate $$ \exp(-i\Delta t\,\mathcal{H}) = V\,\mathrm{diag}(\{\exp(-...
1
vote
0answers
50 views

Dealing with simultaneous collisions in N-body sim

I have written an 2d N-body simulation in Python which allows collisions between the bodies. A body is modeled as a circle whose area is proportional to its mass. Each time the sim advances by one ...
1
vote
0answers
45 views

Is a noise that perturbes the system less than the algorithmic uncertainty reasonable?

I am solving a stochastic differential equation with a small noise to update the velocity of particles. Then I update their position according to an Euler scheme. I am using a step h=0.001. The ...
1
vote
0answers
336 views

One Dimensional Schrodinger's Equation solution using Numerov Method

I have been trying to solve Time Independent Schrodinger's equation in one dimension using Numerov Method as discussed in this excellent lecture notes I found on net. The Numerov method can solve an ...
1
vote
2answers
125 views

Computational Physics: Finding the Diffusion Coefficient from the Discretized Diffusion Equation

I'm pretty new to translating simulation to reality so please forgive the perhaps naive approach I'm taking here. If we have a (quasi-2D) experimental video of a certain concentration changing with ...
5
votes
3answers
1k views

Galerkin method: Test functions vs. Basis functions

I'm a novice to finite element and I'm finding quite hard to find the actual difference between Test function(s) and Basis function(s). I would be glad if somone could explain me that and point out ...
4
votes
3answers
106 views

Numerically finding constants of motion

Given a set of ODE's $ \dot{z} = f(z) $ (or discrete time $ z_{t+1} = f(z_t) $), is there a way to numerically find constants of motion? For $ f(z_t) \approx M z_t $, diagonalizing the matrix $ M $ ...
1
vote
1answer
73 views

Oil/Water interface simulation using GROMACS

I would like to perform a decane/water(tip4p) interface simulation using GROMACS to analyse the fluctuation of the interface over a long period of time (50ps - 1ns). Though I have a rough idea on ...
2
votes
2answers
1k views

Calculating partial trace of array in NumPy

A simulation I'm doing requires me to calculate the partial trace of a large density matrix. I am trying to calculate it using tools from numpy, but my code seems to be having some problems. For ...
1
vote
0answers
111 views

Second Quantization in Matlab

This question may be more suited for physics.stackexchange, but I saw this post was recommended for StackOverflow or Computational Science, so I'm asking my question here. I am trying to write a ...
1
vote
0answers
69 views

Finite difference scheme for unconfined aquifer equation

For an unconfined aquifer we have this PDE for the water table position( of course after somehow making the original Boussinesq equation linearized ): $$ \frac{\partial^2(h^2)}{\partial x^2} + \frac{\...
4
votes
2answers
1k views

Why is it not computationally possible to accurately predict the weather that would occur after 14 days?

As per wikipedia, scientists have not been successful to accurately predict the whether which is 2 weeks ahead. Here is the excerpt: The atmosphere is a chaotic system, as a result, small changes ...
1
vote
0answers
165 views

Double Integrating acceleration data to obtain position: 2 Problems

I have a data sample from an accelerometer from my phone (pretty bad accelerometer though). I'm trying to double integrate it in order to obtain the position as a function of time. I'm using a program ...
0
votes
2answers
60 views

Physical meaning behind the choice of the proposal distribution in Markov Chain Monte Carlo (MCMC) methods

Let us consider the conventions on names used in the theoretical derivation of Metropolis-Hastings Monte Carlo as outlined here, for the sake of common nomenclature. What we are building is a step-...
3
votes
1answer
142 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)....
1
vote
0answers
112 views

Strange solutions using Finite Element Analysis

I've implemented the Finite Element Method to model the heat transfer between two different materials where one material is surrounded by the other. When I run the model I'm getting some strange ...
1
vote
0answers
189 views

1d turbulent energy spectra in homogenuous direction (non-isotropic)

I am trying to compute the one-dimensional energy spectra for my channel-flow simulation. I have already written a post-processing script to achieve this, however I need to validate my code before ...
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 ...
1
vote
0answers
45 views

Parallelizing molecular simulation with full configuration energy

First, let just me stress that I'm not a an expert in computation chemistry, so now the problem: We have GCMC molecular simulation, in the Grand Canonical ensemble, using the standard metropolis ...
0
votes
1answer
123 views

Euler-Bernoulli beam element versus continuum beam element

I am using OpenSees to model a simply supported beam with a point load in the middle. The model is in consistent units. The beam is made up of bilinear quad elements. I have used 30 elements along the ...
1
vote
1answer
84 views

triple cross prouct of tensor

Im trying to compute a triple cross product of vectors a,b, and c in real space and integrate over the entire space. The result is a term in the hamiltonian for an electronic system so there are ...
1
vote
0answers
224 views

Physics of explosions: just vorticity?

eg 1 2. Is it just vorticity? What's actually happening? (Similar: steam engines, volcanoes, clouds). examples are grid-based, using "vorticity confinement" in Phoenix FD. EDIT Some techniques: "...
2
votes
0answers
587 views

Using RK2 Method to solve the simple harmonic oscillator of a horizontal mass on a spring (1D)

Being new to numerical analysis techniques, in particular RK2, I decided the best way to jump in is by using python to solve the well known mass-spring oscillator using RK2 techniques. My problem is ...
4
votes
0answers
93 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$ ...
2
votes
1answer
87 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 = \,...
3
votes
1answer
162 views

How to avoid negative roots with a Newton's method?

I'm currently trying to solve a system of (3) nonlinear equations of (3) variables which are the baryonic density, the isospin asymmetry and and the density of a fluid with the Broyden's method (a ...
1
vote
1answer
202 views

Higher-order Verlet integration

I'm using a simple version of Verlet integration for a particle–particle interaction system with collisions. At the end of each iteration, I integrate like this: ...
2
votes
1answer
48 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 ...
1
vote
2answers
153 views

Can Runga-Kutta method be used to solve non-linear differential equations?

Consider two-body central force problem in polar co-ordinates $r,θ$. Corresponding 2nd order differential equation is obtained by using conservation of angular momentum. This equation is : $ d^2r/dt^...
0
votes
2answers
224 views

Time step relationship with number of elements or material properties

When looking at the output file of my solver, I have been told that the time-step taken by the solver depends on parameters like the total number of elements and their relative size in my geometry, or ...
1
vote
2answers
101 views

Trotter expansions in ode solver?

Trotter expansions say: $$ e^{A+B} = \lim_{P\to\infty} \big(e^{A/2P} e^{B/P} e^{A/2P} \big)^P. $$ With $P = 2$, it becomes (with high accuracy) $$ e^{A/4} e^{B/2} e^{A/2} e^{B/2} e^{A/4}. $$ Let's ...
1
vote
1answer
196 views

Numerical Free Fall Analysis with RK4

I am trying to calculate real speed and time in free fall of a body. I wrote a code in Fortran and I am trying to improve it by using RK4 method x=time y=total free fall Purple line using: ...
2
votes
0answers
58 views

How to model pedestrian flow through subway systems?

I'm a New Yorker and take the subways every day. I have a growing interest in understanding the distribution of paths people take on the subways to work every day. I.e. if there are $n$ subway ...
2
votes
1answer
62 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 ...
1
vote
0answers
41 views

Software suggestion for simulating the stacking of sedimenting rods

I'd like to simulate the following problem: Define some square, horizontal and hard area onto which cylinders (aspect ratio R) sediment. Preferably, the source of cylinders sequentially generates N ...
0
votes
3answers
223 views

What type of computer science/engineering knowledge someone need to have to study graduate level course in compurational physics?

I am wondering if this is the right place to ask this question. I found a related question on stack overflow https://stackoverflow.com/questions/814312/physics-in-computer-science but it was closed. ...