wantmake cureve to flat

조회 수: 1 (최근 30일)
ljaseon
ljaseon 2021년 5월 12일
편집: ljaseon 2021년 5월 12일
this code is related to the transmission line
and when i input this code i got a some figure that like this
but what the want shape is like this one
when my code forward to the ( 0,0) the shape looks like curve but what i wanna is just flat like this pitcture
how can change my code to make this picture?
this is also related to the electromagnetic and transmission line
and a/h is x axis b/h is y axis
------------------------------------------------------------------------------------------
clear all;format compact;
H=0.05;
NT= 100;
A=2.5; B=2.5; D=0.5; W=1.0;
ER=2.35;
EO=8.81E-12;
U=3.0E+8;
NX=A/H;
NY=B/H;
ND=D/H;
NW=W/H;
VD=100.0;
%CALCULATE CHARGE WITH AND WITHOUT DIELECTRIC
ERR=1.0;
for L=1:2
E1=EO;
E2=EO*ERR;
%INITIALIZATION
V=zeros(NX+2,NY+2);
%SET POTENTIAL ON INNER CONDUCTOR(FIXED NODES) EQUAL TO VD
V(2:NW+1,ND+2)=VD;
%CALCULATE POTENTIAL AT FREE NODES
P1=E1/(2*(E1+E2));
P2=E2/(2*(E1+E2));
for K=1:NT
for I=0:NX-1
for J=0:NY-1
if( (J==ND)&(I<=NW))
%do nothing
elseif(J==ND)
%IMPOSE BOUNDARY CONDITION AT THE INTERFACE
V(I+2,J+2)=0.25*(V(I+3,J+2)+V(I+1,J+2))+....
P1*V(I+2,J+3)+P2*V(I+2,J+1);
elseif(I==0)
%IMPOSE SYMMETRY CONDITION ALONG Y-AXIS
V(I+2,J+2)=(2*V(I+3,J+2)+V(I+2,J+3)+V(I+2,J+1))/4.0;
elseif(J==0)
%IMPOSE SYMMETRY CONDITION ALONG X-AXIS
V(I+2,J+2)=(V(I+3,J+2)+V(I+1,J+2)+2*V(I+2,J+3))/4.0
else
V(I+2,J+2)=(V(I+3,J+2)+V(I+1,J+2)+V(I+2,J+3)+V(I+2,J+1))/4.0;
end
end
end
%Animation of calculation
figure(1),surf(V),,colorbar,title([num2str(K),'/',num2str(NT)])
end
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Physics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by