Simple ODE solution from MATLAB and Mathematic disagree
Show older comments
Hi, I have in the last 2 months been trying to solve the rather simple ODE:
aY''(x) + ibY'(x) -c = 0
initial condition Y(0) = B
and after checking, MATLAB and Wolfram alpha give two different solutions:
Can someone point me to a reproducible solution to this simple ODE ?
here are the respective codes and outputs:
MATLAB Online:
if true
% code
end
syms a b c Y(x) x B
eqn = (a)*diff(Y,x, 2) + (i*b)*diff(Y,x) == c;
cond = Y(0) == B;
Y(x) = dsolve(eqn, cond)
ANSWER: C + exp(-(b*x*1i)/a)*(B - C11) - (c*x*1i)/b
Wolfram alpha online input:
a*y''(x)+i*b*y'(x) -c = 0 initial condition y(0)=B
output:
(e^(-(ibx)/a)*(e^((ib*x)/a)*(ib*B - i*a*x) - i*a*C*e^((ibx)/a) + i*a*C))/c
As you can see, these are very different, and have completely different limits and behavior.
What is the true solution to this simple ODE?
and why can't such a simple procedure agree between two major programs as these used? Thanks!
Accepted Answer
More Answers (1)
Sergio Manzetti
on 14 Dec 2017
0 votes
Categories
Find more on Mathematics 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!