Questions tagged [physics]

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

Filter by
Sorted by
Tagged with
7 votes
2 answers
900 views

Numerically solving radial Schrödinger equation with Yukawa potential

I am trying to solve the radial Schrödinger equation using NDEigensystem but I am running into some issues. There are posts about doing this (see here for example), ...
MarcosMFlores's user avatar
0 votes
0 answers
27 views

Manual updating of function in Do loop

Previously I had asked a question about solving Maxwells equations with boundary conditions, here Machine overflow when defining boundary conditions. I have managed to successfully run the code ...
Jole Stock's user avatar
0 votes
0 answers
39 views

ReplacePart will not accept coordinates [closed]

So, curiously I get an error claiming that entries like {40,80}, {41,80}... will not work as a valid positional input. I'm making these from creating a table. So, I tried manually entering these ...
Skye's user avatar
  • 1
-1 votes
0 answers
27 views

Specify a tensor or a function with a specific form in xCoba [closed]

Suppose, in the Schwarzschild geometry with the standard coordinates, I wanted to specify an electromagnetic tensor F with the (six) components all being functions of r: A(r), B(r), C(r), D(r), G(r), ...
mster8390's user avatar
0 votes
1 answer
66 views

A code to calculate Einstein tensor [duplicate]

I use the following MA code to calculate Einstein’s tensor. I’m asking about the zero component of the Einstein’s tensor, is it correct? Because I think $G_{00}$ should contains the terms in the zero ...
Dr. phy's user avatar
  • 213
0 votes
0 answers
50 views

Calculating and collecting the terms of the zero component of the Einstein’s tensor

