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.

2
votes
1answer
104 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} = \...
1
vote
0answers
152 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....
0
votes
1answer
223 views

How can an engineering student become a computational scinece expert in a short time [closed]

How can a student with zero computing or programming language knowledge, few engineering mathematics knowledge, understand computational science especially Finite Element Modelling (FEM) from ...
1
vote
1answer
102 views

Finding the lowest $n$ eigenvalues of a band-diagonal Matrix

I have a real sparse matrix of the form $$ \left( \begin{array}{ccc} h_{11} & h_{12} & 0 & h_{14} & & & \\ h_{21} & h_{22} & h_{23} & 0 & h_{25} & & ...
1
vote
3answers
123 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 ...
1
vote
0answers
59 views

Sensitivity Analysis — Total Variation for a function with categorical arguments?

I have an application in sensitivity analysis of complex system models with moderately nonlinear interactions between arguments Arguments potentially dozens or hundreds in number Arguments mostly ...
14
votes
2answers
255 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 ...
1
vote
1answer
1k views

Is there an advantage of using a staggered grid over a regular one when combined with high order methods?

The title says is all. This question is in the contest of an incompressible Navier-Stokes solver. Specifically, I am currently working on a new solver while referring myself to an older code for ...
1
vote
2answers
71 views

Should energy be conserved in an N-body simulation where particles don't lose energy in collisions?

In an N-body simulation where forces between particles are attractive and particles do not lose energy on colliding with walls or each other, should energy be conserved? How could it be, with total ...
12
votes
1answer
563 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 ...
1
vote
0answers
79 views

The Schrodinger equation for time-dependent Hamiltonian after one timestep, taking exponential or use ode solver?

The Schrodinger equation for time-dependent Hamiltonian is $$i\hbar\frac{d}{dt}\psi(t) = H(t)\psi(t) \, .$$ Assuming I knew $\psi(t)$, I want to know $\psi(t+\Delta t)$. Should I take exponential ...
1
vote
1answer
56 views

nodal lines of wave-function $\psi(x,y) = \sin 12x \sin y + (1 + \epsilon) \sin x \sin 12y$

I am trying to reproduce this figure of nodal lines of a wavefunction from this work of Berry $$\psi = \sin 2r\,x \sin y + (1 + \epsilon) \sin x \sin 2r\,y$$ Here the image. The first is $\epsilon = ...
1
vote
1answer
231 views

Object falling with air resistance using Runge-Kutta

I am not very familiar with differential equations, nor physics in general. I am trying to program an object falling with air resistance with the use of a numerical algorithm called Runge-Kutta. The ...
1
vote
1answer
101 views

What is a good algorithm, and framework, to calculate centres of gravity or mass (cog)?

I'd like to take an photograph, subdivide it into a tesselation, either of squares, or (ideally), hexagons, and then find the centre of gravity (or, if you prefer, centre of mass) of each cell of the ...
1
vote
1answer
109 views

Boundary treatment with higher order methods

I wrote a code which solves the 2D Poisson equation with homogeneous Dirichlet BC everywhere and a source term of -1. I am using the classical Jacobi iteration method. The grid is $N_x \, \mathrm{x} \,...
3
votes
0answers
64 views

Cavity Flow CFD Boundary conditions and strange waves

So I have a PDE that I use to describe how material flows through a volume(2D or 3D). $$\frac{\partial C}{\partial t} + \vec{u} \cdot \nabla C = (D' + D )\nabla^2C$$ Now using finite differences I get ...
1
vote
0answers
62 views

Metropolis algorithm and thermal sine-Gordon model

I try to simulate thermal version of 1D $(x, t)$ sine-Gordon field model. I am interested in finding thermal static solution that minimizes functional of energy $E$: $$E = \int dx \left( \frac{1}{2} \...
3
votes
0answers
75 views

Numerical error in implementation of iterative algorithm

I am trying to implement (in Python for now) low thrust orbit propagation for spacecraft using universal variables. For a given central body with the gravitational parameter $\mu$ and an orbit with ...
1
vote
0answers
80 views

How to get the eigenvalues of Hamiltonian in an over complete basis

Let $|\psi_i\rangle$, $i=1...N+m$, be a set of overcomplete basis vector in a $N$-dim Hilbert space. The following are known: (Einstein's summation convention assumed) $$\hat{H}|\psi_i\rangle=H_{ji}|\...
0
votes
1answer
269 views

Difficult bug in my 2D Compressible Euler solver

For the past few days I have been writing a numerical solver for the 2D compressible Euler equations for an ideal gas. My numerical method has been the Local Lax Friedrichs or "Rusanov's method." ...
3
votes
0answers
97 views

Journals that publish theoretical analyses of existing algorithms

In computational physics, the vast majority of papers has the following structure They propose some new algorithm, or improvement to an existing one They give numerical examples, ideally comparing ...
1
vote
2answers
102 views

Definition of inflow boundary in CFD

If $w$ is the vector of conservative variables, $f=f(w)$ the flux function, I think have read somewhere (I can not find it anymore) that the inflow boundary $\Sigma$_ is characterized by: $\Sigma_{-}...
0
votes
1answer
64 views

Conservatives in shock tube

We know shock tube problem will give discontinuous solution of primitive variables ($\rho$, $v$, $p$). Will it give discontinuous result in flux terms? $F =[\rho u, \rho u^2 +p, \rho e_v]^T$. I tried ...
1
vote
0answers
44 views

Book Recommondation for the time-dependent Schrödinger equation [duplicate]

Can you recommend a good book that discusses several methods for the numerical solution of time-dependent and time-independent Schrödinger equation? I have searched the internet several times but ...
0
votes
2answers
259 views

What multibody dynamics softwares exist?

I have used the free, multibody dynamics software MBDyn for a while now. It is a good program and also fits my needs. There are good manuals, basic tutorials and examples to be found. There is also a ...
2
votes
5answers
529 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 ...
1
vote
0answers
57 views

RCWA for Non-Periodic Structure?

I have a quick question regarding Rigorous Coupled Wave Analysis (RCWA) for numerically solving problems (in optics). I am trying to simulate a device which is non-periodic in x, y directions (but is ...
4
votes
3answers
1k views

Understanding Finite-Element Modal Analysis

I am teaching a basic course on computational physics and for the last part of the course I will introduce freshman physics undergraduates to finite-element modelling methods. I am preparing a COMSOL ...
1
vote
1answer
121 views

How to determine the truncation error with products and quotients

If I have an equation given by $$\displaystyle Y = \frac{a^2}{d^2}\frac{(1-c^2\frac{c}{a})}{(1-b^2)}$$ and I expand $a,b,c,d$ in a Taylor series, where $a$ is truncated at the $A^{th}$ order, $b$ is ...
0
votes
1answer
1k views

Solving Time dependent Schrodinger equation using MATLAB ode45 [closed]

The Schrodinger equation for time-dependent Hamiltonian is $$i\hbar\frac{d}{dt}\psi(t) = H(t)\psi(t) \, .$$ I try to implement solve the Schrodinger equation for time-dependent Hamiltonian in ODE ...
3
votes
1answer
406 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 ...
1
vote
1answer
354 views

Implementing velocity verlet for harmonic oscillator in C gives error wrt conservation of energy

I'm attempting to implement velocity Verlet with a harmonic oscillator in C, but I have some errors: Energy is not being conserved Energy oscillates much more than I would expect I believe the error ...
2
votes
1answer
111 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" ...
3
votes
0answers
158 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 ...
5
votes
3answers
105 views

Mixing some particles together - “Game physics for engineers”?

I'd like to simulate how several particles mix together. For example, how do they settle when you throw them in a bucket? How do they assemble in zero-gravity? I might also want that they are "sticky" ...
5
votes
0answers
49 views

Phase dislocations and numerical accuracy

I am solving the nonlinear Schrodinger equation (NLSE), $$A_t+iA_{xx}+i|A|^2A=0$$ where $A$ is a complex valued function, which can be written as $A=ae^{i\theta}$ for $a,\theta$ real. Now, for ...
2
votes
0answers
102 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 ...
3
votes
1answer
357 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 ...
1
vote
1answer
77 views

Convergence Criteria for Two Fluid Flow Solver

Which one of the following is suitable for judging convergence in Two-Fluid Flow Solver? 1) Absolute Residual (L^2-Norm). 2) Relative Residual. 3) Fraction Change in Velocity, Pressure and Volume ...
1
vote
1answer
274 views

Solving a linear system whose matrix has imbalanced diagonal entries

I am trying to solve following set of equations: A(i,i-2)*u(i-2) + A(i,i-1)*u(i-1) + (A(i,i)+β(i) )*u(i) + A(i,i+1)*u(i+1) + A(i,i+2)*u(i+2)= B(i) + β(i) where i=1:1000000 If values of β varies(...
4
votes
2answers
211 views

How to Solve an Integral Equation for an Unknown Integrand numericlaly?

I am working on an astrophysical research in which we relate the cumulative number of Damped Lyman Alpha HI clouds/galaxies, namely their number densities, $\frac{dN_{DLA}}{dz}(>M, z=0),$ to the ...
2
votes
3answers
134 views

combination of field and particle methods for fluid dynamics

In numerical fluid dynamics there are field methods like finite-volume, finite-element, etc. and particle methods like Smoothed-Particle-Hydrodynamics – SPH and others. Both approaches have advantages ...
5
votes
1answer
933 views

What determines the usual chemistry textbook plots of atom orbitals?

In elementary chemistry textbooks you often have pictures like the following one: Are there any conventions how to get them? I am not sure, but I guess that it are contour plots with only one iso-...
1
vote
2answers
614 views

How to implement Newton method in solving 1D PDE system? (ie. Poisson eq, continuity eq, drift-diffusion eq.)

I want to solve PDE system, which consists of Poisson equation, continuity equations for electron and hole with drift-diffusion equation numerically, by using method called Newton's method. This ...
5
votes
1answer
449 views

Help with Fourier beam propagation method

I am working on implementing the Fourier beam propagation method in C++. I am really more of a programmer than a physicist but I think I have a good understanding of what I am trying to do. Here is ...
1
vote
0answers
79 views

Representing a 3D system in 2D (Electromagnetic modelling)

Ok so I'm a complete beginner in computational modelling (I use analytical methods of physics typically) but I would like to model an anisotropic, aperiodic (but not random) finite array of metallic ...
3
votes
0answers
47 views

Numerical Euler Rotation Equation

The problem I have may be really simple, but still getting a hard time solving it. So I have the Euler rotation equations: $$I_{1}\dot{\omega}_{1}+\left(I_{3}-I_{2}\right)\omega_{2}\omega_{3}=\...
0
votes
3answers
783 views

Simple Simulation Examples in Computational Fluid Dynamics

I would like to incorporate a CFD topic in a project I currently have. The deadline is a little less than a month from now. Basically, what I would like to do is solve some equations and simulate ...
2
votes
3answers
372 views

Algorithm suggestion for PDE - example: heat equation

I want to solve the PDE equation numerically. For this, I started my study with something simple; heat equation $$ \frac{\partial u}{\partial t}=\frac{\partial^2 u}{\partial^2 x} $$ with the initial ...
3
votes
1answer
328 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 ...