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!