Lumped Circuit refer to this book.對照引用 Comparison & Reference:The Finite Difference Time Domain Method for Electromagnetics: With MATLAB SimulationsAtef Z. Elsherbeni, Veysel Demir
voltage_sources, Current sources, Diodes have six direction (include plus and minus)
directioz=1 => +x
directioz=2 => +y
directioz=3 => +z
directioz=4 => -x
directioz=5 => -y
directioz=6 => -z
Resistance, Inductor, Capacitor have three direction
directioz=1 => x
directioz=2 => y
directioz=3 => z
Example
%------------電壓源 1 Voltage Source 1------------% direction 1(+x),2(+y),3(+z),4(-x),5(-y),6(-z)direction=1;x1=icenter-1;x2=icenter;y1=jcenter;y2=jcenter;z1=kcenter;z2=kcenter;Resistance=50; %(ohmn) 電壓源內阻抗Magnitude=1; type=1; %1=正弦波voltage_sources(1,:)=[x1,x2,y1,y2,z1,z2,direction,Resistance,Magnitude,type];%----------------------------------%------------電壓源 2 Voltage Source 2------------% direction 1(+x),2(+y),3(+z),4(-x),5(-y),6(-z)direction=2;x1=icenter;x2=icenter;y1=jcenter-1;y2=jcenter;z1=kcenter;z2=kcenter;Resistance=50; %(ohmn) 電壓源內阻抗Magnitude=1; type=1; %1=正弦波voltage_sources(2,:)=[x1,x2,y1,y2,z1,z2,direction,Resistance,Magnitude,type];%----------------------------------%------------電壓源 3 Voltage Source 3------------% direction 1(+x),2(+y),3(+z),4(-x),5(-y),6(-z)direction=6;x1=icenter;x2=icenter;y1=jcenter;y2=jcenter;z1=kcenter;z2=kcenter+1;Resistance=50; %(ohmn) 電壓源內阻抗Magnitude=1; type=1; %1=正弦波voltage_sources(3,:)=[x1,x2,y1,y2,z1,z2,direction,Resistance,Magnitude,type];%----------------------------------%------------電壓源 1 Voltage Source 1------------% direction 1(+x),2(+y),3(+z),4(-x),5(-y),6(-z)direction=1;x1=icenter-1;x2=icenter-1;y1=jcenter-1;y2=jcenter;z1=kcenter-1;z2=kcenter+1;Resistance=50; %(ohmn) 電壓源內阻抗Magnitude=1; type=1; %1=正弦波voltage_sources(1,:)=[x1,x2,y1,y2,z1,z2,direction,Resistance,Magnitude,type];%---------------------------------- %------------電流源 1 Current Source 1-------------% direction 1(+x),2(+y),3(+z),4(-x),5(-y),6(-z)direction=3;x1=icenter-1;x2=icenter-1;y1=jcenter-1;y2=jcenter;z1=kcenter-1;z2=kcenter+1;Resistance=50; %(ohmn)Magnitude=1; type=1;current_sources(1,:)=[x1,x2,y1,y2,z1,z2,direction,Resistance,Magnitude,type];%---------------------------------- %------------電阻 1 Resistor 1------------% direction 1(x),2(y),3(z)direction=3;x1=icenter-1;x2=icenter-1;y1=jcenter-1;y2=jcenter;z1=kcenter-1;z2=kcenter+1;Resistance=50; %(ohmn)resistors(1,:)=[x1,x2,y1,y2,z1,z2,direction,Resistance];%---------------------------------- %------------電容 1 Capacitor 1------------% direction 1(x),2(y),3(z)direction=3;x1=icenter-1;x2=icenter-1;y1=jcenter-1;y2=jcenter;z1=kcenter-1;z2=kcenter+1;Capacitance=1e-12; %(farads)capacitors(1,:)=[x1,x2,y1,y2,z1,z2,direction,Capacitance];%---------------------------------- %------------電感 1 inductor 1------------% direction 1(x),2(y),3(z)direction=3;x1=icenter-1;x2=icenter-1;y1=jcenter-1;y2=jcenter;z1=kcenter-1;z2=kcenter+1;Inductance=1e-9; %(henrys)inductors(1,:)=[x1,x2,y1,y2,z1,z2,direction,Inductance];%---------------------------------- %------------二極體 1 diode 1------------% direction 1(x),2(y),3(z)direction=3;x1=icenter-1;x2=icenter-1;y1=jcenter-1;y2=jcenter;z1=kcenter-1;z2=kcenter+1;Inductance=1e-9; %(henrys)diodes(1,:)=[x1,x2,y1,y2,z1,z2,direction,Inductance];%---------------------------------- %------------平面導體 1------------% istart,iend,jstart,jend,kstart,kend,electronicmaterialx1=icenter-1;x2=icenter-1;y1=jcenter-1;y2=jcenter;z1=kcenter-1;z2=kcenter+1;Conductivity=1e10;wires(1,:)=[x1,x2,y1,y2,z1,z2,Conductivity];%----------------------------------這個就是電路板上面的銅或其他金屬導體,簡單來說就是導線的意思。只能輸入一個固定的電導率。
若導線想使用色散材料模型,那麼可使用一般結構裡的薄膜(thin_film),與Lumped的平面導體一樣都是單層。
%=================薄膜 thin_film===========================nindex=1^2;sigma=0;choice='E_Iso'; %E_Iso,PEC,M_Iso,PMC,E_Model1,M_Model1,EM_Model1x1=(icenter-3)*gdx;x2=(icenter+3)*gdx;y1=(jcenter-3)*gdy;y2=(jcenter)*gdy;z1=kcenter*gdz;z2=kcenter*gdz;Iso_thin_film(choice,nindex,sigma,x1,x2,y1,y2,z1,z2)%=================薄膜 thin_film===========================