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

1,156 questions
Filter by
Sorted by
Tagged with
20 views

### Creating equation for position when the acceleration depends on the current position

I am writing a simplified simulation of how a drone will move to a target destination. The drone adjusts the acceleration based on the distance from the target location. I want to use the equation ...
43 views

### Finite Difference method for the heat equation of a compound 1 dimensional rod formed of two materials [closed]

The finite method for 1 dimensional rod of 1 material is. where a(dt/dx^2) = r, a is thermal diffusivity, dt is timestep and dx is position With boundary conditions u(0, t) = 0, u(1, t) = 0 and ...
33 views

As indicated in the title of the discussion, I would like to know if it would be possible to simulate through software based on the finite element method COMSOL Multiphysics the movement of a particle ...
12 views

### Scilab programming [closed]

In scilab to do a derivative I used the syntax derivative as: Function y=f(x) y=x/log(x) endfunction disp(derivative ("f","x",4)) And my output was: Undefined variable: derivative Where was I mistaken?...
9 views

### How to caculate the Madelung constant of K3C60? [closed]

Calculation of Madelung constant of K(1),K(2) and C_60 ions by trial programming.
35 views

### How to change the direction of arrows on Feynman diagrams in LaTeX? [migrated]

I am having a lot of difficulty writing Feynman diagrams in LaTeX. In particular, getting the direction of arrows correct for my external fermion lines. On overleaf I used the code they wrote as an ...
28 views

### How should I self-study condensed matter in many-body quantum systems? [closed]

I am a computer scientist that has been doing research on quantum computing and tensor networks for a couple of years. I have a strong understanding of the math and multilinear algebra underlying ...
22 views

