Guiding Center Approximation

The equation of motion used in the particle tracker is based on the Guiding Center Approximation. In a strong magnetic field, a charged particle spirals (gyrates) rapidly around a magnetic field line. Computing the full spiral is computationally expensive and often unnecessary. Instead, we track the Guiding Center—the center point of that spiral. Here is … Read more

Newtonian mechanics and Hamiltonian mechanics

To find the trajectory of a ball thrown with an initial speed $v_0$ at an angle $\theta$ (projectile motion), we will set up our coordinate system where $x$ is the horizontal distance and $y$ is the vertical height. we consider a particle of mass $m$ in a uniform gravitational field $\mathbf{g} = -g\hat{\mathbf{j}}$. The motion … Read more

The Dance of the Electron Demystifying Magnetic Resonance in Plasma

One of the most confusing barriers in electromagnetics and plasma physics is the concept of permittivity in a magnetized plasma. Students are introduced to the Stix parameters (like $R$, $L$, and $S$) and told that permittivity can be infinite or even negative. We are shown equations where a singularity appears at the cyclotron frequency ($\omega_{ce}$). … Read more

 from QWERTY to AZERTY French Typing Trainer

If you are learning French, you know that the grammar is hard. But do you know what’s even harder? Typing. As a lifelong QWERTY user, switching my keyboard layout to French (AZERTY) felt like trying to write with my left hand while blindfolded. I would try to type “qui” and end up typing “auj”. I would reach for a … Read more

The Bridge Between Waveguide and Free Space: Why the HE11 Mode is the Perfect Match for a Gaussian Beam

In the world of high-power microwave engineering, one of the most fundamental challenges is efficiently transmitting energy from a confined metal pipe out into open space. This is not just an academic exercise; it is a critical enabling technology for applications like radar, communications, and cutting-edge fusion energy research in systems like Electron Cyclotron Resonance … Read more

From Biot-Savart to the Magnetic Dipole: An Elegant Journey with Symbolic Computation

The derivation of the magnetic field of a dipole is a cornerstone of any course in electromagnetism. Traditionally, it’s a rite of passage involving pages of careful vector algebra, complex integrals, and approximations—a process as rewarding as it is prone to error. But what if we could map the fundamental physics directly into a calculation, … Read more

Accelerating Python Optics Simulations: A 7x Performance Boost for Amplitude/Intensity Substitution

In scientific computing, especially in fields like optical physics and signal processing, we often work with iterative algorithms that are computationally intensive. Every microsecond saved in the core loop can translate into minutes or even hours saved on a full simulation. One such common operation, particularly in phase retrieval algorithms like Gerchberg-Saxton, is the need … Read more

JupyterLab: The Free, Flexible Alternative to Mathematica

JupyterLab is a powerful, browser-based interactive computing environment that blends code, text, and visualization in a single interface. Much like Mathematica, it allows users to write and execute code alongside narrative text, mathematical expressions, plots, and interactive widgets. But unlike Mathematica, JupyterLab is open-source, free to use, and part of the larger Project Jupyter ecosystem. … Read more

The Big Picture: A Photographer Analogy

Camera projection is a fascinating and fundamental concept in all 3D graphics. Imagine you are a photographer in a large room. To take a picture, you do two main things: The matrices mathematically model these two steps. Our goal is to take a point in the 3D world (like a corner of our image) and … Read more

Simulating a High-Field Electromagnet: A Python-Based Approach to Field Calculation and Safety Analysis

1. The Problem: The Invisible Power and Peril of Magnetic Fields From the life-saving images of Magnetic Resonance Imaging (MRI) to the colossal energies of the Large Hadron Collider, powerful electromagnets are cornerstone technologies of modern science and medicine. They operate on a simple principle—running an electrical current through a coil of wire to generate … Read more