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

learn more… | top users | synonyms

47
votes
1answer
4k 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 ...
41
votes
6answers
3k views

ColorData[“VisibleSpectrum”] is wrong?

I am trying to visualize the visible spectrum using the built-in ColorData["VisibleSpectrum"] function which "colors based on light wavelength in nanometers". But I ...
40
votes
8answers
7k 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 ...
37
votes
4answers
4k 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 ...
37
votes
5answers
10k 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 ...
31
votes
3answers
1k 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?
30
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 ...
23
votes
3answers
1k 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 ...
22
votes
3answers
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 $R(a,b,c)$ ...
22
votes
2answers
3k 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 ...
22
votes
1answer
290 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 ...
21
votes
4answers
3k 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 ...
21
votes
2answers
1k 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 problem given here: http://www.csun.edu/~...
20
votes
1answer
675 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 ...
14
votes
3answers
923 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 ...
14
votes
3answers
1k 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
340 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
2answers
797 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 ...
13
votes
2answers
519 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 ...
13
votes
2answers
270 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 ...
12
votes
3answers
539 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
2answers
263 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 ...
12
votes
2answers
303 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)$ ...
11
votes
3answers
701 views

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

I have a simple lattice / line manipulation: ...
11
votes
2answers
263 views

Interfacing Red Pitaya board with Mathematica

[EDIT:July 1st 2016]. I finally did the job by myself and built a (JLink based and limited) redpitaya package that is enough to play with the examples showed on the redpitaya site. I presented it at: ...
10
votes
1answer
1k views

Drawing a graph with specified edge lengths

I was wondering if it was possible to ask Mathematica to draw a graph provided some set of vertices: $(v_1, ..., v_N) \in V$ connected by $M$ edges $(e_1, ..., e_M) \in E$, where the length of each ...
10
votes
1answer
157 views

Beam deformation due to localized force distribution

I would like to simulate the deformation of a beam which is fixed on one end and has some localized forces applied along the top. I have been inspired by this Mathematica example: http://www....
10
votes
0answers
180 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....
9
votes
1answer
1k 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: $$...
9
votes
3answers
299 views

Labeling solutions of an Eigenvalue equation involving Bessel functions

I'm solving the Schrödinger equation for a particle in an annular geometry with hard wall boundary conditions and I've reduced it to the following equation: $$J_m(k\,R_1)\,Y_m(k\,R_2) - J_m(k\,R_2)\,...
9
votes
3answers
694 views

Calculate inertia tensors

Moments of inertia and inertia tensors are well-known characteristics of rigid bodies in physics and applied mathematics. How to calculate them in Mathematica? Is possible to use regions which was ...
9
votes
3answers
2k 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) ...
9
votes
2answers
340 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: ...
9
votes
1answer
2k views

Interactive steam tables and phase diagrams in Mathematica

I teach an undergraduate course in Thermodynamics and I would love to use Mathematica to demonstrate the various engineering processes that involve the expansions and compressions of steam and common ...
9
votes
1answer
1k views

NDSolve::ndcf: Repeated convergence test failure. How to solve?

I am trying to simulate a system of $n$ pendulums with some friction in Mathematica 9. This is the code I am using: ...
8
votes
2answers
333 views

Lagrangian to Hamiltonian

I want to go from Lagrangian description to Hamiltonian one. Using the example given by Mathematica I do something like: ...
8
votes
3answers
737 views

Biot-Savart Law/Magnetostatics Solution

I am working on solving the Biot-Savart Law equation for the magnetic field around a charged ring of uniform current density. The expression that Mathematica gives is rather nasty, as expected. Notice ...
8
votes
2answers
986 views

Defining quantum-mechanical Bra and Ket operations

I have the following ket in the Fock basis: $\vert3, 0 ,1\rangle$, where each entry defines the number of photons in a particular mode and can take any one of the following numbers: 0, 1, 2, 3. As a ...
8
votes
3answers
1k 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 \...
8
votes
1answer
377 views

Diverging solution to coupled second order ODEs from NDSolve

For a physics application I am considering the radial Bogoliubov-de Gennes equations in two dimensions. In dimensionless form they read as follows $$ \begin{cases} \bigg[\frac{1/4-m^2}{r^2}+2(E-1)\...
8
votes
1answer
125 views

Calculating density of states from lists of momentum/energy data

I am trying to calculate the density of states for a 2D system given certain band structure data organized in a specific format. Below is an example of my procedure: Beginning with a simple 2 x 2 ...
8
votes
3answers
193 views

Substituting values in 3j symbols

I believe these three expressions should give the same answer of -1/Sqrt[3], but the first gives +1/Sqrt[3] whereas the second ...
8
votes
1answer
380 views

Mathematica Reference Book on Reliability Engineering?

Can anyone suggest a reference book titled “Reliability Engineering Using Mathematica” or similar that contains the version 9 or version 10 functionality ? Some topics/chapters I would be interested ...
8
votes
1answer
535 views

How to draw quantum circuit with mathematica?

How to draw quantum circuit as the following one with mathematica? I only find the quantum package which is designed for MMA 7.0 as the author said. But the version of my Mathematica is 9.0 and when ...
7
votes
2answers
421 views

Plotting 2-D Electron Density Carbon Atoms

I need to create a 2-D electron energy density plot in Mathematica to compare with my STM experimental results in my lab class. This would be done by plotting the sum of the symmetric and anti-...
7
votes
2answers
792 views

Adjusting Density Plot Color Function for Diffraction Simulation

I'm trying to simulate Fraunhofer diffraction by a single slit using DensityPlot I run the code: ...
7
votes
3answers
400 views

FEM Solution desired for “Plate with orifice” deflection: Application of Boundary Conditions and use of Regions

I found the deflection of an orifice plate (circular plate with a hole) subject to uniform pressure using Mathematica's NDSolve functionality. The plate is fixed at its outer circumference and is ...
7
votes
1answer
1k views

How to solve fluid flow problem based on Navier-Stokes equations?

Does anyone know or can provide any examples how fluid flow problem can be formulated and solved in Wolfram Language? Simplest cases of 1D or 2D flows based on Navier-Stokes equations or even their ...
7
votes
2answers
566 views

Integrating a function over a surface integral

From a first principles bandstructure calculation I get an energy scalar field in three dimensions $E(x,y,z)$. It's now easy to plot a constant energy (contour)-surface for dedicated values $\epsilon=...
7
votes
1answer
283 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 ...