How to describe right hand side of energy equation in tridiagonal system? Didn't get right hand side values of tridiagonal matrix.

1 回表示 (過去 30 日間)
Yanni
Yanni 2023 年 1 月 3 日
編集済み: Yanni 2023 年 4 月 29 日
xmax=1; ymax=20; dx=0.05; dy=0.25; dt=0.02; m=xmax/dx; n=ymax/dy; U=zeros(m,n); V=zeros(m,n);
for j =1:n
D(i)=-U(i,j)*dt*(-TNEW(i-1,j)+TOLD(i,j)-TNEW(i-1,j))/2*dx+dt*(TOLD(i,j-1)-2*TOLD(i,j)+TNEW(i,j+1)/2*(dy^2))-V(i,j)*dt*(TNEW(i,j+1)-TOLD(i,j-1))/4*dy;
end

回答 (1 件)

Prateek
Prateek 2023 年 1 月 6 日
Hello Gayathri,
The code you have posted executes without any error.
For better assistance, please post more details about your query, and include any other code and/or error messages .
Regards,
Prateek

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by