FDTD transmission line junction
3 views (last 30 days)
Show older comments
function [V,I] = FDTD5B(V0,I0,Z0,T,Z,dz,dt,v)
V(1,:)=V0;
I(1,:)=I0;
Y0=1./Z0;
for j=2:1:T%time
%% I calc
for i=2:Z-1%place
I(j,i)=I(j-1,i)+Y0(j,i)*((v*dt)/dz)*(V(j-1,i-1)-V(j-1,i+1));
end
I(j,1)=I(j-1,1)+Y0(j,1)*((v*dt)/dz)*(V(j-1,1)-V(j-1,2));
I(j,Z)=I(j-1,Z)+Y0(j,Z)*((v*dt)/dz)*(V(j-1,Z-1)-V(j-1,Z));
%% V calc
for i=1:Z-2%place
V(j,i+1)=V(j-1,i+1)+Z0(j,i)*((v*dt)/dz)*(I(j,i)-I(j,i+2));
end
V(j,1)=V(j-1,1)+Z0(j,1)*((v*dt)/dz)*(I(j,1)-I(j,2));
V(j,Z)=V(j-1,Z)+Z0(j,Z)*((v*dt)/dz)*(I(j,Z-1)-I(j,Z));
end
end
%% Task 1- Gaussian Pulse
%modified : 02.12.21
clear all;
clc;
close all;
%% Define Variables
v=10;%Phase Velocity
dz=2;%Step place (Controls the velocity of the wave)
Sline=-1000;%Start Line
Eline=1000;%End Line
z=linspace(Sline,Eline,(Eline-Sline)/dz);
Z0=1;%Impedance
A=3;%Amplitude
sigma=100;
Z=length(z);%Length of the line
Time=75;%Run Time
dt=dz/v;%Magic Time Step
t=linspace(0,Time,Time/dt);
T=length(t);%Length of time vector
Z0n=ones(T,Z);
Z0n((T/3)+1:end,floor((Z/3))+1:end)=2;
% %% Initial Condition
V0=A*exp((-z.^2)./(2*(sigma^2)));%n
I0=A*exp((-z.^2)./(2*(sigma^2)))./Z0n(1,:);%n-1/2
%% Function Calling
[V,I]=FDTD5B(V0,I0,Z0n,T,Z,dz,dt,v);
%% Ploting
for j = 1:1:T %Wave +
figure(1);
subplot(2,1,1);
plot(z,V(j,:),'linewidth',2);
grid on;
axis([min(z) max(z) -A-1 A+3]);
xlabel('Z','fontSize',14);
ylabel('Wave Amplitude','fontSize',14);
titlestring = ['Voltage Wave (+)',' TIME = ',num2str(t(j)), 'second'];
title(titlestring ,'fontsize',14);
subplot(2,1,2);
plot(z,I(j,:),'linewidth',2);
grid on;
axis([min(z) max(z) -A+2 A+1]);
xlabel('Z','fontSize',14);
ylabel('Wave Amplitude','fontSize',14);
titlestring = ['Current Wave (+)',' TIME = ',num2str(t(j)), 'second'];
title(titlestring ,'fontsize',14);
pause(0.01);
end

Hello,
We try to simulate 2 transmission lines with different impedance using numerical method called FDTD.
In the live simulation we get a negative reflected wave of V although we should get a possitive one.
How can we fix it?
Thank you.


0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!