フィルターのクリア

Index in position 1 exceeds array bounds (must not exceed 6). Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN.

1 回表示 (過去 30 日間)
Please help debug. I marked the lines that outputs error.
It gives complex double when I debug it.
This is another version of the code. Any help is appreciated. Thanks!
p_o(n+1,:)=A\R; %%% this one gives warning %%%%
for i = 1:10
if i == 1
qt(n,i)=injection_rate;
Twr=2.6366^10-4*permeability*lamda_w(n,i)*(dydz/delta_x);
S_w(n+1,i)=(1+(rock_compressibility+water_compressibility)*(p_o(n+1,i)-p_o(n,i)))*S_w(n,i)+(delta_time/(VR*porosity))*(Twr*(p_o(n+1,i+1)-p_o(n+1,i))-Twr*(p_cow(n,i+1)-p_cow(n,i))+qt(n,i));
else
qt(n,i)=-WI(n,i)*(p_o(n,i)-p_well);
Twl=Twr;
Twr=2.6366*10^-4*permeability*lamda_w(n,i)*(dydz/delta_x);
S_w(n+1,i)=(1+(rock_compressibility+water_compressibility)*(p_o(n+1,i)-p_o(n,i)))*S_w(n,i)+(delta_time/(VR*porosity))*(Twr*(p_o(n+1,i+1)-p_o(n+1,i))-Twl*(p_o(n+1,i)-p_o(n+1,i-1))-Twr*(p_cow(n,i+1)-p_cow(n,i))+Twl*(p_cow(n,i)-p_cow(n,i-1)));
end
if S_w(n+1,i)<S_wr
S_w(n+1,i)=S_wr;
end

採用された回答

Sven
Sven 2019 年 3 月 1 日
You wrote
2.6366^10-4
instead of
2.6366*10^-4
You could also write it like this
2.6366e-4
This solved any errors and warnings. Here in this line:
p_o(n+1,:)=A\R; %%% this one gives warning %%%%
for i = 1:10
if i == 1
qt(n,i)=injection_rate;
% Before: Twr=2.6366^10-4*permeability*lamda_w(n,i)*(dydz/delta_x);
Twr=2.6366e-4*permeability*lamda_w(n,i)*(dydz/delta_x);

その他の回答 (0 件)

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by