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
2 votes
2 answers
277 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)...
ares's user avatar
  • 155
2 votes
1 answer
147 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 ...
Natasha's user avatar
  • 421
2 votes
1 answer
177 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 ...
אבנר יעקב's user avatar
2 votes
1 answer
104 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 = \,...
Peter123's user avatar
  • 121
2 votes
1 answer
235 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} = \...
AAI's user avatar
  • 123
2 votes
5 answers
959 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 ...
Graviton's user avatar
  • 488
2 votes
1 answer
179 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" ...
cvr's user avatar
  • 261
2 votes
1 answer
911 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 ...
datapanda's user avatar
  • 143
2 votes
1 answer
114 views

3D turbulent divergence free initial velocity field

I'm trying to build a DNS so simulate non-Newtonian turbulent channel flow using the Lattice Boltzmann Method. Most of the papers I use initialise the system using the analytical solution of the ...
DvB's user avatar
  • 21
2 votes
1 answer
68 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 ...
Richard's user avatar
  • 131
2 votes
1 answer
198 views

Defining Current Density in a FEM model (MATLAB)

I'm attempting to solve the Poisson equation in 3D for a magnetic vector potential in the presence of a current source. To validate my code, I'm initially looking to reproduce the model described in ...
LAPEMAG's user avatar
  • 81
2 votes
1 answer
142 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 ...
Gesetzt's user avatar
  • 33
2 votes
1 answer
1k views

1-D turbulent energy spectra in homogeneous 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 ...
Inquisitor101's user avatar
2 votes
1 answer
1k 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 ...
Ka Wa Yip's user avatar
  • 179
2 votes
1 answer
1k views

Is the Finite Volume Method conservative when the source term depends on the variable?

I trying to do a simulation where there are two quantities, $\Delta\theta(x,t) = \theta(x,t) - \theta_{o}$ and $\Delta\nu(x,t) = \nu(x,t) - \nu_{o}$. These quantities are chemical concentrations ...
user avatar
2 votes
1 answer
1k views

Celestial mechanics simulation software? The 'N-Body Problem'

What software or sites might simulate an N-body gravitational problem? Application is related to Klemperer Rosette or Iridium Satellites. Bias for C, C++, PHP, or Java. Nice visuals a big plus. ...
Bob Stein's user avatar
  • 121
2 votes
0 answers
78 views

Preventing an Overflow in Exponential Integrating Factor