I have to simulate the wavefunction of a quantum driven duffing oscillator coupled to a bath of harmonic oscillators. The master equation is given by $\frac{d\rho}{dt}=\frac{i}{\hbar}[\rho,H_{sys}]-\... 0answers 31 views ### How would I code a program to calculate the 3D scalar field of heat transfer through a solid? [closed] I have programmed a 3D visualiser which can load models in from .STL files. I would like to add some features such as simulations for heat transfer, fluid dynamics and magnetic fields. I would like to ... 0answers 11 views ### How to calculate the composition of plasma species and decide the reaction happens for a given plasma reactor condition? [closed] I am currently working on a project of setting up a model for plasma etching process which is a key process in semiconductor industry producing all the intergrate circuits used in modern electronic ... 1answer 53 views ### Are numerical relativity solutions actual solutions to the Einstein Field Equations? Perhaps this requires a more advanced knowledge of differential equations, but are solutions in numerical relativity (for example, the merger of two black holes) actual solutions to the Einstein Field ... 3answers 622 views ### Why do we need Gauss' laws for electricity and magnetism? The source of an electromagnetic field is a distribution of electric charge,$\rho$, and a current, with current density$\mathbf{J}$. Considering only Faraday's law and Ampere-Maxwell's law: $$\... 0answers 12 views ### Trying to determine physically meaningful initial conditions for test particle around a Kerr black hole I am working on some code for a test particle orbiting a Kerr black hole. I am trying to determine what the initial \frac{d t}{d\tau} would be. On Wikipedia https://en.wikipedia.org/wiki/... 0answers 28 views ### What's the height at which a rocket has to start its engines to land? [closed] Suppose you have a rocket on a trajectory not far from the atmosphere-less surface of a planet. Also suppose the rocket can produce thrust without lowering its mass and the gravitational constant of ... 0answers 13 views ### Refocusing light field images via Fourier Slice Photograph theorem I am trying to refocus images from a microlens array light field using Ren Ng's Fourier Slice photograph theorem found in his thesis chapter 5, equation 5.7, which is available at https://stanford.edu/... 2answers 52 views ### Number of nodes in Hartree-Fock solution The Hartree-Fock equation for atoms is of the form \left[\frac{d}{dr^2}+f(r)-\epsilon\right]P(r)=g(r) \tag1 Usually algorithms to solve this equation assumes that the number of nodes of P(r), ... 1answer 38 views ### Units in orbital modeling I'm trying to make a simulation of simple planetary orbits in Python (with only Earth and Jupiter) and was wondering if there are any convenient units one could use? I currently have the gravitational ... 1answer 67 views ### Can you numerically compute a trajectory by direct minimization of the action functional? Is there a numerical approach to compute simple projectile motion by directly minimizing the action functional? I was thinking that the trajectory is essentially a least cost path through phase ... 1answer 36 views ### Can I have detailed balance without reverse updates? I am implementing a Markov Chain Monte Carlo algorithm and want to obtain a stationary distribution. In order to do this I want to have detailed balance, as this is a sufficient, although not ... 1answer 37 views ### Finite computational power of universe vs continuous nature of unbounded particles I am not a physicist, but I've worked to make this an intelligible question for SE. What information is exactly and how it is stored in the universe is still being studied, but here Seth Lloyd gives ... 0answers 28 views ### Solve the 1D poisson equation by integrate twice the charge density Let's say I have a set of data ((1-D)array) called charge density along the z direction (obtained from DFT calculation)and I want to integrate it twice with respect to z coordinates points (i.e., if \... 0answers 25 views ### Can you explain how the pseudopotential method is used to calculate band structures for a senior physics student? My senior project is about calculating the band structures using the pseudpotential technique through writing a mathematica code for some materials such GaAs. I have read about the topic and I knew ... 0answers 21 views ### Simulation of the Delta Kicked Rotor in Momentum Space I am trying to work through this paper which goes through the Atom Optics Kicked Rotor. Starting with the Hamiltonian:$$ H = \frac{p^2}{2m}+ K \cos(2k_Lx)\sum \delta(t-nT)$$This corresponds to a ... 1answer 62 views ### Gyroscope Equations of Motions I want to compute the motion of a gyroscope system like in this figure to show the different motions for different initial condition and then study precession and nutation motions. The problem is that ... 0answers 25 views ### Solving the scattering field equations to get FDTD equations I was going through a paper FDTD method for the scattered-field equation to calculate the radar cross-section of a three-dimensional target published in the Journal of Computational Electronics(2018).... 0answers 22 views ### Unconditionally stable numerical method for 1st order non-linear coupled ODEs? [migrated] I am attempting to numerically solve the following system of ODEs:$$\begin{gather}\frac{dT_1}{dt} = f_1(T_1,T_2), \quad T_1(t=0)=T_{1,0} \\[3pt] \frac{dT_2}{dt} = f_2(T_1,T_2), \quad T_2(t=0)=T_{2,0}... 2answers 49 views ### Fluctuating magnetization curve in ising model I am working on Metropolis-Montecarlo algorithm for 2D Ising model in python partly based on this document. I ran the simulation for 100 times on a 25 x 25 lattice with external magnetic field B = 0. ... 0answers 23 views ### Is there a code for Ewald Summation for Dipoles? Does anybody know if there exists a code that calculates the potential energy for a system with both point charges and point dipoles using Ewald summation? This would be a great help to my Master ... 0answers 27 views ### Does the degeneracy in dominant eigenvalues of MPS transfer matrix necessarily mean long-range correlation? A short-range correlated MPS state generally has one non-degenerate dominant eigenvalue in its transfer matrix, and the degeneracy in transfer matrix generally leads to long-range correlation (I'm ... 0answers 8 views ### Using Implicit Euler with second order differential equations [migrated] We can numerically integrate first order differential equations using Euler method like this: $$y_{n+1} = y_n + hf(t_n, y_n)$$ And with Implicit Euler like this: $$y_{n+1} = y_n + hf(t_{n+1},y _{n+... 1answer 59 views ### Extension of classical Liouville operator Let us consider a classical Hamiltonian system described by the Hamiltonian \begin{equation} H(q,p) =\frac{p^2}{2m}+V(q) \end{equation} where we stick to the case of single particle for simplicity. I ... 1answer 28 views ### Calculate local linear accelerations from trajectory I'm trying to simulate linear accelerations and angular velocity of a vehicle which drives on a flat surface. For this, I want to use a trajectory consisting of position (x_i, y_i) and orientation \... 2answers 53 views ### Simulation of Feynman path integral in literature Can someone provide me a numerical simulation of Feynman path integral? Where the contribution of each path is added individually so that I can understand how much do the paths outside the light cone ... 0answers 96 views ### Can quantum computing solve the curse of dimensionality? Edited version The curse of dimensionality is ubiquitous in machine learning (ML) modeling, stochastic control and reinforcement learning, arising in a probabilistic sense, with strong connections to ... 1answer 63 views ### Understanding the equations of motion for the Polyakov action in string theory I want to make a small numerical simulation of how strings in theory move under their equations of motion but I'm getting stuck at implementing the constraints. The Polyakov action reads$$S=-\frac 1{... 0answers 32 views ### Two-body problem: equal mass keplerian orbit? [duplicate] Sorry to post a question on this again but I am still struggling putting two equal mass objects in a keplerian orbit. To summarise: 1) I have placed two bodies of masses 0.5 at +- 10 units on the x-... 0answers 23 views ### Is there a good physical simulation software (mainly refers to the rigid body mechanics simulation)? [duplicate] I want to simulate the examples in theoretical mechanics and analytical mechanics. I need a mechanical simulation software, which can customize the force field, spring, rigid body, connecting member ... 0answers 24 views ### Error in FWHM of photo peak I have spectra for different sources I need to find the FWHM of to determine energy resolution of a scintillation detector. I have taken spectra and then fitted a gaussian to the photopeak: The scipy ... 2answers 110 views ### Solving Keplerian two-body problem numerically? I'm trying to solve the two-body problem numerically, setting up G, m1 and m2 =1.0. The masses are placed at the positions -10 and 10 respectively along the x-axis and gave them both 0 on the y-axis. ... 1answer 49 views ### Engineering Equation Solver (EES) Entropy returning NEGATIVE numbers [closed] I am using Engineering Equation Solver (EES). When I try to find Entropy given Temperature and Quality (liquid) at saturation pressure for carbon dioxide I keep getting a negative number. s=... 1answer 55 views ### Phase-ordering dynamics: numerical solution of the Mazenko equation in$D=2\$

