Info

This question is closed. Reopen it to edit or answer.

Error in dsolve or my error?

1 view (last 30 days)
Jason Terry
Jason Terry on 19 Apr 2018
Closed: MATLAB Answer Bot on 20 Aug 2021

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
Walter Roberson on 19 Apr 2018
Your second version, the one you did by hand, is what Maple believes to be true as well.
Jason Terry
Jason Terry on 20 Apr 2018
Thanks for the feedback! So perhaps this is a logic error that Mathworks should be aware of...

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!