# Questions tagged [physics]

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

439 questions
30 views

### How can I put the gradient of a scalar field in xAct? [closed]

[ for example the gradient of scalar field to square in the Gauss-Bonnet action?
54 views

### Integrating a incredibly long expression, whenever I try to use Monte Carlo I got complex answers

I am trying to integrate a recursion relation that is formulated via conformal invariance. The expression if copy and pasted from Mathematica to Word is over 20,000 pages long. Below is an ...
70 views

### Animating a 3D plot of electromagnetic waves

Could an expert on this site guide me in making an animated 3D plot of electromagnetic waves? I would like the user to be able to change the polarization interactively. Also, I would like to run ...
112 views

### What is wrong with this MonteCarlo? [closed]

I am making a trial for a MonteCarlo. In this code I simulate 10 protons hitting on a slab of gold: ...
47 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 ...
74 views

### Finding the limit of a function

I have the following code: ...
349 views

### DFT for Helium atom

I'm trying to solve this problem I'm not a Mathematica expert, but my program works perfect when vhartree={0,0,..,0} This is the program I wrote: ...
35 views

I have installed a package named HEP from Wolfram Library Archive which contains several .m files by Files -> Install (...
212 views

### How to numerically solve the Schrödinger equation for Lennard-Jones potential?

Hi I have a potential like below: V[x_]:= 102*(4343/x^12 - 650/x^6) + 33/x^2 Which is a kind of modified Lennard-Jones potential. Schrödinger equation is 1D ...
65 views

### How can NDSolve be used to get just the positive or just the negative energy solution to the Klein-Gordon equation?

The Crank-Nicolson technique below is obtained from: "http://reference.wolfram.com/language/tutorial/NDSolvePlugIns.html" ...
251 views

### NDSolve aborted

I'm trying to simulate the formation of vortices in a BEC condensate with Mathematica. This problem was solved a long time ago (see this paper). After making several experiments and changes in the ...
81 views

### Getting asymptotic lines in a electronic filter design plot

I've the following code: ...
51 views

### Filter out eigenvalues in NDEigenfunction

I am going to solve TISE for logarithmic potential in two dimensions. For bound state solution, the energy eigenvalues are to come negative. This is my code: ...
73 views

### Problem with Wick Contraction

I'm trying to compute wick contractions knowing that: $\langle a_a a_b \rangle = \delta_{ab}$. So far I've the following ...
71 views

### Need a method to solve a nonlinear PDE with gradients of the same order as the PDE's

I have a system of first order non-linear PDE's, but some of my boundary conditions are also of first order, so mathematica cannot solve it. When I looked online for similar problems , I found some ...
352 views

### Solving the Schrödinger Equation by exact diagonalization

I am solving the Schrödinger equation via finite difference, via the substitution where we are assuming $V_1 = V_N = \infty$. I solved this using Mathematica for the case that $V(x) = 0$ and get the ...
98 views

### FiniteElement and NDSolve won't work

I need to solve a system of DE's in 2 dimensions over time, The problem is that mathematica complains when I have a boundary condition of the same order as the differential order of the DE's, so I ...
65 views

### NDEigensystem works for 3-D Schrodinger Equation but not 4-D

NDEigensystem works fine for the following 3-D Schrodinger Equation code -- Clear["Global`*"] Rcube = ImplicitRegion[-1 <= x <= 1 && -1 <= y <= 1 && -1 <= z <= 1, {x,...
59 views

### Having trouble finding the path of a projectile with NDSolve [closed]

I have a system of differential equations that models throwing a projectile with air resistance. I want to find the value of $a$ that will maximize the distance of the throw. I don't know why, but I ...
136 views

### Suggestions to increase the speed of a fugacity calculation

I'm writing code to simulate a chemical reaction. This requires the calculation of the fugacity of a mixture of gases. The underlying model is the SRK equation of state. First the physical ...
35 views

### understanding en fixing the error in DSolve system

Why does this code not work: ...
61 views

### Integration involving vectors, in 3D

Since I'm new to Mathematica I was looking for ways to learn vector integration and how to do them efficiently, so I came across this article where they did calculation for field in a point above a "...
133 views

244 views

### How to calculate the Energy momentum ($T_{\mu \nu}$), Electromagnetic field ($E_{\mu \nu}$) and Electromagnetic tensor ($F_{\mu \nu}$) [closed]

Given a RN-metric, how to calculate the Energy momentum ($T_{\mu \nu}$) , Electromagnetic field ($E_{\mu \nu}$) and Electromagnetic tensor ($F_{\mu \nu}$)? What is the appropriate GR tensor package to ...
251 views

### Wormhole embedding diagram

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

### Encountering error messages with both DSolve and NDSolve

Reposting my question in a more legible and understandable way. The earlier one was flouting a few too many posting guidelines. I am trying to solve the heat conduction partial differential equation, ...
105 views

### Discrete Inertia Tensor

I want to write a code that calculates the eigenvectors of the Inertia Tensor and then shows me the object and the main axis for rotation. I only consider discrete mass distribution. This is my Code ...
201 views

### How to improve precision of finding the eigenfunction for this 2D Schrödinger equation?

I'm trying to solve a 2D Schrödinger equation with the following potential: ...
89 views

### Is it possible to get the name of a physical quantity related to a quantity, e.g. watts->power?

Is there a way to get the name of the physical quantity given by a particular unit? For example, QuantityUnit[Quantity[1, "Henries"]] returns ...
291 views

### Plotting the eigenmodes of a cylindrical shell

There are many examples of eigenmodes computations for surfaces with Mathematica, such as: https://www.wolfram.com/mathematica/new-in-10/pdes-and-finite-elements/solve-a-wave-equation-in-2d.html, ...
551 views

### Is there a way to do Quantum Computing in Mathematica notebook?

I saw 2 efforts in that direction: WSS17 and WSS16, but I am not sure if there is something in the latest Mathematica that actually allows users to simulate quantum gates. Can anyone please point me ...
287 views

### Want logarithmic scale on the x-axis of a plot [closed]

I have succesfully plotted the running of the gauge couplings to one loop order with mathematica. My code is as follows: ...
601 views

### Gravitational potential created by a thin disc using FEM and NDSolve

Context I would like to compute the torque that a (thin) disc applies onto a ring. I.e. I would like to try to understand what is the impact of this outer ring on the inner disc in the simulation ...
403 views

### Radial distribution function (pair correlation function) for particles in rectangular image

Some time ago I asked the following question on how to calculate the radial distribution function. I have here an add-on question, but before asking it I try to summarize and visualize my problem. ...
159 views

### Non elastic collision?

I am new here and still learning Mathematica in order to make use of it in my studies (physics). I am encountering one "issue". I wish to include non - elastic collision in simulation below: When ...
86 views

### Why isn't my ball bouncing? NDSolve equations [closed]

Here is my program ...
74 views

### TrueAnomaly of planet orbit as a function?

It is possible to obtain the true anomaly of a planet this way: ...
215 views

### Is there any way to speed up this code that's Maximizing a function got from numerical integration?

I have this code below, which is calculating the Binding energy of an electron in a Quantum Well Wire with a hydrogenic impurity in it. Well you don't have to care much about what kind of calculation ...
683 views

### Planck black body radiation curve

I have a data set of intensities and corresponding wavelengths. I want to fit it to the Planck black body radiation curve so that I can estimate the temperature for the given data . I have used the ...
210 views

### Making an animation of the motion of a particle

I am new here. I just installed Mathematica and am learning the basics. I need to solve three equations of the motion of a particle using Do, ...