Questions tagged [physics]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
52 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. ...
user avatar
  • 23
5 votes
1 answer
182 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 ...
user avatar
  • 53
0 votes
0 answers
50 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{...
user avatar
1 vote
1 answer
75 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,...
user avatar
8 votes
1 answer
350 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 ...
user avatar
4 votes
0 answers
100 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 ...
user avatar
1 vote
0 answers
66 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 ...
user avatar
3 votes
1 answer
117 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 ...
user avatar
2 votes
1 answer
137 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: <...
user avatar
  • 181
1 vote
2 answers
84 views

Using Loop to find a specific Energy

I am given a Hamiltonian: ...
user avatar
  • 181
1 vote
1 answer
67 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} ...
user avatar
  • 181
6 votes
3 answers
318 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: ...
user avatar
  • 181
0 votes
0 answers
56 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 ...
user avatar
  • 1
0 votes
1 answer
83 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 ...
user avatar
  • 5
9 votes
2 answers
207 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 ...
user avatar
  • 145
0 votes
0 answers
51 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? ...
user avatar
5 votes
1 answer
257 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} ...
user avatar
  • 181
1 vote
0 answers
42 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 ...
user avatar
  • 535
14 votes
2 answers
225 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 ...
user avatar
  • 4,228
4 votes
1 answer
170 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 ...
user avatar
0 votes
1 answer
80 views

Mathematica: Partial derivative with respect to tensors

Anyone know how to do the partial derivative of a tensor in d dimensions on Mathematica ? I want to implement something which will calculate directly like that :
user avatar
1 vote
1 answer
87 views

Set of three self-consistent coupled 'gap' equations

For a function of the kind of 5 variables, where this function must satisfy the following self-consistent coupled 'gap' equations. I want to reproduce the graphics in the paper "Phases of QCD: ...
user avatar
1 vote
0 answers
53 views

How to plot dielectric susceptibility and scattering intensity for thin film superconductor?

I would like to plot the spatially varying (along the z-axis) dielectric susceptibility $\chi(z)$ of a thin film ($La_2CuO_4$) on top of a substrate ($SrTiO_3$) and the resultant scattering intensity ...
user avatar
  • 31
0 votes
0 answers
68 views

Gay-Berne potential in Mathematica

Cross-posting from Physics SE. I am trying to make a plot of the Gay-Berne potential using Mathematica. I am following this paper and I am trying to recreate Fig. 2. This is figure 2: To save time, ...
user avatar
  • 101
1 vote
2 answers
323 views

How do I get the Schwarzschild solution from the Einstein Equations?

Consider the Schwartzchild-like metric $$ds^2=-A(r)dt^2+B(r)dr^2+r^2(d\theta^2+\sin^2\theta d\phi^2).$$ The Einstein field equations for this metric reduce to $$R_{\mu\nu}=0,$$ which is also known as ...
user avatar
  • 119
2 votes
2 answers
146 views

Plot continuous field lines of bar magnet B field using StreamPlot

I want to plot the field lines of the B field of a bar magnet. The problem is that they have a very sharp bend when entering the magnet and Mathematica stops tracing the field lines. Here is how I ...
user avatar
  • 165
5 votes
1 answer
162 views

How to impose Neumann boundary conditions describing quantum Hall effect?

I am trying to solve the following differential equation : $$ \nabla\cdot\left(\begin{pmatrix} c_1 & c_2 \\ -c_2 & c_1 \end{pmatrix}\nabla\phi\right) = 0 $$ on a rectangular domain [1,0]x[0,1] ...
user avatar
  • 345
1 vote
2 answers
47 views

need dimension of solution space of system of non-linear complex equations

I've been trying to do this in Mathematica for several days but I'm getting almost nowhere. I need to know the dimension of the solution space of each of the two systems of nonlinear complex equations ...
user avatar
  • 11
2 votes
1 answer
51 views

What does the command '$FAVerbose = 0' do in FeynCalc

I have seen this right below the "<<FeynCalc`" command that loads FeynCalc. $LoadAddOns={"FeynArts"}; <<FeynCalc; ...
user avatar
0 votes
0 answers
42 views

Refernce Solution Fails with NDSolve

I'm trying to crosscheck a solution of an ODE that is already implemented in Python. In Python I'm using a Newton iteration together with periodic boundary conditions to solve my ODE. In order to get ...
user avatar
  • 133
4 votes
0 answers
222 views

Finding Coefficients in a Perturbation Problem related to Chaotic Dynamics

I am trying to reproduce the results from this paper: Chaotic dynamics of a suspended string in a gravitational background with magnetic field I am currently stuck with finding the coefficients. First ...
user avatar
  • 181
1 vote
1 answer
94 views

Exponential fit precision lost

