Stack Exchange Network

Stack Exchange network consists of 175 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.

59
votes
2answers
7k views

Measuring fractal dimension of natural objects from digital images

This is a useful topic. A college physics lab, medical diagnostics, urban growth, etc. - there is a lot of applications. On this site by Paul Bourke about Google Earth fractals we can get a high ...
48
votes
8answers
9k views

Circuit drawing in Mathematica

This past semester I taught an introductory electromagnetism course and had quite a nice time using Mathematica to draw all sorts of figures and diagrams (mostly for problems and etc.). However, I was ...
47
votes
6answers
4k views

ColorData[“VisibleSpectrum”] is wrong?

Bug introduced in 10.0 or earlier and fixed in 11.1 I am trying to visualize the visible spectrum using the built-in ColorData["VisibleSpectrum"] function which "...
45
votes
5answers
19k views

Find eigen energies of time-independent Schrödinger equation

I'm trying to get the eigenvalues of a one dimensional time-independent Schrödinger equation, $-\frac{h^2}{2m_0}\frac{d^2\psi}{dx^2}+U(x)~\psi=Ei~\psi$ where U(x) is some potential and Ei is the ...
44
votes
4answers
12k views

Is there something like DensityPlot3D to visualize atomic orbitals?

I'm visualizing some hydrogen like atomic orbitals. For looking at plane slices of the probability density, the DensityPlot function works well, and with something ...
41
votes
2answers
8k views

The correct way to linearize colorspace before resizing, blurring etc

There was an interesting discussion on MathGroup dealing with the fact that image-processing functions in Mathematica (and many other software, including Adobe Photoshop) work with RGB, Grayscale etc. ...
36
votes
2answers
3k views

The Orbit and Perigee of the Flamsteed comet

Historical context This year we have the 330-th anniversary of the Battle of Vienna - one of the great formative events of European history, it took place on September 12, 1683. Kara Mustafa, Grand ...
33
votes
4answers
3k views

Dynamic Euler–Bernoulli beam equation

I am trying to solve for the vibration of a Euler–Bernoulli beam. The equation is $\frac{\partial ^2u(t,x)}{\partial t^2}+\frac{\partial ^4u(t,x)}{\partial x^4}=0$ For the boundary conditions I ...
33
votes
4answers
7k views

Animation of double pendulum

Sadly, I am a completely newbie. I am studying Physics and in our theoretical physics class we got the task to solve the double pendulum using Mathematica. We just got the program, but no introduction ...
33
votes
3answers
2k views

A better “VisibleSpectrum” function?

Since ColorData["VisibleSpectrum"] is wrong, I would like to have a more accurate function to use. Can this information be extracted from Mathematica itself?
32
votes
3answers
5k views

Remove noise from data

Hi, as you can see above I have some experimental data which has a large offset and shows clear noise fluctations around the tendency of the curve. I wanted to ask if someone could suggest me a method ...
29
votes
3answers
5k views

How to plot an emission spectrum?

If I have a list of data with various wavelengths in nanometers, how would I plot them on a graph so it looks like this: So far I have managed to plot a spectrum in ...
27
votes
2answers
1k views

Animating wave motion in water

Further to this question I found on MSE, I tried to replicate from here this is as far as I got: ...
26
votes
3answers
3k views

1D Euler equations (fluid dynamics) with NDSolve

Is it possible to accurately solve the 1D Euler equations in Mathematica using NDSolve? For example, let us consider the Sod shock tube problem. Introduction to ...
26
votes
1answer
3k views

How to numerically solve a 1-d time-independent Schrödinger equation?

The point is to solve the eigensystem of the given Hamiltonian. I tried ParametricNDSolve combined with FindRoot to search for ...
24
votes
4answers
11k views

Convert spectral distribution to RGB color

Presume that I have a spectrum as a function of wavelength (an example being the blackbody spectrum): I want to convert that to a single RGB color to display on-screen, i.e. the "color" of that ...
24
votes
4answers
1k views

