Questions tagged [computational-physics]

Questions with this tag should be about computational physics, which is the study of physical situations with the use of software (commercial or in-house). Please note that details of writing and/or debugging code is OFF-TOPIC and should be asked at either Computational Science, Code Review or Stack Overflow.

Filter by
Sorted by
Tagged with
7
votes
2answers
2k views

Physics of simple collisions

I'm building a physics simulator for a graphics course, and so far I have it implementing gravitational and Coulomb forces. I want to add collisions next, but I'm not exactly sure how to go about ...
5
votes
1answer
250 views

Distribution of orbital velocities in a disk galaxy for N-body simulation?

I'd like to write an N-body simulation in which I collide two disk galaxies. To give you an idea of the accuracy I'm trying to achieve, I'm aiming to make this my screensaver at 30fps on my work ...
1
vote
1answer
1k views

Quadratic drag projectile motion

I have calculated formulas with 1 dimensional trajectory motion (free-fall) including quadratic drag, and have created the following equations. These equations of motion are not of much use on its ...
1
vote
2answers
2k views

How to determine velocity vector direction with respect to acceleration.

I'm currently writing a program that attempts to simulate particle movement in a gravitational field with more than one object exerting a force on it. I decided that I'd have the particle move by ...
16
votes
4answers
5k views

How efficient is a desktop computer?

