フィルターのクリア

Propogating a Wave with a change in media

2 ビュー (過去 30 日間)
lpott005
lpott005 2020 年 9 月 29 日
Hello!
I am trying to create an animation of a normally incident gaussian pulse, and its reflection and transmission when it changes media. So far all I have done is created the pulse itself as an initial condition. I am struggling to find an answer for how to code the reflection and transmission of the pulse as it interacts with a change in media.
This is the code that I have so far:
%Wave Animation
%Original Wave: yinc=A cos(k1x−ωt)
%Reflected Wave yref=B cos(k1x+ωt)
%Transmitted Wave: ytrans=C cos(k2x−ωt)
clear all
close all
clc
%System Parameters
Eps0 = 8.854E-12;
Eps1 = 1E-10;
E0=1;
x0=0;
Sigma=0.5; %Needs value
%Frame
InitialX = linspace(-2,2, 100);
TravelX=linspace(2, 10, 200);
FullX=[InitialX, TravelX];
% X=linspace(0, 5, 500);
T=linspace(0, 10, 1000);
nInit=Eps0;
for x_Initial=1:length(InitialX)
EyI(x_Initial)=E0*exp(-(InitialX(x_Initial)-x0)^2/Sigma^2);
BzI(x_Initial)=nInit*EyI(x_Initial);
end
EyFiller=zeros(1,200);
EyInitial=[EyI,EyFiller];
%Change media
if InitialX > 1
n=(Eps0);
else
n=sqrt(Eps1);
end
% ETest=[InitialX; EyI]
% plot(InitialX, EyI)
plot(FullX, EyInitial)
xlim([0,10])

回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by