Using dsolve gives a different solution than Wolfram Alpha

I'm trying to solve a differential equation (1x''+8x'+16x=50*e^(-t)*unit step(t),x(0)=0,x'(0)=0) using dsolve:
dsolve('1*D2x + 8*Dx + 16*x == 50*exp(-t)*heaviside(t)','x(0) == 0', 'Dx(0) == 0')
and it returns:
-Inf*sign(t)
Obviously, trying to eval is going to give a pretty meaningless result. So I decided to throwing it into Wolfram Alpha:
{1 x''[t] + 8 x'[t] + 16 x[t] == (50 UnitStep[t])/E^t, x[0] == 0, x'[0] == 0}
where it returned:
{x[t] == (50 (-1 + E^(3 t) - 3 t) UnitStep[t])/(9 E^(4 t))}
Am I not using heaviside correctly? Is there something simple I'm missing? I have no idea where to start debugging the problem, because it's just a built in function.

4 件のコメント

@Johannes
@Johannes 2015 年 10 月 23 日
I found a similar problem from another user.
In my opinion you could contact the tech. support of the mathworks to clarify your issue.
Best regards, Johannes
light_dark
light_dark 2015 年 10 月 24 日
So I tried the second method where I use a constant instead of the heaviside function in dsolve and it appears to give the correct solution, but when I use subs to replace the constant with the heaviside function, I end up getting what appears to be an array of solutions (first element is 0, the rest all look to the solution), with the length of the heaviside function. Why does this happen? I'm thinking that it's substituting at each value of the heaviside function.
@Johannes
@Johannes 2015 年 10 月 28 日
I tried the second method in R2015b too. I don't get an array of solutions. I get a symbolic variable which contains the substituted solution. Plotting this solution leads to the same plot as wolfram alpha delivers. Not sure if i misunderstand you.
Best regards,
Johannes
Walter Roberson
Walter Roberson 2015 年 10 月 28 日
I would try recoding in terms of diff() instead of replying on the D parser. The initial condition D(0) might require some investigation to recode though.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

質問済み:

2015 年 10 月 23 日

コメント済み:

2015 年 10 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by