Hello,
Following code:
syms a realsyms x(t)assume(x(t), 'real')ode = diff(x,t) == a*x;odeSol = dsolve(ode);isreal(odeSol)
The solution to this simple ode is, according to MATLAB, not real, since
isreal(odeSol)
results in 0. But the solution in reality is of course real.
The imaginary part:
imag(odeSol) = a*imag(exp(t))
Seems like t is not interpreted as real. Any suggestions why this happens?
I have also tried
syms t real
but that does not help either.
Thanks for your help!
Best Answer