I'm trying to plug in complex values in the numerical solutions of ODEs without success. For instance

y[I] /. NDSolve[{y'[x] == 0, y[0] == 3}, y, {x, -10, 10}]

doesn't give the $3$ I'm expecting. Is there a way to work with a complex variable $x$ in NDSolve?


  • $\begingroup$ The underlying algorithms can only deal with real independent variables, I'm afraid. Why not make a substitution that incorporates the contour along which you want to integrate? $\endgroup$ – J. M. is in limbo Aug 23 '15 at 14:34
  • $\begingroup$ @Guesswhoitis. I see. What contour are you referring to? the one from $0$ to $i$? $\endgroup$ – user1337 Aug 23 '15 at 14:41
  • $\begingroup$ Yes, that.$\phantom{}$ $\endgroup$ – J. M. is in limbo Aug 23 '15 at 14:51
  • $\begingroup$ @Guesswhoitis. I can indeed do that. But this is a relatively simple example. I don't think it's that simple when you have higher order, more complicated ODEs. I must say I'm surprised that mathematica has no tools to deal with such things. Do you know of any other mathematical software that do? $\endgroup$ – user1337 Aug 23 '15 at 14:53
  • $\begingroup$ None offhand; most users of DE solvers might consider complex-valued ODEs, but not ODEs with complex independent variables. Anyway, can you give an example of an ODE where you think a variable substitution will be unwieldy? $\endgroup$ – J. M. is in limbo Aug 23 '15 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.