As I understand it (and admittedly it's a weak grasp), a computer processes information irreversibly (AND gates, for example), and therefore has some minimum entropy increase associated with its ...
4
votes
1answer
2k views

How to solve the heat equation for compound materials with different heat conductivities numerically?

I'm solving the heat equation with time dependent boundary conditions numerically in a 2D system using the ADI scheme. For the purpose of this question, let's assume a constant heat conductivity and ...
111
votes
2answers
5k views

Is it necessary to consume energy to perform computation?

As far as I know, today most of the computers are made from semiconductor devices, so the energy consumed all turns into the heat emitted into space. But I wonder, is it necessary to consume energy ...
4
votes
1answer
797 views

Euler Equations, Sod shock tube & conservation

Conservation of momentum? I am considering the Euler equations in conservative form and solving the Sod shock tube problem I have written a Godunov finite volume type solver. It solves for density ρ, ...
37
votes
1answer
2k views

Can lightning be used to solve NP-complete problems?

I'm a MS/BS computer science guy who is wondering about why lightning can't (or can?) be used to solve NP complete problems efficiently, but I don't understand the physics behind lightning, so I'm ...
8
votes
4answers
1k views

Church-Turing hypothesis as a fundamental law of physics

The Church-Turing hypothesis says one can not build a computing device which has more computing power (in terms of computability) than the abstract model of Turing machine. So, there is something in ...
10
votes
1answer
2k views

Is there an algorithm for N body simulations in General Relativity [duplicate]

I am new to general relativity but have a background in computer science. Why is it so hard to do n-body simulations in GR? For example, there could be a program which takes the properties (mass, ...
5
votes
3answers
1k views

Multiple colliding balls

I have written an algoritm to resolve a collision between two balls with conservation of momentum. It looks to work exactly as expected in my simulations. Here is the code: ...
3
votes
3answers
2k views

Solving the two body problem numerically

I'm trying to solve the two body problem numerically, setting up $G$, $m1$ and $m2$ to be equal to 1. then I located each mass on positions -5 and 5 respectively along the $x$ axis and gave them both ...
2
votes
2answers
319 views

Simulate the universe?

Alright, Lets assume that I have a computer with limited calculation speed (1-4GHz) but unlimited parallel processing capability and unlimited memory capacity to go with it. Under this assumption ...
1
vote
1answer
536 views

How do I set up the tridiagonal matrix for a heat diffusion with layers of different thermal diffusivity?

I have Scala code that recreates the Crank-Nicolson solutions for the diffusion equations, and matches 'Excel for Scientists and Engineers' (Joe Billo, Wiley). However, I would like to be able to ...
5
votes
1answer
155 views

Validity of finite difference method

I am using the Finite Difference Method to solve Poisson's equation $$\frac{\partial \phi}{\partial z^2} = \frac{\rho}{\epsilon}$$ To do it is discretized according to the Finite Difference ...
2
votes
1answer
457 views

Explanation of relaxation method for Laplace's equation?

Currently reading through Introduction to Electrodynamics (4th Edition) by Griffiths. I'm trying to wrap my head around Laplace's Equation, here are a couple quotes that I'd like to understand a bit ...
10
votes
2answers
14k views

Numerical solution to Schrödinger equation - eigenvalues

This is my first question on here. I'm trying to numerically solve the Schrödinger equation for the Woods-Saxon Potential and find the energy eigenvalues and eigenfunctions but I am confused about how ...
13
votes
2answers
554 views

How can one obtain the metric tensor numerically?

I am self-studying General Relativity. Is there a method for obtaining the metric tensor exterior to a specified mass distribution numerically? In the simplest case of a spherical mass this should ...
8
votes
3answers
875 views

Is it wasteful to use a heating element, instead of doing useful work?

Consider a computer CPU consuming electrical energy to perform calculations and consequently emitting heat. Assumption: That a CPU consuming x Watts of power, emits the same amount of heat as an ...
6
votes
1answer
146 views

Calculating distribution of force in a N-body system of balls

With three balls placed in a pyramid on a static ground and under the influence of gravity, how will the force of gravity be distributed? The balls have different radius and mass. The initial velocity ...
5
votes
1answer
143 views

Numerical relativity resources - Adaptive Mesh Refinement

I have, in the past few months, been studying numerical relativity, specifically the problem of spherical collapse of a scalar field as studied by Choptuik. I have also taken a look at some books that ...
5
votes
1answer
4k views

How to measure the spin-spin correlation in a Monte Carlo simulation of the Ising model?

I'm simulating the Ising Model in 2D up to 5D and I want to calculate the spin-spin correlation, correlation length, and critical exponent of the system. What is a good way to go about doing this? ...
4
votes
2answers
1k views

Rotation matrix of Euler's equations of rotation relative to inertial reference frame

I was playing with simulation of Euler's equations of rotation in MATLAB, $$ I_1\dot{\omega}_1 + (I_3 - I_2)\omega_2\omega_3 = M_1, $$ $$ I_2\dot{\omega}_2 + (I_1 - I_3)\omega_3\omega_1 = M_2, $$ $$...
4
votes
1answer
485 views

Gravitational field of thin 2D ring - numerical simulation

I'm aware of Newton's Shell Theorem, which states that inside of a thin ring of uniform density, the gravitational force exerted on a point mass should be zero. I wrote a quick field simulation to ...
2
votes
1answer
381 views

Hartree Fock equations

I don't understand how the Hartree Fock equations define an iterative method! For this discussion, I am referring to the HF equations as described here: click me! Basically if you guess a bunch of ...
1
vote
2answers
4k views

How do I integrate the Poisson equation to determine the electric potential along a particular direction (e.g., $z$)?

This question is a sequel of sorts to my earlier (resolved) question about a recent paper. In the paper, the authors performed molecular dynamics (MD) simulations of parallel-plate supercapacitors, ...
8
votes
1answer
413 views

Feynman's infinite amount of logic for one tiny bit of space

Watching one of Feynman's lectures, I came across something that puzzled me. What was Feynman referring to when he said the following? What goes on in no matter how tiny a region of space and no ...
7
votes
1answer
1k views

Numerical schemes, time integration algorithms and energy conservation

What does it mean when someone says a numerical scheme or a time integration algorithm is "energy conserving". How can a numerical scheme "gain" or "lose" or "conserve" energy apart from the numerical ...
6
votes
1answer
178 views

Do black hole merger simulations include regions inside event horizons?

Inspired by this question, I would like to ask the following specific point. In numerical simulations of general relativity that involve black holes, like the ones used to understand the black-hole ...
5
votes
0answers
1k views

An explanation for the Landauer's principle

Has anyone understood the Landauer's principle? What is the current status? In specific, is there a theoretical derivation of the Landauer's Principle?(not the heuristic one based on Salizard's ...
3
votes
1answer
607 views

Update velocity or position first in computation?

I am trying to make a simulation of a vibrating string. The string is divided into $n$ points, and each point along the string is acted upon by a force due to the positioning of its neighbors. I ...
3
votes
3answers
692 views

Computation theory and the simulation argument

Can physical states be treated as information (strings over some alphabet)? If (1) is true, isn't this a trivial conclusion that the universe can be simulated by a Turing machine or a cellular ...
1
vote
1answer
118 views

Calculate Euler equations of fluid dynamics without division?

I'm working on the calculation of the Euler equations with the finite volume method. Unfortunately I'm not allowed to do a division. So I'm wondering if there's a form which does not need a division. ...
-3
votes
3answers
2k views

Can we simulate the whole universe in computer? [closed]

Here is an idea: As human kind we discovered many laws, formulas, events, etc. in our surrounding environment.here is a way to discover the unknowns : Now if we simulate a virtual world with our ...
5
votes
1answer
603 views

Calculating a two-dimensional orbital path with infinite granularity (non-Euler integration)

For a game I am making, I am trying to calculate the position of an orbiting object around one or more bodies. I have successfully implemented this gravity simulation by calculating the force, then ...
3
votes
2answers
464 views

Sampling a distribution (from a galaxy model)

I am reading the following article: http://www.kof.zcu.cz/st/dis/schwarzmeier/galaxy_models.html and am currently at section 5.6 (positions of bodies in a galaxy). I am trying to redo the simulations ...
1
vote
1answer
413 views

Is there a normalized form of the Euler equation discretized with finite volumes?

I want to calculate a flux on my fpga using the Euler equations with the finite volume method. Unfortunately the values of the state variables differ a lot. For example the pressure has a value of ...
1
vote
1answer
358 views

Max Lyapunov Exponent of a Double Pendulum [closed]

Using Euler's method I got this graph. I used separation between angles $10^{-10}$, $\Delta t$ of integration 0.0001s and max time 100s. The initial angles are the same ($\theta_1=\theta_2$). I ...
1
vote
1answer
447 views

Heat equation with heat radiation and heat transfer

If I want to calculate steady temperature distribution on a one-dimensional stick, and I need to consider both the heat radiation and heat transfer, then my equation will be in the form: $$ \frac{\...
1
vote
3answers
526 views

Computerised Solar System Simulation [closed]

In school I am doing a project where using python I simulate the solar system The physics I know so far is newtons laws and Kepler’s laws and I have done a lot of research but there appears to be ...
1
vote
2answers
1k views

The hanging chain problem (catenary), numerically [closed]

I am supossed to solve the hanging chain in constant homogeneus gravity field: The chain of length $L_0$ is divided into $N$ parts which are homogenous with length $l$ and mass $m$ and connected by ...
1
vote
1answer
168 views

How to improve this simple Brownian motion simulation by adding viscosity?

I've written a 0th order Brownian motion simulator to envision how a particle of smoke might appear to move under a microscope. There will be missing $\sqrt{2}$'s and $\frac{\pi}{2}$'s since I haven'...
0
votes
1answer
668 views

How do we define capillary number in 2D (two dimensions)

In 3D the capillary number $Ca$ is defined as: $$Ca=\frac{\nu \rho U}{\gamma}$$ where $\nu$ is the kinematic viscosity ($m^2/s$), $U$ is the velocity ($m/s$)and $\gamma$ is the interfacial tension ($N/...
17
votes
8answers
4k views

Software for physics calculations [closed]

What is some good free software for doing physics calculations? I'm mainly interested in symbolic computation (something like Mathematica, but free).
18
votes
5answers
3k views

Home-made lattice calculation?

The topic of Lattice QCD or Lattice gauge theory or even Lattice field theory is quite old now. And the main reason for the interest in the topic is the ability to calculate nonperturbative stuff on a ...
13
votes
5answers
2k views

In a Monte Carlo $NVT $simulation how do I determine equilibration?

I'm running an NVT (constant number of particles, volume and temperature) Monte Carlo simulation (Metropolis algorithm) of particles in two dimensions interacting via Lennard-Jonse potential ($U = 4(\...
14
votes
3answers
2k views

How are physics and computer science getting united? [closed]

How is theoretical computer science getting united with physics? Phenomena like Quantum Computing uses Quantum Mechanics to be able to compute things, how are computers helping not just to model our ...
10
votes
4answers
7k views

Why is the canonical ($NVT$) ensemble often used for (classical) molecular dynamics (MD) simulations?

Molecular dynamics (MD) simulation is a common approach to the (classical) many-body problem. It relies on integration of Newton's equations of motion to simulate the trajectories of many (e.g., ~1,...
3
votes
4answers
2k views

Schrodinger equation for a Hamiltonian with explicit time-dependence?

Can I write a Schrodinger equation for time-dependent Hamiltonian like this: $$i\hbar\frac{d}{dt}\psi(t) = H(t)\psi(t)$$ and then perform Euler integration like this: $$\psi(t+\Delta t) = (1-\frac{...