I try to calculate the $G_{00}$ of the Einstein tensor $G_{\mu\nu}= R_{\mu\nu} -\frac{1}{2} g_{\mu\nu} R$ for the metric: $g_{00}=-a^2(\tau)\left( 1+2 \phi^{(n)}\right),$ $g_{0i} = a^2(\tau)\left( \...
Dr. phy's user avatar
  • 213
4 votes
3 answers
367 views

How to fit function with data?

I have ...
Sale Gauss's user avatar
1 vote
1 answer
76 views

Value of a function over permutations of two lists

I want to do the sum (in Ising lattice gauge theory) ...
QFTheorist's user avatar
1 vote
1 answer
47 views

Sum on a lattice where variables can only take two values (Ising lattice gauge theory)

I want to study the Ising Gauge Theory which has the Hamiltonian \begin{equation} \mathcal{H} = -J \sum_{n,\mu,\nu} \sigma_3(n,\mu)\sigma_3(n+\mu,\nu)\sigma_3(n+\mu+\nu, -\mu)\sigma_3(n+\nu, -\nu) \...
QFTheorist's user avatar
0 votes
0 answers
62 views

How to calculate Einstein tensor components for this metric?

I try to calculate the Einstein tensor compenents from the eqution: $ G_{\alpha\beta} = \frac{\nabla_\beta (\partial_\alpha \phi)}{\phi} - \frac{1}{2\phi^2} \left[ \frac{\partial_4 \phi \partial_4 g_{\...
Dr. phy's user avatar
  • 213
1 vote
1 answer
100 views

Plot after applying NIntegrate

I'm trying to integrate and graph $I$ vs $b$ the following integral (eq. 24 in this paper) in wolfram mathematica $$ I = \int_{2}^{\infty} \frac{g_i^3 \mathcal{K}_t \mathrm{~d} r}{r^2\left|\mathcal{K}...
Soliton-104's user avatar
2 votes
1 answer
138 views

Numerical ground state wavefunction of Schrödinger equation with a Coulomb potential in 2D from NDEigensystem

I want to numerically solve the ground state wave function of the hydrogen atom with the Coulomb potential using the NDEigensystem. Here is the code to get the ground state wave function from the ...
AminD's user avatar
  • 21
1 vote
1 answer
116 views

Animating a double spring spherical pendulum

I want to make an animation of a double spring spherical pendulum. The first mass is connected to the ceiling with a spring, and the second mass is attached to the first one with a spring too. The ...
Denis D. Bavrin's user avatar
0 votes
1 answer
93 views

Change of variable of a numerically solved integral

I have the following function that numerically integrates a function on the interval $\left[ 2, 100 \right]$ ...
Soliton-104's user avatar
1 vote
1 answer
90 views

Writing a function that sorts by low powers while ignoring higher powers of various variables

I'm writing a Mathematica code with the aim of automating operator mixing calculations in QCD (at least at one-loop order). So far, it can generate Feynman rules and all graphs, assign the rules, call ...
y9QQ's user avatar
  • 21
1 vote
0 answers
81 views

Intensity pattern [closed]

I'm trying to get the following intensity pattern from this paper In the Newtonian case, the equations for the intensity (eq. 9 and 10 in the article), I put them in Mathematica with the change $b^2 =...
Soliton-104's user avatar
0 votes
0 answers
67 views

How do you create a program to calculate the spectrum of a pulse of arbitrary shape?

Develop a program designed to compute the spectrum of a pulse with an arbitrary shape. My current program might not suitable for solving this problem. ...
Iра Сотник's user avatar
1 vote
1 answer
150 views

Animation of double pendulum with a spring (3DOF)

I've got a problem with animating a double pendulum where the first mass is connected with a ceiling with a bar and the second mass is connected with the first one with a spring. Below is my code ...
Denis D. Bavrin's user avatar
1 vote
1 answer
257 views

Plot solution of an integral with parameter

In this article, they solve the following integral $$ \mathcal{I}_{o b s}\left(\nu_0\right)=\int_{\gamma_i} \frac{(A(r))^{3 / 2}}{r^2} \sqrt{\frac{1}{A(r)}+r^2\left(\frac{d \varphi}{d r}\right)^2} d r ...
Soliton-104's user avatar
4 votes
1 answer
316 views

Animation of a spring pendulum

I would like to animate a spring pendulum. Below is my piece of code. The Lagrangian and equations are correct, in which I am sure, but the animation looks terrible and non-realistic. Could someone ...
Denis D. Bavrin's user avatar
1 vote
2 answers
141 views

Making the timestep of Euler method integration a variable

I am fairly new to Mathematica, and I've been trying to implement the Euler method of integration for a fluid velocity field. I can't work out how to make the timestep a variable of my Euler method ...
Feneb's user avatar
  • 13
3 votes
4 answers
167 views

NDSolve over derivatives of Heaviside function

I am trying to numerically solve for the strain of a Maxwell material in response to a step stress. The governing equations are $$\dot{\sigma} + \sigma = \dot{\varepsilon}$$ and I want to find $\...
JamesVR's user avatar
  • 335
13 votes
1 answer
299 views

Lens on a map. Realistic imitation of magnifying glass on images with text and other small features

UPDATE: Code from this post was used for video generation here: Cinematically moving a lens over images: magnifying glass effect in videos I am trying to create a magnifying glass effect for images ...
Vitaliy Kaurov's user avatar
0 votes
1 answer
88 views

Speed Up Plotting of Mathieu Equations

I am trying to plot Mathieu Functions, running for an hour without a result. Here is my code: First define the relevant physical constant: ...
ZHENGYAO HUANG's user avatar
0 votes
0 answers
79 views

Metric pertubation in xAct

I start to learn xAct. Following this thread: expanding-the-riemann-tensor-perturbation I noticed that xAct set a default perturbation to the metric by: ...
Dr. phy's user avatar
  • 213
0 votes
0 answers
133 views

Simplifying the Einstein tensor in case of a perturbed FRW metric

I use the code in this thread's answer: (Calculating Einstein tensor components in Kaluza-Klein model) to get the Einstein tensor components of a four-dimensional Kaluza Klein model. But instead of ...
Dr. phy's user avatar
  • 213
3 votes
1 answer
136 views

Creating a plot for a summation function

I have this potential function which I believe is representative of a grounded cube in a 3D plane. I'm not entirely sure if this is it, but here is the general solution of the function: v(x,y,z) = G(...
Carson Joseph's user avatar
0 votes
1 answer
88 views

Tracking сode performance with the conservation of energy

I am working with the Momentum Principle as defined by Chabay and Sherweood in their text Matter and Interactions (pf = pi+Fnet dt). The following code has been created to automate the process of ...
JEM's user avatar
  • 1,165
1 vote
1 answer
138 views

Calculating Einstein tensor components in Kaluza-Klein model

I try to calculate the Einstein tensor of Kaluza-Klein model from this paper. It is given by Equation (55) $ G_{\alpha\beta} = \frac{\nabla_\beta (\partial_\alpha \phi)}{\phi} - \frac{1}{2\phi^2} \...
Dr. phy's user avatar
  • 213
0 votes
1 answer
67 views

Evaluate the time average of Mathieu functions

I defined a function composed of Mathieu's periodic functions: ...
ZHENGYAO HUANG's user avatar
1 vote
0 answers
127 views

Modelling projectile with lift and drag forces

I am trying to model a projectile motion with lift and drag forces. I have written the code below, solved for $y$ and $x$, and tried to plot it. However, I don't know how to implement the fact that ...
dutchrunner's user avatar
0 votes
1 answer
46 views

About using series function

I am using Series function on (1/z)(-k^2)^z. Up to z^0, the function gives me 1/z + Log[-k^2]. But in the standard textbook on QFT, it turns out the expansion should give 1/z + Log[k^2/mu^2] -i*pi up ...
NovoGrav's user avatar
0 votes
0 answers
57 views

How can I use Gaussian elimination for finding QNMs in this code?

I am reading the article Scalar-gravitational perturbations and quasinormal modes in the five dimensional Schwarzschild black hole. I want to reproduce the value of the quasinormal frequency with $l=2,...
amon xu's user avatar
  • 31
2 votes
0 answers
413 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
  • 4,741
3 votes
0 answers
180 views

Visualizing General Relativity Using Mathematica

There is an old layman method of visualizing General Relativity in which you assume the massive body to be placed on the top of large space-time fabric and the bending describes the effects of gravity,...
codebpr's user avatar
  • 899
1 vote
3 answers
271 views

Solving Geodesics from Christoffel Symbols

I am somewhat new to using Mathematica and I am facing difficulties with a specific problem related to the geodesics of Einstein's field equation in a vacuum. The metric I am working with is derived ...
HMZ's user avatar
  • 11
1 vote
0 answers
25 views

Finding the coefficients of a decomposition of complicated expression into products of special functions

I have the following expression which arises while studying minimal models in CFT. The 4-point amplitude of scalars is given by $$G(z,\overline{z}) = ((1-z)(1-\overline{z}))^{\frac{m-1}{m+1}}\mathcal{...
QFTheorist's user avatar
3 votes
1 answer
160 views

Thermodynamics of the 2D Ising model

I want to study the thermodynamics of the 2D Nearest Neighbour Ising model (calculate the average energy, susceptibility, etc.). I have the Hamiltonian $$\mathcal{H} = J\sum_{\langle i j \rangle} s_i ...
QFTheorist's user avatar
2 votes
2 answers
166 views

How to numerically solve symmetric top with fixed point motion equations with Mathematica?

I am trying to numerically solve the equations associated with the motion of a symmetric top with a fixed point. Details about this system can be found in Goldstein's Classical Mechanics book (3rd ...
Meclassic's user avatar
  • 953
1 vote
1 answer
88 views

Plot wavefronts of Laguerre-Gaussian modes

I am trying to plot wavefronts of Laguerre-Gaussian modes, and want to show the changing number of twists with the change in l values. If anyone has the code or any insights. Kindly help me about it. ...
Qubit's user avatar
  • 23
1 vote
0 answers
48 views

Stiffness problem which abruptly stops the evaluation

We have a Lagrangian and we found the EOM. We need to solve the EOM and find the Phase-space plot. However, we are facing a stiffness problem which abruptly stops the evaluation (...
user84456's user avatar
  • 1,554
14 votes
1 answer
1k views

Visualizing gravity warping the fabric of spacetime

What is a stable way of creating a set of points that are attracted to a single moving point? I have tried the following: ...
martin's user avatar
  • 8,172
4 votes
1 answer
335 views

What are some Mathematica packages used for general relativity?

Could you suggest any Mathematica packages that are used for General relativity calculations? Id like to write code to solve the Schwarzchild Lagrangian equation.
Rishabh sharma's user avatar
2 votes
1 answer
216 views

Solving Schrödinger equation for Dirac comb potential (kicked rotor)

I need to solve the Schrödinger equation for a Dirac delta potential. I could not find the correct way to write the time-dependent potential and how to solve the time-dependent equation for it. The ...
user84456's user avatar
  • 1,554
1 vote
1 answer
82 views

Proving an expression from Mathematica which is clearly visible from Plots

I have the following Mathematica code: ...
codebpr's user avatar
  • 899
1 vote
1 answer
91 views

Vector 3d Plotting with New Mathematica Version

Hi Used to use the old version of Mathematica back in 2020. Now the new version is updated and I am trying to run the old code in the new version. My vector plots are very different. I wonder what I ...
physicsu83's user avatar
5 votes
1 answer
183 views

Numerically finding a curve that satisfies an underdetermined set of equations

I am trying to determine a phase diagram along the lines of Fig 3. or Fig 4. of this pubilcation. The curves plotted are binodals and are determined by the conditions of equality of chemical ...
jcp's user avatar
  • 357
0 votes
1 answer
103 views

Calculate the 1st Brillouin zone with given lattice basis vectors

Given two basis vectors in the 2-dimensional momentum space b1, b2, I want to write a function that returns the 1st Brillouin zone: ...
Zhengyuan Yue's user avatar
2 votes
1 answer
91 views

Eigenfunction condition of time-independent Schrödinger equation

I'm trying to get the eigenfunctions and eigenvalues of the following one-dimensional Schrodinger equation: $$ -\frac{1}{2}\frac{d^2}{dx^2}\psi(x)+V(x)\psi(x)=E\psi(x)\,,$$ where the external ...
Crazydemon92's user avatar
-3 votes
1 answer
109 views

Pade' approximation [closed]

Do you know how to enter this equation in Mathematica? It is Pade approximation, Values of p(2,..,7) are also given. Is it just simply writing this in Mathematica? or should I do something else?
lia's user avatar
  • 145

1
2 3 4 5
19