Dsolve gives extra term
1 次查看(过去 30 天)
显示 更早的评论
Hello, Im calculating following third term function. I got the following answer without Matlab . However when solving the function with dsolve Matlab gives me this answer .
So my question is, where is this -1/2187 coming from? Is it possible to get rid of it somehow when using dsolve?
0 个评论
采纳的回答
Matt J
2023-11-16
编辑:Matt J
2023-11-16
syms y(x)
eqn = diff(y,x,3)+81*diff(y,x) == 3*x+8;
ytemp(x) = dsolve(eqn);
ysol(x)=dsolve(diff(y,x)==diff(ytemp,x))
2 个评论
Matt J
2023-11-16
编辑:Matt J
2023-11-16
Do you know where the number comes from
No, not exactly. I speculate dsolve converts this into a 4th order equation and then differentiates the solution to obtain y(x). If the linear terms are not collected together before the final differentiation step, a second constant results.
or can I use some command to remove it?
Yes, you can use the commands in my answer.
更多回答(1 个)
John D'Errico
2023-11-16
Why do you care?
Note that C1 is completely arbirtrary! C1 is an unknown constant!
So you can trivially add or subtract any constant from the result, and the solution is still as valid.
Once you apply initial conditions, then the constant will be absorbed. It will magically go away.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!