Just make your initial condition complex? Otherwise your solution is trying to change from real to complex at some point in the domain, and Julia doesn’t like that: it wants the ^ function to be type-stable (not change output types depending on the value of the inputs) for performance reasons.