How to find general solution of second order differential equation
Show older comments
This is the first time I am using Matlab to solve differential equations and I have a question. I have the following second order differential equation:
y’’ + 0.2*y’ + 20000000*y = sin(2*pi*t)
How do I find the general solution of this equation?
Answers (2)
madhan ravi
on 21 Jun 2020
syms y(t)
ode = diff(y,2) + 0.3*diff(y) +...
2e7*y == sin(2*pi*t);
dsolve(ode)
13 Comments
madhan ravi
on 21 Jun 2020
You may want to rewrite the result in 'sincos'.
rewrite(dsolve(ode), 'sincos')
sun45
on 21 Jun 2020
madhan ravi
on 21 Jun 2020
vpa(dsolve(ode),5)
sun45
on 21 Jun 2020
madhan ravi
on 21 Jun 2020
doc rewrite
doc vpa
sun45
on 21 Jun 2020
madhan ravi
on 21 Jun 2020
doc dsolve
KSSV
on 22 Jun 2020
If you have initial conditions use ode45.
madhan ravi
on 22 Jun 2020
syms y(t)
dy = diff(y);
ode = diff(y,2) + 0.3*diff(y) +...
2e7*y == sin(2*pi*t);
Sol = dsolve(ode, y(0) == 1, dy(0) == 0);
fplot(matlabFunction(Sol))
sun45
on 22 Jun 2020
madhan ravi
on 22 Jun 2020
trange = [0, .01];
fplot(matlabFunction(Sol), trange)
sun45
on 22 Jun 2020
madhan ravi
on 22 Jun 2020
Edited: madhan ravi
on 22 Jun 2020
Well, first your question was how to find a general question. And in each question you keep adding an additional question in each question. Make some effort!! Experiment with rewrite(...) . You need to take differential equations class asap! Watch Cleve Moler’s videos!
Categories
Find more on Assumptions in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!