solution of differential equation
Show older comments
Hi everyone, how could I solve dx/dt + x = sqrts(sin^2(t)) on Matlab? I tried with statements:
close all clear all t=[0:0.001:10]; s1=dsolve('Dx + x = abs(sin(t))','t'); pretty(s1)
but it evaluates a wrong solution. This is wrong:
C3*exp(-t) - (2^(1/2)*cos(pi/4 + t))/2
This is right:
Sqrt[Sin[t]^2]/2 - (Cot[t]*Sqrt[Sin[t]^2])/2 + C/exp(t)
Thank you for your help.
1 Comment
John D'Errico
on 5 Jun 2016
I see that you changed the problem, adding a sqrt where one was not before. Worse, you did not even change the solution that DOES result from the original problem as posed.
So, have you tried to solve this problem? See that solve generates a completely different solution, assuming that you really intended sqrt instead of the syntactically invalid sqrts?
Accepted Answer
More Answers (0)
Categories
Find more on Common Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!