Questions tagged [physics]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
50 views

Mathematica VectorPlot no longer displays the plot it used to, despite the code being exactly the same? [closed]

I'm trying to plot the electric field of source charges. I was working on this the other day, and the plots I had were working just as I had intended. After continuing work today, I realized that ...
3 votes
1 answer
164 views

Solving 3D Nonlinear Integral Partial Differential Equation

I am trying to solve Equation number (1.2) numerically in MATHEMATICA. This equation is solved in the papers https://arxiv.org/pdf/2205.05193.pdf, https://arxiv.org/pdf/2202.13264.pdf, and https://...
1 vote
1 answer
67 views

How can I expand this code to track two particles instead of one?

I'm attempting to track the position of two particles by recording a .tiff file of their visual movement under a microscope. I use Mathematica to Binarize with a high enough threshold so that only ...
  • 11
2 votes
1 answer
102 views

Unable to solve the given equation

I am trying to solve the given system in terms of $r$, for which I use the following code: ...
  • 585
0 votes
0 answers
50 views

Finding values of constants for which 1st and 2nd order derivatives of a function vanish

I'm trying to find critical values of some constants $v_c$ and $T_c$, for which holds the equality below: $$\bigg(\frac{\partial P}{\partial v}\bigg)\biggr\rvert_{v=v_c,\; T=T_c}=0,\quad \bigg(\frac{\...
  • 27
1 vote
1 answer
61 views

Plot The Magnetization

I have a problem with plotting a function M(T). The matrix is the following: ...
  • 31
1 vote
0 answers
62 views

Real-time interactive simulation

I would like to know how to use mathematica to make a real-time physics simulation that can be interacted with using a cursor. As an example, consider a classical magnetic dipole in a background field,...
  • 1,600
0 votes
0 answers
52 views

Problems with plotting NIntegrate and speeding up NIntegrate

I'm trying to plot a function $E_{01}(p)=0.5^{2}(-8+6p)+\frac{1}{N}\displaystyle\sum_{\mathbf{k}}(\sqrt{A_{\mathbf{k}}^{2}-B_{\mathbf{k}}^{2}}-A_{\mathbf{k}})$ where $A_{\mathbf{k}}=0.5(8-6p(1-\frac{1}...
  • 101
1 vote
0 answers
57 views

Error message installing Ricci

I just started using Mathematica. With the goal of solving a Loop integrals over a scalar gravity interaction. For the tensor calculus necessary i wanted to use, Ricci. https://sites.math.washington....
3 votes
1 answer
78 views

How can one find the corresponding black body temperature, when trying to fit the integrated planck function (energy flux) to a value

Given a certain numerical value for the energy density flux $F$ of a star, e.g. the solar constant $s_\odot = 1362~\frac{W}{m^2}$, and a certain wavelength range corresponding to the irradiated energy ...
6 votes
1 answer
117 views

Graph Convolution Network, molecule activity

I am trying to translate an example code for graph convolution network from Deep Learning for Physical Scientists: Accelerating Research with Machine Learning. Edward O. Pyzer-Knapp et. al. They have ...
  • 613
4 votes
2 answers
432 views

2D Projection of a 3D plot on the three walls using three different colours

I was plotting Lorenz Attractor in 3D. Now, I wanted to take three projections of it on three different planes(XY, YZ, ZX) with four different colours. I mean I want my 3D attractor in one colour and ...
  • 664
0 votes
0 answers
32 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^-$ ...
0 votes
1 answer
93 views

Package-X has been terminated. FeynCalc and FeynHelpers not working

I want to compute the finite parts of 1-loop integrals using FeynCalc. One of the most important package used for this is FeynHelpers (which in it uses Package-X). But, since July 1, 2022, Package-X ...
  • 35
4 votes
1 answer
139 views

How to simulate hysteresis loop for a ferrimagnetic material

I am trying to modify a ferromagnetic hysteresis loop to ferrimagnetic hysteresis loop. Below is the equation I used for ferromagnetic simulation : Below is the code for above equation: ...
0 votes
1 answer
59 views

How to Plot a graph with respect to time [closed]

I am new to wolfram Mathematica. Can someone please assist by showing me how I can plot “d” shown in The screenshot with respect to time, graphically?
0 votes
0 answers
43 views

Feynman Two Loop Integrals