The following is the Discrete Spectral Vorticity Evolution PDE for incompressible flow: $$ \frac{\partial \Omega_{pq}}{\partial t} = \nu \left( \frac{\partial^2 \Omega_{pq}}{\partial x^2} + \frac{\...
Jacob Ivanov's user avatar
2 votes
0 answers
99 views

How can we symbolically working out $\phi^4$ theory green's function/propagator and consequences in python?

I am having some difficulty calculating Green's function symbolically in Python for $\phi^4$ theory. The specific rendition of the $\phi^4$ theory I have in mind can be written as follows. $\mathcal{L}...
kevin Tah N.'s user avatar
2 votes
0 answers
137 views

How can I incorporate angular momentum in this code?

I'm currently working on the 3-body problem, and I was writing a code to plot the trajectories of all 3 bodies while also manipulating the angular momentum of the system. I found a code online and ...
Belal Bahaa's user avatar
2 votes
0 answers
165 views

Poisson equation solution in a semiconductor structure

I am trying to solve the $\textbf{1-D}$ Poisson equation for a semiconductor structure at equilibrium (There is no external bias applied). $\textbf{Background}$ \begin{equation} \frac{d^2V}{dx^2} = -\...
0-0's user avatar
  • 33
2 votes
0 answers
168 views

Error in implementation of Crank-Nicolson method applied to 1D TDSE?

Some context, I've posted this question on physics SE and stack overflow. The former had nothing to offer, the latter had a great commenter that agreed with the phase looking off being one of the ...
MinimalCodingIQ's user avatar
2 votes
0 answers
178 views

Numerical solution to the Tolman-Oppenheimer-Volkoff equations for any equation of state (numerical or analytical)

I've been working on a code to solve the Tolman-Oppenheimer-Volkoff (TOV) equations for a while and recently I've got it right but only for one specific equation of state, the bag model, which is not ...
Felipe Flores's user avatar
2 votes
0 answers
45 views

Calculating the species mass consumption from implicit reaction-term in diffusion-reaction equation

The 1D diffusion equation with a chemical source term has the following form: $$\frac{\partial Y}{\partial t} = D \frac{\partial^2 Y}{\partial x^2} - k Y,$$ where $Y$ is the molar concentration of the ...
user306429's user avatar
2 votes
0 answers
38 views

Problem with Time Evolving Block Decimation for small finite chains

Preliminary definitions: I have a code that uses TEBD (https://en.wikipedia.org/wiki/Time-evolving_block_decimation) to perform time evolution of a given Matrix Product State (MPS), lets call it $|\...
Zarathustra's user avatar
2 votes
0 answers
86 views

How "kinematic" rigid bodies are implemented in physics engines

In most physics engines there's this concept of "static" bodies, which act as rigid bodies with infinite mass. Then there are "kinematic" bodies that act as static bodies, but ...
Lenny White's user avatar
2 votes
0 answers
91 views

Finding the extrema of a transition probability function for a quantum walker on a graph

The goal Implement some Python code to find the extrema points of a function that is strongly oscillating. The background Let $G$ be a connected graph with $n$ points with Laplacian matrix $L(G)$. We ...
Optimus Prime Number's user avatar
2 votes
1 answer
126 views

Trouble Making 3rd-Order Sympletic Integrator for Planitary N-Body Problem (A Hamiltonian System)

I am doing a solar-system simulation. I am using Ruth's 3rd order sympletic integrator to avoid the problem of Energy Drift (which I had with RK4), but the the planets quickly leave orbit, and energy ...
maxbear123's user avatar
2 votes
0 answers
489 views

Heisenberg Model python : Specific heat capacity for spin 2

I have the correct plot for specific heat capacity when I am using the formula which is $C_V$ = differentiation of entropy with respect to temperature. However, When I try to calculate $C_V$, by using ...
Mah Esh's user avatar
  • 21
2 votes
0 answers
55 views

What is the best methodology for physics simulators of large floating base rigid body systems?

I want to implement a physics simulator for large floating base rigid body systems from scratch. The Rigid Body Dynamics Systems (RBD) should typically have the following characteristics: About ~50 ...
Jenny Reininger's user avatar
2 votes
1 answer
200 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 ...
T. Auerrac's user avatar
2 votes
0 answers
66 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 ...
theideasmith's user avatar
2 votes
0 answers
192 views

Mass conservation in atmospheric continuity equation numerical solution

My phd project is heavily related to numerical modeling of planetary atmospheres. In particular now I am dealing with a particular expression of the continuity equation, involving a thermodynamic flux....
Juanlu's user avatar
  • 21
2 votes
0 answers
253 views

Solving a 3D (almost radial) convolution with FFT

I have a 3D integral that is almost a radial convolution of the form $$ \int d^{3}k'h(\mathbf{k'})g(|\mathbf{k-k'}|) $$ and I am looking for a fast and efficient algorithm (e.g. FFT) to solve it ...
mehr24's user avatar
  • 21
2 votes
0 answers
169 views

Solving Schrodinger's Equation Numerically in a Bunimovich Stadium

I need to solve, as mentioned, Schrodinger's equation in a Bunimovich stadium-shaped infinite potential well with Dirichlet BC Numerically (this isn't possible analytically). In order to do so, I need ...
ScubaDiving's user avatar
2 votes
0 answers
340 views

Implementation of no-slip boundary conditions in lattice Boltzmann method fluid simulation

My faculty advisor recommended that I take a look at the lattice Boltzmann method as an introduction to scientific computing and potentially an undergraduate honors thesis topic. I cooked up a some ...
Bryan Chem's user avatar
2 votes
0 answers
72 views

Method for calculating the stopping distance using only integers

I am trying to find how much an engine would turn until it stops accelerating with an acceleration of $a = A \sin^2(x)$. Acceleration Integrating the acceleration I get velocity $v = A(x/2 - \sin(...
HYK's user avatar
  • 21
2 votes
0 answers
966 views

Precession of Mercury Python simulation

I was trying to simulate the precession of Mercury based on the perturbed solution: $$\frac{1}{r}=\frac{m}{B^{2}}(1+e\cos\phi+3\frac{m^{2}}{B^{2}}(1+e\phi \sin\phi +e^{2}(\frac{1}{2}-\frac{1}{6}\cos2\...
Sam's user avatar
  • 153
2 votes
0 answers
243 views

Modeling simple laser induced population transfer via adiabatic passage in python

I'm trying to model adiabatic passage between two levels in a three-level atom interacting with two laser fields using Scipy and Numpy.. I'm not sure if my model is wrong due to my incorrectly ...
Thunder Shiviah's user avatar
2 votes
0 answers
143 views

Arbitrary Choosing of the Solution Domain - Navier Stokes and Manufactured Solutions

I want to verify a finite-volume solver (SIMPLE-Algorithm) for the incompressible Navier-Stokes equations by using a manufactured solution. I use Dirichlet boundary conditions for the velocity at all ...
el_tenedor's user avatar
2 votes
0 answers
94 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 ...
Loonuh's user avatar
  • 253
2 votes
1 answer
153 views

Adjusting Keplerian orbits for thrust with numerical stability

I'm writing a mod for a game that models orbital physics (Kerbal Space Program, or KSP). I'm attempting to model the effects of thrust on spacecraft in certain states where the game only models them ...
James Picone's user avatar
2 votes
0 answers
160 views

Why does my Finite Difference approximation not work?

I am trying to find out the magnitude of the acceleration of my object based on non-uniformly sampled 3D position data. I'm using the standard approximation of the 2nd order derivative on a non-...
Yellow's user avatar
  • 121
1 vote
2 answers
426 views

How to simulate over 1 billion particles?

I want to simulate human erythrocytes in capillaries. I calculated, that for a 1 meter long and 1 mm in diameter capillary there are about 3 billion blood cells. Erythrocytes are actually discs, but ...
Stdugnd4ikbd's user avatar
1 vote
2 answers
795 views

Dyadic operations, fourth order tensors and Tensor algebra

I am trying to understand the dyadic operation for a while since I am interested in Elasticity problems. I believe an intuitive understanding (rather than assuming) will give me good problem solving ...
Bruce Lee Jun Fan's user avatar
1 vote
2 answers
326 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^...
atom's user avatar
  • 113
1 vote
3 answers
164 views

Solving a small non-symmetric, non-diagonally dominant, and non-sparse system

I want to solve a small (20 $\times$ 20 up to 30$\times$30) system which is not symmetric, not diagonally dominant, and not sparse. Each row contains a modified form of the Legendre coefficient of a ...
user22326's user avatar
1 vote
1 answer
293 views

Euler's Method for fast moving particle trajectory

I'm trying to figure out how a magnet affects the trajectory of a particle travelling near the speed of light downwards toward the ground. The equation for the force of the magnetic field is pretty ...
summersfreezing's user avatar
1 vote
1 answer
507 views

RK4 integration of the three-bodies problem with C++

first of all thank you for all the answers you gave me yesterday for the integration via Symplectic Euler's method of the three-body problem. We managed to implement both Euler's and Runge Kutta 4's ...
jack23456's user avatar
  • 171
1 vote
1 answer
120 views

Numerical bottlenecks

On a desktop scale computer, what are the most important bottlenecks (RAM vs. CPU, single vs. multithread) for numerical calculations? I'm specifically most interested in exact diagonalization and ...
JumpyLion's user avatar
1 vote
1 answer
121 views

Evaluating an indefinite integral that has no closed form

I need to evaluate the following indefinite integral: $$I=\int\frac{x^5+2ax^3+a^2x-4a}{x^7+ax^5+2ax^4}dx=\int\frac{x^5+2ax^3+a^2x-4a}{x^4(x^3+ax+2a)}dx$$ The solution that I obtained while ...
Richard's user avatar
  • 131

1 2 3
4
5
10