how to find the numeric solution for differential equations

i need to find the numeric solution for
3y''(t)+6y'(t)+3y=1
y(0)=1
y'(0)=-1/3
i have to use : diff, cond , dsolver, simplify and subs.

9 Comments

Look at the "dsolve" documentation. You will find many examples there similar to yours.
how can i use the cond function, i looked at the documentation and didnt find explanation
Take a look at the example "Solve differential equations with conditions" under
de.mathworks.com/help/symbolic/dsolve.html
It's almost a solution for your case.
yeah i saw it, it so close for my equation but my problem is that i have to use all of these: diff, cond , dsolver, simplify, subs and symbolic vary.
thats what i cant do..
I also don't know why subs and simplify should be necessary (or you did not report the exercise comletely).
What does Matlab give you as solution ?
i neet to get the numeric solution, this exercise is a part of project and they want us to use all of these functions.
the solution that matlab gives me is y(t)= exp(-t).*(t*(1/3)+2/3)+1/3. this is a right unswear for the differential equations but not the numeric solution.
And what is your definition of "numeric solution" ? Are you given some specified points t where you should evaluate y(t) ? Or do you want to plot the solution over a specified interval ?
If you named your solution ysol, then
t = 0:0.01:10;
ysolt = subs(ysol(t))
should give you the corresponding vector of function values.

Sign in to comment.

Answers (0)

Categories

Asked:

on 23 May 2021

Commented:

on 23 May 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!