![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/490140/image.png)
please help me (dsolve)
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
im sure its correct but it doesnt work
w=dsolve('D2y+0.5*Dy+y=3','y(0)=0.5,Dy(0)=0');
matlab 2018
im grateful for your help
0 commentaires
Réponse acceptée
Star Strider
le 16 Jan 2021
The single quotation marks are likely the problem.
Try this slightly edited version:
syms y(t)
Dy = diff(y);
D2y = diff(Dy);
w = dsolve( D2y+0.5*Dy+y == 3, y(0) == 0.5, Dy(0) == 0 );
w = simplify(w, 'Steps',250)
figure
fplot(w, [0 30])
grid
xlabel('t')
ylabel('w(t)')
ltxw = latex(w);
title(['$w(t) = ' ltxw '$'], 'Interpreter','latex')
producing:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/490140/image.png)
.
Plus de réponses (1)
Mischa Kim
le 16 Jan 2021
Use instead
syms y(t)
eqn = diff(y,t,2) + 0.5*diff(y,t) + y == 3;
Dy = diff(y,t);
cond = [y(0) == 0.5, Dy(0) == 0];
w = dsolve(eqn,cond)
Voir également
Catégories
En savoir plus sur Calculus dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!