You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
alg_wrapper.m in alg_TWM-PWRFFT got issue that for ideal data (simulated, e.g. during testing), it can happen the S is smaller than P because of the numerical rounding. And if P is greater than S, it will lead to complex Q and this will create error in a later code.
Therefore some comparison with numerical precision is needed.
Could be solved by this code - replacing lines 211-212:
Q = (S^2 - P^2)^0.5sign(Q_bud);
u_Q = ((S^2u_S^2 + P^2*u_P^2)/(S^2 - P^2))^0.5; % ###note: ignoring corelations, may be improved
by code:
SmP = S^2 - P^2;
if abs(SmP) < 2eps
SmP = 0;
end
% If abs(SmP) is greater than 2eps, and is negative, it will lead to
% complex Q and will create error later.
Q = (SmP)^0.5sign(Q_bud);
u_Q = ((S^2u_S^2 + P^2*u_P^2)/(SmP))^0.5; % ###note: ignoring corelations, may be improved
The text was updated successfully, but these errors were encountered:
alg_wrapper.m in alg_TWM-PWRFFT got issue that for ideal data (simulated, e.g. during testing), it can happen the S is smaller than P because of the numerical rounding. And if P is greater than S, it will lead to complex Q and this will create error in a later code.
Therefore some comparison with numerical precision is needed.
Could be solved by this code - replacing lines 211-212:
Q = (S^2 - P^2)^0.5sign(Q_bud);
u_Q = ((S^2u_S^2 + P^2*u_P^2)/(S^2 - P^2))^0.5; % ###note: ignoring corelations, may be improved
by code:
SmP = S^2 - P^2;
if abs(SmP) < 2eps
SmP = 0;
end
% If abs(SmP) is greater than 2eps, and is negative, it will lead to
% complex Q and will create error later.
Q = (SmP)^0.5sign(Q_bud);
u_Q = ((S^2u_S^2 + P^2*u_P^2)/(SmP))^0.5; % ###note: ignoring corelations, may be improved
The text was updated successfully, but these errors were encountered: