Solve for 2D Electromagnetic Field in Material

Pasit Jarutatsanangkoon, Chulabhorn Royal Academy, Princess Srisavangavadhana College of Medicine
Author Profile
Initial Publication Date: December 1, 2021

Summary

Use numerical method (finite different frequency domain) to solve Maxwell's equations for electromagnetic field in material using MATLAB. Basically, it is to solve Ax = B, where A is a sparse matrix containing materials, x is the resulting field, and B is the source.

Share your modifications and improvements to this activity through the Community Contribution Tool »

Learning Goals

- Students will learn how to take Maxwell's equations, break them into Matrix equations and implement it on MATLAB.
- MATLAB is used to solve a huge sparse matrix equation and visualize the result
- The result 2D field plot is created which will help student learn about the propagation of electromagnetic wave.

Context for Use

Special class for graduate students
Class size : 10-15
Duration : 6 hours (3 hours of theory about numerical method, 3 hours for hands-on with MATLAB)
MATLAB skills: Basic programming, basic plot
Other disciplinary skills: Linear algebra, Maxwell's equations

This activity is to compliment the hands-on experience of optics lab with the basic of numerical analysis.

Description and Teaching Materials

This is a two-part class. The first 3 hours will be the theory of electromagnetic via Maxwell's equations and the formulation into a simple matrix equation. The second part will be the translation of physical problem into a discrete matrix value.
Student will learn to read data using dlmread from file and assign them to appropriate variable, do data pre-processing, and/or interpolate using griddata. The next part is to assemble the matrix by creating a sparse empty matrix first, then populate it correctly at each indices. Since the problem is in 2D, student needs to rearrange a matrix into a vector and recombine them back after the solving process. At the core is the equation Ax = B. Student will solve it and visualize. Throughout the main m file, student will learn to create sub function to clean up the code. The result will be save in a folder with timestamp for analysis later.




Teaching Notes and Tips

The generation of material can be achieve by using the transformation optics theory.

Assessment

- Able to follow through the step-by-step codes and get the resulting plot.
- Able to modify the electromagnetic source (such as angle) or material parameters and see different result

References and Resources

Youtube video on FDFD method by Prof.‪Raymond C. Rumpf‬
https://youtu.be/4_O3gQEkydw