Lecture -- Introduction to Two-Dimensional Finite-Difference Method

Поділитися
Вставка
  • Опубліковано 5 вер 2024

КОМЕНТАРІ • 11

  • @alaajaleel8583
    @alaajaleel8583 3 роки тому +3

    continue you are a monster in the teaching thanks alot

  • @enttiuni7109
    @enttiuni7109 3 роки тому +1

    A very approachable exposition, the visualizations are great

  • @neelsamshah
    @neelsamshah 3 роки тому

    Slide 6, starting at time 7:04 shows that MATLAB stores array elements in row major order.
    Actually, MATLAB stores array elements in column major order. So the array should contain vertical bars with strings going through all the bars.
    In any case, the video does a great job of visualizing storage of array elements.

    • @empossible1577
      @empossible1577  3 роки тому +1

      You are absolutely right. However, MATLAB treats all things as matrices. In the finite-difference method there are also arrays where the indices are interpreted differently. Here I am visualizing how an array would be reshaped into a column vector. This is a very confusing aspect of how I do things in MATLAB.
      Let me point you to the course website. I recommend using this as your main portal to the videos. You can download the notes and get links to the latest versions of the videos, and have access to many other resources.
      empossible.net/academics/emp4301_5301/
      At the course website, I get into the matrix vs. array confusion in Topic 2. Specifically, see Lecture 2a. I don't think my way through this confusion is perfect, but after trying many different things I have found this approach to be the best.
      I would love to know your thoughts on this.

    • @neelsamshah
      @neelsamshah 3 роки тому +1

      @@empossible1577 Thank you for the explanation. I went through Lecture 2a. I think I understand this lecture better. Matlab treats 2D arrays as matrices by default and the elements are stored in column major order. You are interpreting the matrix as an array by transposing the matrix. Since the rows and columns are interchanged in the transposed array, the elements of the transposed array are stored in row major order and this is what is being visualized in slide 6. I think this point will be more clear if you can add one more slide showing the default way of storing matrices. If we use the numbers 1, 2 and so on to denote the array elements E1, E2 and so on, then the following Matab code would be consistent with code shown in slide 6: E = [1 4 7 10; 2 5 8 11; 3 6 9 12]; e = E(:). Here, E is the matrix. We can get the array representation using E.'. I was confused because I didnt watch lecture 2a and I assumed E to be E = [1 2 3 4; 5 6 7 8; 9 10 11 12]. Have you recorded a lecture on a MATLAB session which uses this approach to solve a PDE using the finite difference method and using this interpretation of Matlab matrix as a 2D array? By the way, I think your lectures are great. They simplify complex concepts and explain them visually and intuitively. I have watched several lectures on FDTD and I learned a lot from them. Thank you for putting in the time and effort in creating these lectures.

    • @empossible1577
      @empossible1577  3 роки тому

      @@neelsamshah Thank you! This is always a source of confusion and I will take your advice.
      I used to never provide any MATLAB code because it always shut down a student's thought process. They entered a "code hacking" mode instead of a "code thinking" mode. Most recently, I have gotten a lot of requests from industry professionals and other folks so I have created a paid content with MATLAB codes, including the finite-difference method. You will see links to these on the course websites.
      I have also been busy making super high quality online courses for FDTD intended for the complete beginner. The free FDTD course is for when I teach face-to-face. The online courses are much better to learn from and use the best graphics and visualizations I have ever come up with. The first half of the first course is completely free. It would be neat to hear your thoughts on these.
      empossible.thinkific.com/collections?category=FDTD-in-MATLAB

  • @whyitdoesmatter2814
    @whyitdoesmatter2814 3 роки тому

    Thanks for the tutorial. Can you please elaborate a bit on the boundary condition when you use the right-handed derivative in 2D? Can you make a tutorial to explain how to the implementation in 2D with the boundary condition?

    • @empossible1577
      @empossible1577  3 роки тому

      Happy to help! First, let me point you to the official course website. I recommend using this as your main portal to the course. You can download the notes, get links to the latest version of videos, and get links to MATLAB codes, tutorials, and other learning resources.
      empossible.net/academics/emp4301_5301/
      I think the information you are seeking is in Lecture 7j where I step you through building each derivative matrix on a staggered grid. You will also links to MATLAB implementation tutorials.

  • @jakekeip
    @jakekeip 2 роки тому

    I know this is not specifically the topic of this video, but I am looking to implement the ability to solve a EM problems in an existing Finite Element Method framework that I have. For example, solving EM wave equation. I have been finding many examples of potential based implementations and have had some success here, but none or less discussing field based implementations and their boundary conditions. I was wondering if you had any suggestions/advice or could point me in some direction? I suppose I am looking to develop some basic implementation of what COMSOL, HFSS, or others have developed for higher frequency problems.

    • @empossible1577
      @empossible1577  2 роки тому +1

      It will be relatively easy to develop a node-based FEM for electromagnetics and you should even be able to find codes for that. The better, and more difficult, thing is to develop an edge-element based FEM. I do not know what is the "best" book, but there is one book that seems to have everything you will need:
      www.amazon.com/MATLAB-based-Element-Programming-Electromagnetic-Modeling/dp/1498784070/ref=sr_1_1?crid=3MXJ0GUDLGA8K&keywords=matlab+based+finite+element&qid=1649807368&sprefix=matlab+based+finite+element%2Caps%2C96&sr=8-1
      If you find a better book, let me know!