Skip to main content

Questions tagged [physics]

Questions related to the application of Mathematica to problems in physics.

198 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9 votes
0 answers
791 views

Solving the 2D Schrödinger equation with eigensystem, then verifying orthonormality of eigenfunctions with NIntegrate

I am solving the time-independent 2D Schrödinger equation for an interacting electron and hole in the case of anisotropic electron and hole masses, where the interaction is described a modified form ...
Matthew Brunetti's user avatar
8 votes
0 answers
246 views

How can we improve transonic flow visualization?

With this code we can make 2D FEM simulation of transonic flow around airfoil NACA 0012 at Mach number of 0.925. It takes about 5 minutes on the XENIA-15 laptop of 32 GB memory with processor Intel ...
Alex Trounev's user avatar
  • 45.8k
8 votes
0 answers
782 views

Numeric Solution Hydrogen Atom

I'm trying to solve the Schrödinger equation for the hydrogen atom without made the variable separation of the polar and radial coordinate. It is my test code to extrapolate to another system with its ...
Albus Black's user avatar
7 votes
0 answers
825 views

Mathematica packages for numerically solving the Klein-Gordon and Dirac equations?

The book "Advanced Visual Quantum Mechanics" by Thaller includes Mathematica software packages for the numerical solution of the Klein-Gordon equation and the Dirac equation (subject to user-defined ...
Michael B. Heaney's user avatar
6 votes
0 answers
755 views

Code for quasi 1D nozzle flows

The quasi-one-dimensional model describing the flow of compressible gas in rocket nozzles is very common. The corresponding equations have a divergent non dimensional form $ \frac{\partial \mathbf{U}}...
Alex Trounev's user avatar
  • 45.8k
6 votes
0 answers
280 views

Butter side up?

I've written a piece of code that determines if a piece toast with butter lands on the butter-side or not, depending on its initial velocity and the table height. If you are interested in the physics ...
Sito's user avatar
  • 325
5 votes
0 answers
201 views

Resolving singularity in convection-diffusion equation using pdetoode

Building on the system of equations in this post, I attempted to solve an additional convection-diffusion equation describing the concentration of solute in the lens, which affects its spreading. ...
FLP's user avatar
  • 547
5 votes
0 answers
109 views

Effectivelly using Compile for calculate a Unitary transformation

I am new to Mathematica, and this is my first post, so if my question is not clear enough, I would be glad to read the comments and edit my question to add more information. The problem I need to ...
LUCAS FREITAS's user avatar
5 votes
0 answers
451 views

Is it possible to use Gaussian cgs units in Mathematica computations?

I was trying to do computations in Gaussian cgs units, and of course I failed due to dimensional issues. For instance, $q_1 q_2/r$ cannot be converted to $\mathrm{erg}$ since Gaussian system uses $4\...
4ae1e1's user avatar
  • 295
4 votes
0 answers
121 views

Calculate the integral of the Slater determinant

This is a Slater determinant: $$ s=\left|\begin{array}{ll} \psi_{1 s}\left(r_1\right) \alpha & \psi_{1 s}\left(r_1\right) \beta \\ \psi_{1 s}\left(r_2\right) \alpha & \psi_{1 s}\left(r_2\right)...
我心永恒's user avatar
  • 1,572
4 votes
0 answers
123 views

FEM: modelling 2D flow under periodic forcing

Despite many examples of periodic boundary conditions being presented, it remains difficult to obtain a periodic solution. Let us consider a simple example of a flow in a two-dimensional channel under ...
SantaP's user avatar
  • 845
4 votes
0 answers
70 views

speed up tensor expand

I am using the following code ...
Franzi's user avatar
  • 63
4 votes
0 answers
121 views

Improving NetChain for Physical Data

I am trying to improve my NetChain to better predict physical data from the industrial standard for water/steam published by the IAPWS. Basically, this industrial ...
dearN's user avatar
  • 5,351
4 votes
0 answers
977 views

Wormhole embedding diagrams

I am trying to reproduce the embedding diagrams for the evolution of a Schwarzschild wormhole described in this paper. Following the paper notation, we denote the Kruskal coordinates by $(v,u)$. For a ...
ASM's user avatar
  • 41
3 votes
1 answer
673 views

Recognize physical constants?

Is there some way to ask Mathematica to recognize physical constants, such as 32 or 9.81 (gravitational acceleration, in different units, at Earth's surface)? I have in mind something like the "...
murray's user avatar
  • 12k
3 votes
0 answers
419 views

Chladni experiment verification

I refurbished my post in order to be more understandable. After computing simulations of Chladni patterns with Mathematica (see my previous topics), I finally went to practice. I realized my own ...
Pascal77's user avatar
  • 195
3 votes
0 answers
617 views

Spin Connection using Mathematica

Hello I want to use Mathematica in order to calculate the spin connection of a metric, specifically of the metric \begin{equation} \left(\begin{array}{cccc} -1 & 0 & 0 & 0 \\ 0 & \...
lastgunslinger's user avatar
3 votes
0 answers
285 views

Physics based predictive model using Predict

Summary: The first order response of a block of metal quenching in a fluid (or a cold block heating in a warm environment) is well known. I am trying to create a physics based predictive model for ...
dearN's user avatar
  • 5,351
3 votes
0 answers
198 views

Stationary 1-D Schrodinger equation for calculating energy of a -CH3 group quantum rotor in a metal organic framework

I am trying to calculate the energy of a quantum mechanical rotor by plugging a potential function predicted from DFT calculations in this paper: DOI:10.1039/C8CC02650E The potential can be ...
KTO's user avatar
  • 33
3 votes
0 answers
309 views

Sneg Library - Number operator simplify

I am trying to use the SNEG Library for evaluating some commutators. For instance I am trying to evaluate $$ \left[n_1^2,a^\dagger_1\right]$$ with the code in Mathematica ...
Galuoises's user avatar
  • 533
3 votes
0 answers
993 views

Presentation of SNEG creation and annihilation operators in Mathematica 11

I am using the Mathematica package SNEG to make some calculations in solid state physics (see http://nrgljubljana.ijs.si/sneg/). The programs in SNEG library are running, but their presentation are ...
Willian Natori's user avatar
3 votes
0 answers
293 views

Finding possible lattice planes of a crystal structure

After generating a crystal structure from a crystallographic data and duplicating it to a larger crystal system I would like to find possible lattice planes of this crystal. It is well-known that the ...
PhilG's user avatar
  • 31
3 votes
0 answers
584 views

Solve PDE over time-dependent region

I have some experience with C++ programming, but I am quite new to Mathematica and I think the latter requires a different mindset which I am still not used to. I would like to simulate the effect ...
unvarnished's user avatar
3 votes
0 answers
210 views

Differential equations in partial derivatives

I am trying to get numeric solution for equations: $$ \left\{x^{(2,0)}(u,t) \left(1-\frac{y^{(1,0)}(u,t)^2}{\left(x^{(1,0)}(u,t)^2+y^{(1,0)}(u,t)^2\right)^{3/2}}\right)+\frac{x^{(1,0)}(u,t) y^{(1,0)}(...
qwe8013's user avatar
  • 31
3 votes
0 answers
299 views

How can I improve the solution of my PDE?

I want to improve the last code to find a better solution for umi. For now I'm using only MaxStepFraction. Also, when I put no ...
Raul's user avatar
  • 33
3 votes
0 answers
162 views

How to control pedestrians to enter the simulation region with random functions?

I am working on simulating crowds of a cross-typed region, given that pedestrians entering from 4 gates of north, east, west and south, ...
Andy Huang's user avatar
3 votes
0 answers
1k views

Visualising Special Relativity

Mathematica newbie learning by doing (or not so far, in this case). Problem: Special Relativity - consider two inertial frames $A$ & $A'$ in relative motion. At a time $t0$ as measured in $S$, ...
Julian Moore's user avatar
  • 2,560
3 votes
1 answer
499 views

2 body orbits around a barycenter

I'm attempting to plot a barycentric orbit of the sun and Jupiter. Initial Conditions ...
isaac5122's user avatar
  • 847
2 votes
0 answers
91 views

How to effectively substitute variables in xAct?

I am trying to find the gauge field equation by varying the Born-Infeld Action with the help of xact package. I use the following ...
codebpr's user avatar
  • 2,423
2 votes
0 answers
453 views

How can I solve unintegrated Boltzmann equation fast and robustly?

Consider the following integro-differential equations (the unintegrated Boltzmann equations for ultrarelativistic particles in the expanding Universe): $$ \left(\frac{\partial}{\partial t} - H p \frac{...
John Taylor's user avatar
  • 5,863
2 votes
0 answers
107 views

How can I define a d-dimensional metric on mathematica with abstract components?

I want to define on Mathematica the (d+1)-dimensional metric: $ ds^2 =G_{\mu\nu}dx^{\mu}dx^{\nu}= 2tdt^2 + g_{ij}(t,x)dx^idx^j $ where latin indices go $i,j=1,...,d-1$ and $g_{ij}$ are unknown ...
Mike Ehrmantraut's user avatar
2 votes
0 answers
152 views

How to define a Kerr-Schild metric in xAct?

A Kerr-Schild can be expressed as $g_{ab}=\eta_{ab}+\phi k_a k_b$, where $\eta_{ab}$ is Minkowski metric, $\phi$ is a scalar function and $k_a$ is a (co)vector field which is null and geodetic with ...
Dongba's user avatar
  • 21
2 votes
0 answers
121 views

Tracing the phases (i.e. the minima) of a potential

Is there a Mathematica package to trace the minima of a potential as a function of some parameter, returning its phase structure? Working with particle physics models (in the context of cosmology and ...
Finshky's user avatar
  • 21
2 votes
0 answers
37 views

Simulation of Quantum pseudo-telepathy

I would like to mathematically simulate Quantum pseudo-telepathy on The magic square game from Wikipedia. In section Pseudo-telepathic strategies we can read: The trick is for Alice and Bob to share ...
azerbajdzan's user avatar
  • 19.7k
2 votes
0 answers
80 views

Feynman Rules in FeynCalc

I am trying to find the feynman rules with FeynCalc Package. K1 and K2 are the mésons $K^+$ and $K^-$ ...
Andre Luiz MB's user avatar
2 votes
1 answer
462 views

Properly Updating Particle Motion in 3D Electric Field Simulation

I have a code (very bottom of post) which plots a static electric field as it passed through some metal sheet with an aperture in it. I seek to observe the motion of some N charged particles (point ...
Zach's user avatar
  • 373
2 votes
0 answers
442 views

How to plot the lines of the magnetic fields of a Tokamak using StreamPlot3D?

I would like to plot the magnetic field lines of a tokamak. Introduction Since the magnetic field is solenoidal: $\nabla \cdot \vec{B} = 0$, it is possible to decompose it as: $\vec{B} = \vec{B}_{T} +...
M.N.Raia's user avatar
  • 503
2 votes
0 answers
118 views

Field derivatives in FeynCalc

I am using the latest version of both Mathematica and FeynCalc. I'm trying to obtain the Feynman rules for a theory with derivative interactions. Following https://www.feyncalc.org/FeynCalcBook/...
johnny's user avatar
  • 195
2 votes
0 answers
293 views

The Weyl Scalar: does anyone here knows a code to calculate it?

From pure differential geometry we have an important tensor called Weyl Tensor. Its components are given by: $$C_{ijkl} = R_{ijkl} - \frac{2}{n-2}(g_{ik}R_{jl} + g_{jl}R_{ik} - g_{il}R_{jk} - g_{jk}...
M.N.Raia's user avatar
  • 503
2 votes
0 answers
92 views

Seeming hard-limit on image resolution?

I am trying to generate some very large images of the basins of attraction of a dynamical system. However, the resolution of the images seems to cap out at 10001 x 10001 pixels, and no arrangement of ...
James's user avatar
  • 21
2 votes
1 answer
375 views

Solving two coupled partial differential equations

I am trying to solve the following system of two coupled partial differential equations (both equations equal 0): Here, $V$ and $Y$ are functions that only depend on $r$, i.e., $V=V(r)$ and $Y=Y(r)$. ...
Axionlike particles's user avatar
2 votes
0 answers
533 views

Equation of Motion: Perturb Scalar Field and flat FLRW Metric (xAct)

Is there a way to get the equations of motion (eom) of a scalar field from a Lagrangian in a perturbed FLRW metric? I want to perturb the field as well as the metric to 1st order. What I did so far: ...
kalle's user avatar
  • 181
2 votes
0 answers
143 views

Speeding up NIntegrate and DensityPlot

I'm making a density plot of a spectral function Sfull[kx, ky, kz, Ω] along a specified path in {kx,ky,kz}-space. The plot looks ...
e.g's user avatar
  • 255
2 votes
0 answers
49 views

OscillatorStrength[Helium] and OscillatorStrength[Rubidium] do not return results

I am new to working with the Resonance Absorption Lines Pacgage << ResonanceAbsorptionLines` and trying to write code using the OscillatorStrength command. ...
cphys's user avatar
  • 161
2 votes
0 answers
239 views

Plotting the surface spectral function

I'm not 100% sure if I should be posting this in the physics stack exchange but, I am pretty new to Mathematica, just installed it five weeks ago, and I am having a little trouble implementing the ...
Jared Gdanski's user avatar
2 votes
0 answers
250 views

How to fit my data with following equation?

I have set of data of electronic specific heat ($C_{el}/\gamma_n T$) vs temperature ($T/T_c$). My fit equation is this $$\frac{C_{el}}{\gamma_n T}=-\frac{6}{\pi ^2}\alpha \frac{\mathrm{d} }{\mathrm{...
Nilabja Kanti Sarkar's user avatar
2 votes
0 answers
588 views

Contraction of tensors in chart (xCoba)

I have to do some calculations on modified gravity in xAct. The question is how to construct tensors, made of other tensors with contraction in particular chart. Without chart it can be done with <...
Alex Goldstein's user avatar
2 votes
0 answers
378 views

Model 1D Vlasov Equation

Vlasov Equation The non-relativistic form of the Vlasov equation is given by: $$ \partial_{t} f\left( \mathbf{x}, \mathbf{v}, t \right) + \mathbf{v} \cdot \nabla f\left( \mathbf{x}, \mathbf{v}, t \...
honeste_vivere's user avatar
2 votes
0 answers
72 views

What kind of performance should I expect out of Eigensystem using FEAST?

I'm numerically solving a time-independent Schrödinger equation using Eigensystem's FEAST method. It takes a lot longer than I ...
Diffycue's user avatar
  • 1,844
2 votes
0 answers
169 views

Symbolic perturbation expansion for quantum mechanics using Hellmann-Feynman derivaties

I am interested in some quantum mechanical perturbation expansion for energies. Actually I want to implement these terms $E_n^{(k)}$. As is stated below one can do that using CAS. I would be ...
Raphael J.F. Berger's user avatar