- #1
Huibert
- 6
- 0
1. I try to model (MatLab) the convective transport of material trough the soil
2. The equation I use is: d(Th*C) / d(t) = - q * d(C) / d(z).
Th = soil moisture content,
C = concentration,
t = time,
q = flow velocity of groundwater,
z = depth.
Parameters
time = 20 h
dt = 0.2 h
depth model = 50 cm
dz = 0.05 cm
flow velocity = 0.1 cm/h
soil moisture content = 0.4 cm/cm
initial C = 0 g/cm
C at z_0 = 5 g/cm
C at z_end = 0 g/cm
I wrote the numerical solution in matrices:
(Th+ML) * C(i+1) = (Th+MR)*C(i)+BC
C(i+1) is a vector with the concentrations of 'n' depths at t = i+1. C(i): idem at t = i. BC is a vector that determines the boundary conditions (at j = top of model and j = bottom of model). Th is a matrix with Moisture Content values at the 0th diagonal.
3. So after defining the matrices, i modeled
Result: Warning: Matrix is singular, close to singular or badly scaled.
Results may be inaccurate. RCOND = NaN.
What can be the problem and how could it possibly be solved? The MatLab help didn't really explain it to me (note: this is my first programming experience).
Thanks in advance!
2. The equation I use is: d(Th*C) / d(t) = - q * d(C) / d(z).
Th = soil moisture content,
C = concentration,
t = time,
q = flow velocity of groundwater,
z = depth.
Parameters
time = 20 h
dt = 0.2 h
depth model = 50 cm
dz = 0.05 cm
flow velocity = 0.1 cm/h
soil moisture content = 0.4 cm/cm
initial C = 0 g/cm
C at z_0 = 5 g/cm
C at z_end = 0 g/cm
I wrote the numerical solution in matrices:
(Th+ML) * C(i+1) = (Th+MR)*C(i)+BC
C(i+1) is a vector with the concentrations of 'n' depths at t = i+1. C(i): idem at t = i. BC is a vector that determines the boundary conditions (at j = top of model and j = bottom of model). Th is a matrix with Moisture Content values at the 0th diagonal.
3. So after defining the matrices, i modeled
Code:
for i = 1:Nt-1
Csim(:,i+1) = inv(Th+ML)*((Th+MR)*Csim(:,i)+BC);
end
Result: Warning: Matrix is singular, close to singular or badly scaled.
Results may be inaccurate. RCOND = NaN.
What can be the problem and how could it possibly be solved? The MatLab help didn't really explain it to me (note: this is my first programming experience).
Thanks in advance!