Converting Matlab ode45 into C with complex output
Show older comments
I tried using the Matlab coder tool in order to export my ode solver to C (hoping that I might get a run-time boost).
Since I am solving a Schrodinger equation my output should be a complex vector.
When I'm running my regular Matlab code, everything works just fine, but when the coder tool runs the check of the mex file, it returns an error - "the output data must be real when enforcing non-negativity...".
I couldn't find a place where it is stated that the Matlab coder can only convert ode45 with real input/output.
If it's not obvious, I didn't request the output to be real. I also tried defining both the input and the output as complex, and it didn't help.
Any suggestions?
Answers (1)
Torsten
on 20 Nov 2017
0 votes
"the output data must be real when enforcing non-negativity...".
But you seem to use the non-negativity option of ODE45 which doesn't make sense for complex output.
Best wishes
Torsten.
1 Comment
Daniel Cohen
on 20 Nov 2017
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!