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 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Iman Hana Mustafa Kamal
el 1 de Mzo. de 2019
Editada: Iman Hana Mustafa Kamal
el 2 de Mzo. de 2019
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
Respuesta aceptada
Sven
el 1 de Mzo. de 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);
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!