![fdtd with matlab fdtd with matlab](https://d3i71xaburhd42.cloudfront.net/8c4c257de87ea9405d3cdc660cf279f193d6e572/10-Figure9-1.png)
You may also include a few more grid cells in the scattered-field if you want to more easily calculate the reflected energy from whatever you are modeling. Using TF/SF, you would set all your PML regions to be the scattered-field. I would suggest using the total-field/scattered-field technique for this, but other approaches exist such as the scattered-field only method. If you do not have periodic boundaries (PML for example) or you are using a sinusoidal source, you can easily incorporate oblique incidence. You can calculate what angles using the grating equation. If you can make your problem space cover more than one period in its cross section, there will be other discrete angles available to you. Otherwise you are stuck with just normal incidence.
#Fdtd with matlab update
There is a technique called the "angled update method" but this is limited in the angles it can implement. If you are using periodic boundary conditions and wish to use an impulse source at oblique incidence, there is no good way to do this. Roughly speaking, this boundary simply works by storing the outermost field values for two time steps and using them as the boundary field field values at the current time step. This is possible because energy can only be traveling in one direction and all frequencies will have the same velocity.
![fdtd with matlab fdtd with matlab](https://ww2.mathworks.cn/matlabcentral/mlc-downloads/downloads/submissions/35588/versions/1/screenshot.jpg)
I apologize if any of my answers don't apply to the attached code.įor the special case of 1D FDTD there exists an exact boundary condition from which you should not get any reflections. I have not run or looked at the attached MATLAB code, but I may be able to answer some of the questions posed in this discussion.