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

251 questions
Filter by
Sorted by
Tagged with
228 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 ...
109 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 ...
243 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 ...
84 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 ...
65 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 ...
143 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'...
99 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}{...
140 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 (...
2k 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, ...
398 views

2k 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 ...
118 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) ...
5k 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. ...
162 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 ...
197 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 ...
517 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-...
73 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$ ...
113 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 ...
114 views

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