using dsolve, ways to get particular solution only?
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
David Arnold
il 12 Feb 2018
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
il 12 Feb 2018
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)
Risposte (1)
Mischa Kim
il 21 Ott 2014
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 Commenti
Vedere anche
Categorie
Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!