Declare type of @variable (e.g. complex) in ModelingToolkit.jl

Is there a way to declare the type of a variable in ModelingToolkit.jl? For example something like

@variables a(t)::complex

I’m excited to start with ModelingToolkit.jl having followed its development for a while. In my field (power systems) complex variables are ubiquitous and the model is a mixture between complex and real variables. I haven’t found a way to unambiguously declare a variable as complex. I tried to use the initial conditions that are passed the
ODEProblem but this doesn’t seem to work. I think it needs to be done before simplifying the model (structural_simplify).
The current behavior is also that some real variables are assumed complex.

It’s coming fairly soon but you can’t at this moment.


Thanks for the prompt reply.


Apologies for bumping this old thread, is there any update on the use of complex variables in modelingtoolkit?

Looking forward.

The stuff here was implemented, but it’s still early.