Hello,
I’ve been running some tests with ModelingToolkit, and when trying to implement equations that use complex numbers using @mtkmodel
macro, I haven’t been able to assign initial values to the system without it failing. For example, when creating the following system, I get the error “type ComplexTerm has no field metadata”. Does anyone know if this happens because I implemented it incorrectly, or is it simply that ModelingToolkit isn’t yet designed to handle systems involving complex numbers?
@mtkmodel Complex begin
@parameters begin
R = 1.0
C = 1.0
ω = 1
end
@variables begin
i(t)::ComplexF64 = 1.0 + 0.3 * im
u(t)::ComplexF64
end
@equations begin
u ~ (R + 1 / (im * ω * C))*i
end
end
@mtkbuild model = Complex()
Thanks in advance.