How can i express B'(1) in the code ? this code is for Tranparent Boundary Condition !
1 view (last 30 days)
Show older comments
%initial condition
A=zeros(N,1);
B=zeros(N,1);
C=zeros(N,1);
D=zeros(N,1);
%with TBC LEFT-hand
gammaL=E(1)/E(2);
dsolve(B(1))=(-alphaw*ones(N-1,1))*gammaL+(-alphax*ones(N-1,1)+4*1i*beta/h+k^2*(n2(1).^2-n0^2));
C(1)=-alphae*ones(N-1,1);
D(1)=alphaw*gammaL*E(1)+(alphax+4*1i*beta/h+k^2*(n1(1).^2-n0^2))*E(1)+alphae*E(2);
%with TBC RIGHT-hand
gammaR=E(N-1)/E(N);
A(N)=-alphaw*ones(N-1,1);
dsolve(B(N)) =-alphae*ones(N-1,1)*gammaR+(-alphax*ones(N-1,1)+4*1i*beta/h+k^2*(n2(N).^2-n0^2));
D(N)=alphaw*E(N-1)+(alphae*gammaR+alphax+4*1i*beta/h+k^2*(n1(N).^2-n0^2))*E(N);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
A=-alphaw*ones(N-1,1);
C=-alphae*ones(N-1,1);
B=-alphax+4*1i*beta/h-k^2*(n2.^2-n0^2);
for p=2:N-1
D(p)=alphaw*E(p-1)+(alphax+4*1i*beta/h+k^2*(n1(p)^2-n0^2))*E(p)+alphae*E(p+1);
end
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1046615/image.png)
1 Comment
Torsten
on 26 Jun 2022
We have absolutely no clue what the problem is and how you try to solve it. So how should we be able to help ?
Answers (0)
See Also
Categories
Find more on Optics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!