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 Ansicht (letzte 30 Tage)
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

Akzeptierte Antwort

Sven
Sven am 1 Mär. 2019
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);

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by