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
truncated_svd appears to be unable to handle complex matrices (both with the method of truncation by explicit rank or tolerance). The following code which uses truncated_svd() via DMDSVD() fails.
using DataDrivenDiffEq
freq1 = 2
freq2 = 3
freq3 = 11
dt = 0.1
t = 0:dt:30
x = exp.(1im*freq1*t);
y = exp.(1im*freq2*t);
z = exp.(1im*freq3*t);
X = hcat(x,y,z)';
problem = DiscreteDataDrivenProblem(X, t);
res = solve(problem, DMDSVD());
A quick fix would be to compare the magnitude and truncation:
functiontruncated_svd(A::AbstractMatrix{T}, truncation::Real) where T <:Number
truncation =min(norm(convert(T, truncation)), norm(one(T)))
U, S, V =svd(A)
r =vec(S .> truncation*maximum(S))
U = U[:, r]
S = S[r]
V = V[:, r]
return U, S, V
end
An error sooner would be nice :)
(But at least for the case of DMDSVD, there is no particular reason intrinsic to the algorithm itself that requires real input.)
truncated_svd appears to be unable to handle complex matrices (both with the method of truncation by explicit rank or tolerance). The following code which uses truncated_svd() via DMDSVD() fails.
with errors:
The text was updated successfully, but these errors were encountered: