ode-solvers icon indicating copy to clipboard operation
ode-solvers copied to clipboard

it seems not possible to use mixed-type-structs as "State"

Open exo-cortex opened this issue 3 years ago • 1 comments

experimenting around with this package I realized that it does not seem possible to use a custom struct (in my case with one complex type and one normal f64 type).

I wanted to implement a lang-kobayashi laser equation (two coupled differential equations, one "E" for the electric field, which is complex, and one "n" representing the number of excited states (or fraction thereof).

Is this package designed to only be used with vectors? or is it possible to have combinations of complex and real states? (these mixed states are often needed in various laser system equations.

exo-cortex avatar Feb 27 '22 11:02 exo-cortex

Since a "normal" type can be seen as a complex number with no imaginary part, you might be able to define the type as type State = Vector2<Complex>. I'm not familiar with solving ODEs with complex numbers so I'm not sure if this would work though.

srenevey avatar Feb 28 '22 01:02 srenevey