Info
This question is closed. Reopen it to edit or answer.
Error in dsolve or my error?
1 view (last 30 days)
Show older comments
When I input to MATLAB:
dsolve('D2y-4*y=2*heaviside(t-2)','y(0)=1','Dy(0)=0','t')
The response I get is:
ans =
exp(-2*t)/2 + exp(2*t)/2 - sign(t - 2)/4 - 1/4
However, if I use the MATLAB functions laplace and ilaplace to solve the equation, MATLAB gives me:
ans =
exp(-2*t)/2 + exp(2*t)/2 + (heaviside(t - 2)*exp(4 - 2*t)*(exp(2*t - 4) - 1)^2)/4
I don't think these answers are equivalent. The latter answer matches what I got with pencil and paper. So either I've done something wrong or dsolve has a logic error.
Thanks. Jason.
2 Comments
Walter Roberson
on 19 Apr 2018
Your second version, the one you did by hand, is what Maple believes to be true as well.
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!