Create an adaptive amount of local variables for error propagation

I intend to write a function which calculates the result and the error for any formula with any amount of variables using the Gauß Error Propagation. The error $\mathrm{d}R$ for a function $A(a,b,c)$ ...
24
votes
1answer
682 views

How to model wooden joints with mathematica's FEM?

This is a dovetail joint: and I'd like to see the stresses and deformation on the joint.I haven't seen any modeling of disconnected regions with FEM, only connected regions, so I'm curious if you can ...
22
votes
5answers
12k views

How do I plot a plane EM wave?

I would like to display an electromagnetic (EM) wave. I have written code that works, but it does not "shade" the area between the graph and the axes. Both the ...
20
votes
1answer
4k views

Solving Killing equations

Is it possible to solve Killing equations in Mathematica for a general vector? I am looking for a way to create Killing equations and then find what the vectors are, but I have a problem with this. ...
19
votes
2answers
938 views

Fractal basins of attraction in a Magnetic Pendulum

I am trying to write a Mathematica program that realizes a graphical approximation of the basins of attraction in a Magnetic pendulum subject to friction and gravity, in which the three magnets are ...
18
votes
3answers
1k views

How can I simulate this toggle mechanism?

I've been introduced to Mathematica very recently. Basically, I haven't actually "solved" anything in my Mathematica lifetime, but I've done some simulations. With my fractional knowledge, I tried ...
18
votes
1answer
1k views

How best to simulate n-body systems in a functional way?

I want to simulate a N-body system in the most functional way possible. The system I'm modeling are metallic colloidal particles in a solution of peroxide water, as here http://arxiv.org/pdf/1502....
17
votes
1answer
765 views

Couple a PDE and ODE in NDSolve

I would like to solve an example of non-stationary heat transfer with a coupled PDE and ODE. Let's assume that we have 1 dimensional bar of length $L$ with uniform initial temperature. The right end ...
16
votes
2answers
668 views

Heat convection differential equations from 1952 - Mathematica “fails to converge”

I am trying to solve a fundamental problem in analytical convective heat transfer: laminar free convection flow and heat transfer from a flat plate parallel to the direction of the generating body ...
15
votes
3answers
646 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 ...
15
votes
2answers
1k views

Pull out scalars from NonCommutativeMultiply in commutator of SU2 spin algebra

I am trying to work on spin chains in Mathematica. That is, N spin-1/2 on a one-dimensional lattice with periodic boundary condition (N+1=1). I need therefore the SU2 spin algebra $S_z, S_+, S_-$ with ...
15
votes
1answer
1k views

How to solve the tsunami model and animate the shallow water wave?

Backslide introduced in 9.0, persisting through 11.3. Recently when I was learning differential equations, I noticed there is a shallow water wave equation to model the tsunami propagation. How to ...
14
votes
2answers
2k views

Turing patterns

I am new in learning Turing patterns. Is there any sample code available to generate such patterns in ecology model (Lotka–Volterra model)? The above figure is taken from this paper, and is based on ...
14
votes
3answers
2k views

Constructing a symbolic Hermitian matrix

I need to construct a symbolic Hermitian matrix like m = { { n, a, b, b}, {Conjugate[a], n, b, b}, ... } but I am not able to set ...
14
votes
3answers
2k views

How to manipulate gauge theory in Mathematica?

I want to know if there is a way of typing into Mathematica an expression like the following, $$\epsilon^{\mu \nu \lambda} f^{abc} A^a_\mu A^b_\nu A^c_\lambda + g\epsilon^{\mu \nu \lambda} A^a_\mu \...
14
votes
2answers
1k views

How to calculate position from 3 dimensional acceleration data?

I discussed this problem yesterday with Pickett here. We concluded that the best solution may be just Interpolate and then ...
14
votes
2answers
3k views

Boson commutation relations