I have a data: ...
user avatar
4 votes
1 answer
156 views

Plotting a field inside of a shape

I want to plot a field of vectors revolving on the inside of a torus in the positive x-direction. I don't know how to constrain the field on Mathematica. What would be the most efficient way to do ...
user avatar
0 votes
2 answers
83 views

A problem when solving an equation with symbolic variables

I asked a question a couple days ago and received a solution that worked for me at the time. But now I am seeing that the proposed solution fails for some other cases I need. For example, if I just ...
user avatar
  • 207
2 votes
1 answer
218 views

Solving equations with symbolic variables

I have the equations ...
user avatar
  • 207
0 votes
0 answers
42 views

Extract quantum numbers from a string of second quantized operators within the SNEG library

I have been exploring the SNEG library. Suppose that after a series of computations I obtain the output: $$ c_{i,j}^\dagger c_{x,y}^\dagger. $$ How can the quantum numbers $\{i,j\}$ and $\{x,y\}$ be ...
user avatar
  • 101
2 votes
0 answers
192 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} +...
user avatar
  • 483
0 votes
1 answer
220 views

Solving Lagrangian with Mathematica [closed]

I'm pretty new to Mathmatica but I'm trying to use it to find a Lagrangian and then find the equation of motion from the Lagrangian. Think the method is correct but I just cant seem to get the syntax ...
user avatar
  • 17
2 votes
2 answers
175 views

Can the CopulaDistributions be fitted?

This is an immediate follow-up to DoAny--which I did consider editing, clarifying and correcting in some respects. But perhaps here I can put the immediate question at hand more directly (the emphasis ...
user avatar
0 votes
1 answer
50 views

List of eigenvalues of a list of abstract states

Suppose I have the states \Psi, \Phi and \Zeta and I also have the following relations given ...
user avatar
  • 207
1 vote
3 answers
240 views

Do any of the Mathematica CopulaDistributions (or others) fit well this sampled bivariate copula with uniform marginals over [0,1]?

I'm currently developing a data set that consists of two $50 \times 50$ matrices, which I designate as q1 and Q1. I strongly believe (bordering on formal proof [cf. Corollary 1 in marginalinvariance]) ...
user avatar
0 votes
1 answer
72 views

what is wrong with my code? it gives an empty graph [closed]

this is my code: and it gives me an empty graph? ...
user avatar
  • 11
6 votes
1 answer
262 views

NDSolve solutions for modeling convection-coupled melting

I am trying to solve the convection-coupled melting benchmark in MMA 12.3 as presented in FEniCS/03-ConvectionCoupledMelting-MixedElement-AMR.ipynb. This model in MMA is based on the solution from ...
user avatar
  • 1,746
6 votes
2 answers
304 views

Solving a Cauchy problem related to the pendulum

One end of a thread of length l = 1m is fixed, and a body of m = 1 kg is attached to the other end. The body is displaced counterclockwise by 30 degrees and then released. Plot the resulting Phi(t) ...
user avatar
  • 145
0 votes
1 answer
122 views

Can this previously solved three-dimensional constrained integration also be solved with certain added products in the integrand?

In Solved3DConstrainedIntegration the constrained three-dimensional (Hilbert-Schmidt-metric-based HSmetric) integration problem for the absolute separability probability of the two-qubit (quantum bit)...
user avatar
3 votes
3 answers
136 views

Do loop so that I do not get double terms?

I have a Do loop where I generate quantum state equations <111||111>,<111||112>...<232||232>. This is 144 equations in total but I want both bra and kets to be seen as the same so ...
user avatar
  • 33
0 votes
1 answer
89 views

NBodySimulation softening parameter

I'm simulating the orbit of a binary black hole immersed in some halo of particles and the simulation does not want to continue on for the specified amount of time. It always halts at a seemingly ...
user avatar
  • 463
0 votes
0 answers
121 views

How do i solve two coupled nonlinear PDEs through Mathematica?

these are two relativistic fluid governing equations, ∂_t (γe)+∂_x(γev)=0 γ∂_t(γv)+∂_x[(γv)^2/2]=-(C/(1+C))*∂_x[log(e)] where γ=1/sqrt(1-v^2) is Lorentz factor, <...
user avatar
4 votes
2 answers
395 views

NDSolve mathematica fluid mechanics

I have made Mathematica code for equation 16 from this paper. How can we make these streamlines I attached? I am using DensityPlot command but can't get it right ...
user avatar
  • 41
2 votes
1 answer
73 views

How to find the characteristic vibration frequencies of a system with any number of masses and springs using eigendecomposition?

I have created a program to solve any system of three springs and two masses using Mathematica's Eigendecomposition functions. My goal is to solve a generalization of the spring system presented in ...
user avatar

1
2 3 4 5
16