Help with basic matlab
Afficher commentaires plus anciens
Thanks for reading my question
When I use dsolve in an ivp I get this ans:
dsolve('Dy = -yt + sin(3t) - cos(t.01) + 3sin(7*t)', 'y(0) = 0')
ans =
exp(-t^2/2)*int(exp(x2/2)(sin(3x) - cos(x/100) + 3sin(7x)), x = 0..t, IgnoreAnalyticConstraints)/exp(t2/2)
I would like to know how can I evaluate it in the interval t=0:h:20, dom =[0 20] if h=(5,5/2,5/4,....), if i just simply eval, matlab shows an error even if i ignore the analytic constraints.
Error using sym/eval (line 11)
Error: Unexpected MATLAB expression.
I think it is because eval does't work with integrals.
1 commentaire
Walter Roberson
le 14 Mai 2013
Your notation is a bit ambiguous. Are you attempting to do
dsolve('diff(y(t), t) = -y(t)+sin(3*t)-cos((1/100)*t)+3*sin(7*t)', 'y(0) = 0')
If you are then,
y(t) = -(3/10)*cos(3*t) + (1/10)*sin(3*t) - (10000/10001)*cos((1/100)*t) - (100/10001)*sin((1/100)*t) - (21/50)*cos(7*t) + (3/50)*sin(7*t) + (430018/250025)*exp(-t)
I do not find any useful simplifications of that.
Réponses (0)
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!