I have tried to adapt this answer to my problem of calculating some bosonic commutation relations, but there are still some issues. The way I'm implementing the commutator is straightforward: ...
14
votes
1answer
345 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, ...
14
votes
1answer
1k views

Frequency domain Maxwell equations with PML boundary conditions

I'm trying to solve a full-vectorial wave equation for an arbitrarily shaped wave guide, by using NDSolve and perfectly matched layer (PML) conditions. The PML ...
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 ...
13
votes
3answers
868 views

Time evolution/dynamics of circular plate with hole (Biharmonic equation and stiffness)

On this Mathematica.SE form, there exists information on how to use Mathematica to demonstrate the vibration of a circular membrane and the deflection of an orifice plate (the latter I had raised ...
13
votes
3answers
568 views

Mimic a procedural, recursive clustering algorithm for site percolation using functional programming

Sorry in advance for my logorrhea: I just want to make sure all of the information is here. Context and Question I am investigating site percolation on a square lattice. I have a working, depth-...
13
votes
1answer
369 views

Compute the curvature of a bent stack of paper

My goal is to link the curvature of a bent stack of paper in a wind tunnel to its bending modulus $B$, knowing all the other physical properties. To this end, I would like to reproduce the numerical ...
12
votes
6answers
674 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 ...
12
votes
2answers
795 views

Solving “Resistance between two nodes on a grid” problem in Mathematica

In the context of resistor networks and finding the (equivalent) resistance between two arbitrary nodes, I am trying to learn how to write a generic approach in Mathematica, generic as in an approach ...
12
votes
2answers
1k views

Boundary condition with spatial derivative is ignored by NDSolve

Consider the following differential equation: $$\begin{align*}&\rho C_p\left(\frac{\partial T}{\partial t}\right)=k\left[\frac{\partial^2 T}{\partial x^2}\right]+\dot{q}\\ &\text{at }x=0,\;\...
12
votes
3answers
744 views

Using NDSolve to find particle trajectory

I'm trying to simulate a particle in an electric and magnetic fields, but numerically instead of analytically. This is basically solving the equation $$q \cdot \left(p'\times B\right) + q\cdot E = m ...
12
votes
3answers
475 views

NDSolve's output ignores multiple valid solutions

I'm looking for solutions to a boundary problem involving a non-linear Hamiltonian $$ H(q,p) = \frac{1}{4}\left(q^{2}+p^{2}\right)^{2}, $$ whose solutions are oscillatory but have a complex time ...
12
votes
4answers
6k views

How to create an inverse pole figure color map?

To interpret electron backscatter diffraction (EBSD) results, inverse pole figures are used. A three dimensional space of directions ([100], [110] and [111] for those who know about crystallography) ...
12
votes
3answers
1k views

1D quasicrystal: points on a line nearest to points on a lattice

I have a simple lattice / line manipulation: ...
12
votes
2answers
433 views

Sampling a phase space uniformly for a given energy?

The energy for a 1D harmonic oscillator can be written: $$ E = \frac{1}{2 m} p^2 + \frac{m \omega^2}{2} x^2 $$ where x is position and p is the momentum. I would like to sample phase space $(x,p)$ ...
12
votes
1answer
589 views

Synchrotron Radiation and ListDensityPlot

I'm trying to reproduce the following plots: As described by this blog entry: Synchrotron radiation As you can see in the linked article, the task is essentially to make a ...
11
votes
1answer
2k views

Schrödinger eigenvalue problem in two dimensions (Harmonic Oscillator)

I read here the discussion about how to solve a one-dimensional eigenvalue problem. I am wondering, how can one generalize these methods to two dimensions? For example, how to solve this equation: $$...
11
votes
2answers
868 views

Two bouncing balls in 1 dimension, issues with two different methods?

I'm trying to simulate 2 balls with the same mass and diameter bouncing one on top of another under gravity, see the illustration below (not ideal, but this is the best result I've got so far, the ...