how to remove matrix dimension error ?

1 回表示 (過去 30 日間)
Qudsiya  Irum
Qudsiya Irum 2017 年 7 月 27 日
コメント済み: KSSV 2017 年 7 月 27 日
I want solve Non Linear 1-D Heat Equation using Galerkin Finite Element Method. As I entered its ODE to solve by backward euler method, it is showing matrix dimension error. AA and MM are element stiffness and mass matrix of order(2501*2501) double respectively.
MM= spdiags([dx/6*ones(nx+1,1) 2*dx/3*ones(nx+1,1) dx/6*ones(nx+1,1)],[-1 0 1],nx+1,nx+1)
AA = spdiags([-1/dx*ones(nx+1,1) 2/dx*ones(nx+1,1) -1/dx*ones(nx+1,1)],[-1 0 1],nx+1,nx+1);
for mn = 2:1:M
T_solid_new_t(mn+1) = {MM+ k.*AA.*dt + dt*MM.*ht}\(MM.*T_solid(mn)+(dt.*dx.*Hs)+(ht.*Tp_g.*dx.*dt))
end
  1 件のコメント
KSSV
KSSV 2017 年 7 月 27 日
Attach the complete code..so that users can run and check.....

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by