Skip to content
Snippets Groups Projects
Commit 010edfcd authored by Felix Kong's avatar Felix Kong
Browse files

change imaginary check from abstol to reltol

parent 16aed565
Branches
No related merge requests found
...@@ -72,7 +72,9 @@ classdef dmd < handle ...@@ -72,7 +72,9 @@ classdef dmd < handle
end end
X2hatComplex = obj.Phi*obj.Lambda*(obj.Phi\obj.X); X2hatComplex = obj.Phi*obj.Lambda*(obj.Phi\obj.X);
assert(norm(imag(X2hatComplex)) <= 1e-6); if (norm(imag(X2hatComplex))/norm(X2hatComplex) >= 1e-6)
warning('rel norm of imaginary component of X2hat nontrivial: %e. Proceeding anyway.',norm(imag(X2hatComplex))/norm(X2hatComplex))
end
X2hat = real(X2hatComplex); X2hat = real(X2hatComplex);
end end
...@@ -97,6 +99,11 @@ classdef dmd < handle ...@@ -97,6 +99,11 @@ classdef dmd < handle
end end
assert(norm(imag(xhat)) <= 1e-6); assert(norm(imag(xhat)) <= 1e-6);
% assert(norm(imag(xhat)) <= 1e-6);
if (norm(imag(xhat))/norm(xhat) >= 1e-6) % rel norm of imag components
warning('rel norm of imaginary component of X2hat nontrivial: %e. Proceeding anyway.',norm(imag(xhat))/norm(xhat))
end
xhat = real(xhat); xhat = real(xhat);
predictTime = toc; predictTime = toc;
if(obj.verbose) if(obj.verbose)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment