Is it possible to store the values at the grid points?if it is how?
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi! I just have little knowledge on matlab.With what i know I'm just trying to write a code for solving a Block triagonal matrix whose entries are in terms of finite differences.The unknowns has to be found at each grid point.I need to intialize the values at each grid points and have to use the previous grid point value to calculate the unknowns. This is what i have written
%%the intial profiles
deleta=0.2;
for eta=0:deleta:etainf
f_int= fw +((eta)^2)/(2*etainf);
F_int =eta/etainf;
G_int =1-(eta/etainf);
f(:,1)=f_int;
F(:,1)=F_int;
G(:,1)=G_int;
fxbar(1,1)=f(1,1)/delxbar;
Fxbar(1,1)=F(1,1)/delxbar;
Gxbar(1,1)=G(1,1)/delxbar;
Feta(1,1)=F(1,1)/(2*deleta);
end
%%set Boundary condition
F(1,:)=0; %%the value at eta =0
G(1,:)=Gw; %%the value at eta =0
F(:,etainf)=1; %%the value at etainf
G(:,etainf)=1; %%the value at etainf
%%March in the xbar direction
for i =2:L
%%March in the eta direction
for j=2:H
fxbar=(f(i,j)-f(i-1,j))/delxbar;
Fxbar_old=(F(i,j)-F((i-1),j))/delxbar;
Feta_old=(F(i,j+1))-(F(i,j-1))/(2*deleta);
Gxbar_old=(G(i,j)-G(i-1,j))/delxbar;
end
end
But this doesn't help me. Can anyone guide me how to proceed?
댓글 수: 3
KSSV
2017년 5월 15일
There are many value sin the code which are not defined...give the complete code. It can be made to work.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Control System Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!