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
The recently introduced handling of complex variables in @mtkmodel#2935 leads to incorrect results. See MWE with different results within and without @mtkmodel
Expected behavior
Expansion of complex equations should yield the same result regardless of construction method...
Minimal Reproducible Example 👇
# wrong results in @mtkmodel@independent_variables t
@mtkmodel ComplexModel begin@variablesbeginx(t)
y(t)
z(t)::Complexend@equationsbegin
z ~ x + im*y
endend@named mixed =ComplexModel()
full_equations(mixed)
# 2-element Vector{Equation}:# z(t) ~ x(t)# 0 ~ y(t)# correct results in ode system@independent_variables t
@variablesx(t) y(t) z(t)::Complex
eqs = z ~ x + im*y # notice how complex equation returns Vector{Equation}
sys =ODESystem(eqs, t; name=:ComplexModel)
full_equations(sys)
# 2-element Vector{Equation}:# real(z(t)) ~ x(t)# imag(z(t)) ~ y(t)
Environment (please complete the following information):
Output of using Pkg; Pkg.status()
(jl_QTt44V) pkg> st
Status `/tmp/jl_QTt44V/Project.toml`
[961ee093] ModelingToolkit v9.36.0
Output of versioninfo()
julia>versioninfo()
Julia Version 1.11.0-rc3
Commit 616e45539db (2024-08-2615:46 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU:16× AMD Ryzen 98945HS w/ Radeon 780M Graphics
WORD_SIZE:64
LLVM: libLLVM-16.0.6 (ORCJIT, znver3)
Threads:16 default, 0 interactive, 8 GC (on 16 virtual cores)
Environment:
JULIA_NUM_THREADS = auto
The text was updated successfully, but these errors were encountered:
Describe the bug 🐞
followup on #2895
The recently introduced handling of complex variables in
@mtkmodel
#2935 leads to incorrect results. See MWE with different results within and without@mtkmodel
Expected behavior
Expansion of complex equations should yield the same result regardless of construction method...
Minimal Reproducible Example 👇
Environment (please complete the following information):
using Pkg; Pkg.status()
versioninfo()
The text was updated successfully, but these errors were encountered: