Can anyone give me a solution to a differential equation of the following form:
y=A sin(wt) - ky' - c
where A,w, k and c are constants, y is a function of t and y' is dy/dt.
What is y(t)?
$\displaystyle y = A\sin{(\omega t)} - k\frac{dy}{dx} - c$
$\displaystyle k\frac{dy}{dt} + y = A\sin{(\omega t)} - c$
$\displaystyle \frac{dy}{dt} + \frac{1}{k}y = \frac{A}{k}\sin{(\omega t)} - \frac{c}{k}$.
This is first order linear, so use the integrating factor method.
The integrating factor is $\displaystyle e^{\int{\frac{1}{k}\,dt}} = e^{\frac{t}{k}}$.
So multiplying through by the integrating factor gives
$\displaystyle e^{\frac{t}{k}}\frac{dy}{dt} + \frac{1}{k}e^{\frac{t}{k}}y = \frac{A}{k}e^{\frac{t}{k}}\sin{(\omega t)} - \frac{c}{k}e^{\frac{t}{k}}$
$\displaystyle \frac{d}{dt}(e^{\frac{t}{k}}y) = \frac{A}{k}e^{\frac{t}{k}}\sin{(\omega t)} - \frac{c}{k}e^{\frac{t}{k}}$
$\displaystyle e^{\frac{t}{k}}y = \int{\frac{A}{k}e^{\frac{t}{k}}\sin{(\omega t)} - \frac{c}{k}e^{\frac{t}{k}}\,dt}$.
You should be able to go from here. You will need to use integration by parts twice.
Well that made my brain hurt but I think I'm there. There is a useful similar example of twice integrating by parts on wikipedia. I've ended-up with something like
y=A (sin(wt) + w k cos(wt)) / (1-k w^2) - c
Please excuse my lack of mark-up.
I'll need to double check but it looks plausible and whats more, I'm surprised to find I can probably use the result!
In case you are wondering I'm trying to model charging a battery or capacitor from an altenator including the self inductance of the altenator. Many thanks again Prove It please spend the rest of the day with a warm glow of having helped some one a great deal.
Edit:
After going through a bit more carefully, I have
y=A (sin(wt) - w k cos(wt)) / (1 + k^2 w^2) - c
which I have put back into the original ODE and verified to be a solution of it.
For a first order DE of the form...
$\displaystyle \displaystyle y^{'}= \alpha(t)\ y + \beta (t)$ (1)
... the general solution is...
$\displaystyle \displaystyle y= e^{\int \alpha(t)\ dt}\ \{ \int \beta(t)\ e^{-\int \alpha(t)\ dt}\ dt + \chi \} $ (2)
Here is...
$\displaystyle \displaystyle \alpha(t) = -\frac{1}{k}$
$\displaystyle \displaystyle \beta (t) = -\frac{a}{k}\ \sin \omega t - \frac{c}{k} $
... and with little computation [if no mistakes from me ...] You should find...
$\displaystyle \displaystyle y(t) = \chi\ e^{-\frac{t}{k}} + \frac{a\ \cos \omega t + \omega\ k\ \sin \omega t}{1+ k^{2}\ \omega^{2}} + c$ (3)
Kind regards
$\displaystyle \chi$ $\displaystyle \sigma$
Thanks chisigma.
Interesting how the answer I've got differs from the one you give.
Mine lacks the first term in chisigma's answer probably due to my laziness in omitting constants of integration here and there, but I'm fairly confident they can be neglected for my purposes. It also differs in that the cos and sin are switched and the sign of the second of them is switched. Believe they probably both solve the DE. As it happens, I think, chisigma's answer (with chi=0) better describes the situation I'm trying to model. Will check it is a valid soln....