# 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.

363 questions
Filter by
Sorted by
Tagged with
7k 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 ...
9k views

### Good examples of "two is easy, three is hard" in computational sciences

I recently encountered a formulation of the meta-phenomenon: "two is easy, three is hard" (phrased this way by Federico Poloni), which can be described, as follows: When a certain problem is ...
6k views

### What language should I use when teaching an undergraduate course in computer programming?

Going to teach students of undergraduate level a course titled Introduction to Computer Programming. I am confused a bit. In Computational Physics scientists use C/C++ or Python or Fortran,CUDA etc.......
2k views

### Why is leapfrog integration symplectic and RK4 not, if the latter is more accurate?

In a system where energy theoretically should be conserved, the most accurate simulation would conserve energy (as well as giving accurate positions, velocities and etc). RK4 is more accurate than ...
373 views

### Quality of linear congruential generators for random numbers

I'm doing some simulations of the Langevin equation, for various external forces. Being told that C's rand() from stdlib.h can ...
1k views

### Conserving Energy in Physics Simulation with imperfect Numerical Solver

I am creating a C++ Physics Simulation where I need to move an rigid body through an acting force field. Problem: simulation does not conserve energy. Quesiton: abstractly, how is conservation of ...
10k views

### How do I plot the surface of a 4D plot?

I am trying to plot the wave function for a particle in a 3D box. This requires me to plot 4 variables: x, y, z axes and the probability density function. The probability density function is: ...
2k views

### What are the differences between CFD simulations and realistic ocean/atmosphere model simulations?

The field of computational fluid dynamics (CFD) is dedicated to solving the Navier-Stokes equations (or some simplification of them). A subset of CFD, ocean and atmospheric models numerically solve ...
4k 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 ...
4k views

### Calculating the log-determinant of a large sparse matrix

I need to calculate $\log(\det (\mathbf M_i))$ where the $\mathbf M_i$'s are large sparse matrices, which are real, symmetric and positive semi-definite. I hope to have between $10$ and $100$ of ...
525 views

### DIIS method to accelerate SCF convergence for stretched geometries

I am implementing from scratch an Hartree-Fock calculation in the STO-3G basis set to perform Born-Oppenheimer molecular dynamics. I have a Restricted Hartree-Fock procedure that can reproduce very ...
379 views

### Finite-difference software for solving custom equations

Are there any good, easy to use, software for simulating the evolution of systems of generic differential equations? I know there are custom programs for various specific circumstances (such as ...
681 views

### Introductory book on computational physics [duplicate]

I'm currently working on my MS in CS and have developed an interest in astrophysics. Luckily one of my professors is a astrophysicist and is currently doing research through computational physics and ...
286 views

### Why should I renormalize physical variables?

I am working with legacy physical codes and I develop new ones based on the output of them. They all use their own internal normalization of variables (for example all distances are divided by the ...
5k 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 ...
3k 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 ...
466 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 ...
516 views

427 views

### Transform from constrained to unconstrained optimization

In a constrained optimization problem, I found in a paper a way to define new variables such that the constraints disappear. They only give the new variable definitions, and I would like to understand ...
461 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 ...
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 ...
151 views

### Why are fluid simulations so hard?

Fluid simulations solving the hydrodynamic (HD) or the magneto-hydrodynamic (MHD) equations are very useful in physics, the latter being particularly useful for modeling plasmas. Of course these ...
254 views

### What numerical methods are used to model deformations in elastic physics?

What numerical methods are used to model deformations in elastic physics? For example, here's an example of a hyperelastic deformation in Ansys: Perhaps more simply than hyperelasticity, for linear ...