Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Solving 2nd order differential equation in MATLAB?

I have the following equation:

d2X/dt^2=-c1*dX/dt-c2*X+c3*sin(c4*t)

Where c(1-4) are constants.

I'm having problem entering the equation in my function m-file as don't know how to do it with dX/dt and X as well as with the function sin(t).

Main problem is then how will I get MATLAB to understand that dX/dt = D(X)

And that sin(t) is a function of time (no time vector inside function as I will use it in Ode45).

Should I try and break up the equation in some way or can i enter it as whole?

I hope you get my questions :)

Thanks in advanced!

1 Answer

Relevance
Still have questions? Get your answers by asking now.