Is there any reference suitable for a beginner that you recommend for learning two loop integrals evaluation by hand ( and/or some package) that you know of? Thank you very much.
2 votes
1 answer
113 views

Solving 2D Coupled Nonlinear SO Coupled Equation

I am trying to solve coupled nonlinear SO coupled equations in 2D from the following two papers https://arxiv.org/pdf/2105.08849.pdf and https://arxiv.org/pdf/2109.00491.pdf. They have given an input ...
-4 votes
1 answer
76 views

Constructing NxN tridiagonal block diagonal matrix with N is a variable [closed]

Hi please can someone help me writing a program of generating a tridiagonal block matrix with dimension of NxN where N is a variable can be 50, 100, 200, 300...etc , Well I don't know how I'm a ...
  • 31
2 votes
1 answer
76 views

Lyapunov exponents at a fixed point

I am trying to find the Lyapunov exponents at a fixed point as given in the paper here(page 14). The code that I have used till now is given below: ...
  • 585
3 votes
1 answer
106 views

Calculating power series of quantum operators on kets

I am using the "Quantum" add-on package to perform some quantum mechanical calculations using SU(1,1) generators. The code that I've developed reads ...
  • 727
2 votes
1 answer
89 views

Solving logarithmic 2D Nonlinear GPE Equation

I am trying to solve the logarithmic 2D Nonlinear GPE Equation from this paper https://arxiv.org/pdf/1801.10274.pdf. But failed to get the ground state solution and vortices. I tried to solve in ...
5 votes
1 answer
205 views

Monte Carlo Simulation of Charged Particles in Non-Uniform Electric Field

I have a code (provided below) which simulates the motion of an ensemble of charged particles which are subjected to a complex static electric field which passes through some aperture in a metallic ...
  • 363
0 votes
1 answer
178 views

Sticky Collisions (perfectly inelastic)

There is an awesome simulation https://mathematica.stackexchange.com/a/124926/87086 which shows N particles bouncing in a box (with elastic collisions), made by @Feyre https://mathematica....
  • 363
1 vote
1 answer
50 views

Fitting a sum of three lorentzian based on a dataset

as you can see below, I have developed a code that allows me to fit the present dataset via a Lorentzian. Now what I should do is to develop a sum of three Lorentzians based on this model so that this ...
8 votes
1 answer
395 views

Fourth order, nonlinear PDE depicting dynamics of liquid lenses

PROBLEM STATEMENT Recently, I was trying to verify the solution of a set of thin film spreading equations given by this paper. Where $$p1=-(h_{1xx}+\sigma h_{2xx})$$ $$p2=-\sigma h_{2xx}-\Pi[h2-h1]$$ ...
  • 173
3 votes
1 answer
64 views

Using WhenEvent to stop N objects at a boundary

I am attempting to implement an event into my simulation which makes any moving particle in an electric field completely stop at the instant they pass some specified threshold. I was trying to utilize ...
  • 363
1 vote
1 answer
152 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 ...
  • 363
0 votes
1 answer
54 views

3D Parametric Plotting for N Charged Particles in a Nonuniform Electric Field

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 ...
  • 363
1 vote
0 answers
63 views

NDSolve does not go past initialisation stage when attempting to solve for Fluid System

BACKGROUND INFO Following my attempt to solve a fluid system here (I am very much indebted to xzczd for his gracious help), I realised that a few of my equations are physically incorrect since they ...
  • 173
1 vote
0 answers
72 views

Simulating the Response of Charged Particles to Apertures with Inhomogeneous Electric Fields Passing through them

I have produced a simulation which allows me to observe a static electric field produced by a charged plate as it passes through some complex apertures in a different, oppositely charged metal plate. ...
  • 363
5 votes
1 answer
250 views

Error in Attempting Moving Boundary Fluid System

Recently I was attempting to solve a moving boundary fluid system on mathematica, which I have managed to convert into a coupled PDE-ODE system based on this helpful reference over here. The equations ...
  • 173
0 votes
0 answers
56 views

Implementing a 10-dimensional metric using diffgeo

