Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
exo-cortex opened this issue Feb 27, 2022 · 1 comment
Open

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

exo-cortex opened this issue Feb 27, 2022 · 1 comment

Comments

@exo-cortex
Copy link

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.

@srenevey
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants