when i have a quarter region i wanna got a full region how can i do it?

조회 수: 1 (최근 30일)
ljaseon
ljaseon 2021년 5월 11일
편집: ljaseon 2021년 5월 11일
i have the code that only the quarter region that( +x,+y )area One quadrant
but change or add some code i wanna get full regrion likes (-x,+y,)(-x,-y,)(+x,y)region added
and wanna get a full region
how can i do it?
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
drawnow
end
  댓글 수: 2
KSSV
KSSV 2021년 5월 11일
Shw us your +x and +y....what are they vectors or matrices? It is straight forward....Just multiply by signs as you have shown.
ljaseon
ljaseon 2021년 5월 11일
I uploaded my code again sorry
+x +y means in the area that first quarter region that (+x,+y) region sorry to confusing And what i wanna is to full region likes add more (-x,+y) ,(-x,-y),(+x,-y) region
If you can see my code again i thinks i am very thanks you !

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by