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 [physics]

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

1
vote
0answers
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?
1
vote
1answer
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 ...
1
vote
0answers
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 ...
0
votes
1answer
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: ...
3
votes
0answers
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 ...
0
votes
1answer
74 views

Finding the limit of a function

I have the following code: ...
10
votes
3answers
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: ...
0
votes
1answer
35 views

Cannot set DownValues to ValueList while loading package

I have installed a package named HEP from Wolfram Library Archive which contains several .m files by Files -> Install (...
3
votes
2answers
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 ...
2
votes
1answer
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" ...
4
votes
1answer
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 ...
2
votes
1answer
81 views

Getting asymptotic lines in a electronic filter design plot

I've the following code: ...
0
votes
1answer
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: ...
1
vote
0answers
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 ...
0
votes
0answers
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 ...
7
votes
1answer
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 ...
0
votes
0answers
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 ...
1
vote
0answers
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,...
1
vote
0answers
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 ...
7
votes
1answer
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 ...
1
vote
0answers
35 views
0
votes
0answers
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 "...
4
votes
1answer
133 views

Phase-space integral of n-body decay

Could anyone please hint me what is the best way to calculate numerically the phase-space integral $\Phi$? $$\Phi={\int\limits_{-\infty}^{+\infty}}_{3n\;times}\hspace{-13mm}\dots\hspace{-0.7mm}\dots\...
3
votes
0answers
201 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 ...
13
votes
1answer
1k views

How to generate all Feynman diagrams with Mathematica?

I'm using the words "Feynman diagrams" for indexing purposes, but the question is in fact purely graph-theoretic. Given a list n={n1,n2,...} of non-negative ...
0
votes
0answers
74 views

Animated Spherical Pendulum - animated plot wiggles [duplicate]

Have used the below code to animate a plot for motion of a spherical pendulum ...
0
votes
0answers
36 views

Implement commutativity and associativity for custom operation

Just to give context: I want to implement quantum mechanical ladder operators and for this I want Mathematica to realize when it can just commute my ladder operators with numbers or variables because ...
0
votes
0answers
109 views

NDSolve error: 2D Convection-diffusion equation

I am trying to numerically solve a 2D convection-diffusion equation using NDSolve. This is version 11.2 Here is how I am modelling it: ...
0
votes
1answer
30 views

Assigning eigenkets to particular eigenspace depending on eigenvalues of system inside a module

I am writing a module, in which the Observable and State is given, so I need to write a function/module QuantumMeasurement, that will return a state of the quantum system resulting from the ...
0
votes
3answers
225 views

Gravitational potential of a cube

I want to write code that calculates the gravitational potential of an arbitrarily shaped celestial body. To understand the calculation, I started with an easy shape: a rectangle (or a cube). I ...
12
votes
6answers
632 views

Solving this challenging ODE

Consider the ODE: $$w^{(4)}(x) + (L-x)w''(x) - w'(x) = 0 $$ with some of the following boundary conditions: free: $w'' = 0$, $w'''=0$, clamped: $w = 0$, $w'=0$, pivot: $w = 0$, $w''=0$. Two such ...
-1
votes
1answer
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 ...
2
votes
0answers
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 ...
0
votes
0answers
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, ...
0
votes
1answer
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 ...
6
votes
0answers
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: ...
6
votes
1answer
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 ...
13
votes
1answer
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, ...
6
votes
2answers
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 ...
0
votes
3answers
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: ...
15
votes
3answers
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 ...
5
votes
1answer
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. ...
1
vote
2answers
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 ...
0
votes
1answer
86 views
1
vote
1answer
74 views

TrueAnomaly of planet orbit as a function?

It is possible to obtain the true anomaly of a planet this way: ...
8
votes
1answer
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 ...
2
votes
2answers
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 ...
1
vote
2answers
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, ...
0
votes
3answers
165 views

Calculating bracket operations [closed]

Is there a way to calculate commutation relations in Mathematica? For example, let's say I want to compute ; how can this be done?
3
votes
1answer
473 views

What is wrong in my set of differential equations of a projectile throw?

I aim for using these differential equations to get y[t],x[t] and max range of projectile. I don't know if my physics is wrong or the code is wrong ...