using dsolve, ways to get particular solution only?
조회 수: 7 (최근 30일)
이전 댓글 표시
I am teaching an undergraduate Ordinary Differential Equations Class.
Working with non-homogeneous equations, (second order, linear)
Want to use dsolve to get a particular solution only.
Specifically:
sol=dsolve('D2y-5*Dy+6*y==exp(t)*cos(2*t)+exp(2*t)*(3*t+4)*sin(t)','t')
When executed, we get a result of both complimentary and particular solution.
Is there anyway to configure dsolve to present only the particular solution?
Thanks Paul
댓글 수: 2
David Arnold
2018년 2월 12일
I just tried this:
syms t y(t)
sol=dsolve(diff(y,t,2)-5*diff(y,t)+6*y==exp(t)*cos(2*t)+exp(2*t)*(3*t+4)*sin(t),t);
sol=simplify(sol);
yp=subs(sol,symvar(sol),[0,0,t])
Walter Roberson
2018년 2월 12일
When you use the syms version as David shows, then in some situations it can help to add assumptions to variables. For example
syms y(t)
syms t nonnegative
syms B
assume(B>1)
답변 (1개)
Mischa Kim
2014년 10월 21일
Paul, I am not aware of a setting that would allow you to print the particular solution, only.
You can, however, eliminate the general solution by hand. E.g.,
sol = dsolve('D2y-5*Dy+6*y==exp(t)*cos(2*t)+exp(2*t)*(3*t+4)*sin(t)','t')
sv = symvar(sol);
sol_par = subs(sol,sv,[zeros(1,numel(sv)-1) sv(3)])
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!