- added plot

This commit is contained in:
2023-06-11 08:29:16 +02:00
parent 4a51d5de47
commit e31347dac9
+7 -2
View File
@@ -53,11 +53,12 @@ A = 0*T
Pa = [0 0 0 0]';
Pp = [M_CaSO4; M_CaCl2; M_MgSO4; M_NaCl];
CONV_COUNTER_RELOAD = 10;
_dn = [];
CONV_COUNTER_RELOAD = 20;
Dn0 = 1;
conv_counter = CONV_COUNTER_RELOAD;
while true,
[A1, Pa, Dn1] = vecfit(Pp,mask,T,A,Pa, 0.0001.*(1-exp(-Dn0)))
[A1, Pa, Dn1] = vecfit(Pp,mask,T,A,Pa, 0.001.*(1-exp(-Dn0)))
Dc = round_n(Dn1,3);
if Dn0 == Dc,
if conv_counter == 0,
@@ -69,10 +70,14 @@ while true,
conv_counter = CONV_COUNTER_RELOAD;
end
Dn0 = Dc;
_dn = [_dn Dn1];
end
plot(1:length(_dn), _dn); grid();
title("Distance"); xlabel("Iteration"); ylabel("Dn")
T=T
A1=A1
Pa=Pa
endfunction
function zr = round_n(z, n)