I'm considering the Mazenko equation as it's written in https://doi.org/10.1103/PhysRevB.46.10594 (eq. 7) \begin{equation} \label{a} f''+\left(\frac{1}{x}+\frac x 4 \right)f'+\frac \lambda \pi \,\tan\...
45 views

### Solving projectile motion using least action principle and level sets

I'm trying to compute 1D projectile motion -- basically throwing a ball up and catching it in the same hand. I want to use Lagrangian dynamics and find a numerical solution out of interest. I ...
79 views

### Equations of motion: Calculate location of point [closed]

The scenario is that a user is dragging an object on a touchscreen. I want to calculate the position of the object as the finger drags it across the screen. I also want to account for any acceleration ...
9 views

### Simulating Thin Film Bulk Acoustic Resonator based on Lateral Field Excitation on COMSOL

I am a beginner to COMSOL and I have to simulate a Thin Film Bulk Acoustic Resonator based on Lateral Field Excitation on COMSOL. Can someone give me a detailed approach on how should I do the ...
11 views

### Why the Interaction potentials parametrisations for Bulk system is not working for Nano-systems?

I am studying several thermodynamics properties of crystalline iron oxides (Fe3O4, Gamma- Fe2O3) in their solid phases by MD simulations. At the moment, I am facing many difficulties in simulating the ...
27 views

### How to properly implement Newton Cooling in FTCS Heat Equation

I am attempting to model the temperature in 2D plate using the FTCS scheme for the heat equation. The plate is finite, and discretized squarely. I do not want the temperature fixed at the edges. ...
60 views

### Simulated gravity equations

I'm working on a game that'll have a (I probably naively believe) simple gravity component and am looking for a couple of equations for the task. Given 1) a ball rolling from point A down (or up) a ...
44 views

### “Unnatural” Hamiltonian systems from a statistician's perspective

I would like to learn more about "unnatural" Hamiltonian systems, that is, systems whose energies cannot be written as $$H(p,q) = K(q) + U(p).$$ I have seen the term "natural" applied to systems ...