I am trying to implement a 10-dimensional metric, namely a solution of type IIB supergravity equations of motion, using diffgeo by Matthew Headrick. Physics The metric is $$ds_{10}^2=\sqrt{\frac{...
1 vote
1 answer
112 views

How to create a matrix with multiple variables defining the elements?

I am a learner start using Mathematica to study quantum mechanics. In many cases, I am try to construct matrix with functions like this: For example, let f be a function taking 4 variables x1,x2,x3,x4,...
8 votes
1 answer
410 views

Droplet of water-alcohol mixture spreading due to evaporation-caused surface tension gradient

I am trying to solve a coupled system of PDEs for 2 functions h[t,r] and c[t,r], with initial conditions of ...
4 votes
0 answers
102 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 ...
1 vote
0 answers
70 views

FunctionInterpolation with some datapoints to start with [closed]

Motivation: I am using FunctionInterpolation[COMSOL[x]] in combination with COMSOL to search for the interpolation of my COMSOL model. COMSOL needs a lot of time to ...
3 votes
1 answer
125 views

Error in Metropolis-Hastings with three states?

I wanted to create a simple example of the Metropolis-Hastings algorithm as a sanity check but the check failed and the results do not line up. I have a vector of energies $\vec E=(E_1,E_2,E_3)$ and ...
3 votes
1 answer
179 views

Convergence plot of Lyapunov exponents

I am trying to reproduce the convergence plot of the four Lyapunov exponents for a string from this paper (page 12, figure 7). The code that I have used till now to find the equations is given below: <...
  • 585
1 vote
2 answers
90 views

Using Loop to find a specific Energy

I am given a Hamiltonian: ...
  • 585
1 vote
1 answer
77 views

Finding Hamiltonian from a perturbative Action

I am given a perturbative action $$\frac{S}{\mathcal{T}}=\int dt\sum _{n=0,1} (\dot{c_n}{}^2-c_n^2 \omega _n^2)+7.11 c_0^3+35.3 c_0 c_1^2+4.66 c_0 \dot{c_0}{}^2+1.32 c_0 \dot{c_1}{}^2-7.57 \dot{c_0} ...
  • 585
6 votes
3 answers
328 views

Neglecting higher order terms in a Lagrangian

I have a lagrangian which is modified by variable change. I want to neglect all the 4th order and higher terms in the new lagrangian. The code being used is given below: ...
  • 585
0 votes
0 answers
69 views

Variation with respect to inverse metric in a Lagrangian density

I am trying to vary the following Lagrangian density with respect to the inverse metric appearing in the equation, but I am having trouble with how to write the right code in Mathematica. I have ...
  • 1
0 votes
1 answer
88 views

create an animation of a string

I'm trying to create an animation of motion of a physical string, it should demonstrate a "jumping rope", but I don't know what function to use, I've tried parametric plot and vector plot. I ...
  • 5
10 votes
2 answers
241 views

Methods of Numerically Finding Function Minimizing Functional

Say we have some functional like the following: $H = (\partial_yf(y))^2 -w(y) f(y)^2 +f(y)^4/2$. This is the functional for the Gross Pitaevskii equation. Lets say $w(y)$, the trapping potential in ...
  • 197
0 votes
0 answers
60 views

Error Integrate::ilim: Invalid integration variable or limit(s) in {0.1,0,1}. please help

I am making the code you can see below. I believe the error is that when I plug in values for x it also feeds back to the "dx" in the integration, how can I go around that? ...
5 votes
1 answer
291 views

Poincaré Section from action

I am given a perturbative action $$\frac{S}{\mathcal{T}}=\int dt\sum _{n=0,1} (\dot{c_n}{}^2-c_n^2 \omega _n^2)+7.11 c_0^3+35.3 c_0 c_1^2+4.66 c_0 \dot{c_0}{}^2+1.32 c_0 \dot{c_1}{}^2-7.57 \dot{c_0} ...
  • 585
1 vote
0 answers
53 views

Gaussian 16 fchk and log file import in mathematica

I am working with Gaussian log files and fchk files imported into Mathematica and I noticed a few things. The ExampleData in documentation for these files use Gaussian 03 output files, while the ...
  • 613
14 votes
2 answers
233 views

Stretching a mesh

Imagine I want to stretch a mesh with a 'rubberband-type' effect. That is, upon and elastic stretch from both side edges, the mesh centres simply scale as follows where the points are seeds for ...
  • 4,388
4 votes
1 answer
171 views

Why do expressions with physical units not get simplified?

I am trying to calculate precise values for certain expressions, see the image below. The output testZPF of the function $\Delta$Fn should be a single output. I am ...

1
2 3 4 5
17