- #1
yoran
- 118
- 0
Hi, I'm trying to solve this recurrence equation.
Solve [tex]y[k+2]+y[k]=sin(k)[/tex].
The answer is already given, it's
[tex]y[k]=c_1sin(\frac{\pi}{2}k) + c_2cos(\frac{\pi}{2}k) + \frac{sin(k)+sin(k-2)}{2(1+cos(2))}[/tex]
First I solve the homogeneous equation.
[tex]y[k+2]+y[k]=0[/tex].
The characteristic function is
[tex]r^2+1=0[/tex]
This has two complex roots [tex]r=i[/tex] and [tex]r=-i[/tex].
Thus the general solution is
[tex]y[k]=c_1(i)^k+c_2(-i)^k[/tex]
If you change the notation for the complex numbers, then it gives
[tex]y[k]=c_1(cos(\frac{\pi}{2}k)+isin(\frac{\pi}{2}k)) + c_2(cos(\frac{-\pi}{2}k)+isin(\frac{-\pi}{2}k))[/tex]
After grouping together it gives
[tex](c_1+c_2)cos(\frac{\pi}{2}k) + (c_1-c_2)isin(\frac{\pi}{2}k)[/tex]
Apparently, the answer is without complex numbers so I guess they only keep the real part. Then it must be so that
[tex]c_1-c_2=0\Leftrightarrow c_1=c_2[/tex]
Then I get as solution
[tex]y[k]=2c_1cos(\frac{\pi}{2}k)[/tex]
which is not the same solution as the general solution in the answer. What did I do wrong?
I also tried to find a particular solution for the non-homogeneous equation. I tried as a solution
[tex]y[k]=\alpha sin(k)[/tex]
with [tex]\alpha[/tex] the parameter to determine. I don't this is the right solution. Can anyone help me with this problem?
Thanks,
Yoran
Homework Statement
Solve [tex]y[k+2]+y[k]=sin(k)[/tex].
The answer is already given, it's
[tex]y[k]=c_1sin(\frac{\pi}{2}k) + c_2cos(\frac{\pi}{2}k) + \frac{sin(k)+sin(k-2)}{2(1+cos(2))}[/tex]
Homework Equations
The Attempt at a Solution
First I solve the homogeneous equation.
[tex]y[k+2]+y[k]=0[/tex].
The characteristic function is
[tex]r^2+1=0[/tex]
This has two complex roots [tex]r=i[/tex] and [tex]r=-i[/tex].
Thus the general solution is
[tex]y[k]=c_1(i)^k+c_2(-i)^k[/tex]
If you change the notation for the complex numbers, then it gives
[tex]y[k]=c_1(cos(\frac{\pi}{2}k)+isin(\frac{\pi}{2}k)) + c_2(cos(\frac{-\pi}{2}k)+isin(\frac{-\pi}{2}k))[/tex]
After grouping together it gives
[tex](c_1+c_2)cos(\frac{\pi}{2}k) + (c_1-c_2)isin(\frac{\pi}{2}k)[/tex]
Apparently, the answer is without complex numbers so I guess they only keep the real part. Then it must be so that
[tex]c_1-c_2=0\Leftrightarrow c_1=c_2[/tex]
Then I get as solution
[tex]y[k]=2c_1cos(\frac{\pi}{2}k)[/tex]
which is not the same solution as the general solution in the answer. What did I do wrong?
I also tried to find a particular solution for the non-homogeneous equation. I tried as a solution
[tex]y[k]=\alpha sin(k)[/tex]
with [tex]\alpha[/tex] the parameter to determine. I don't this is the right solution. Can anyone help me with this problem?
Thanks,
Yoran