Need help with difference equation
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello, Consider the difference equation:
y(n + 2) + y(n + 1) + y(n) = 0, y(1) = y(2) = 1.
Compute y(3), y(4), y(5), y(6), y(7).
I understand how this can be done on paper, but it is not too easy to count. How it can be done in Matlab? My solution:
y(n)=c*z^n
c*z^(n+2)-c*z^(n+1) - c*z^n=0
c*z^n*(z^2-z-1)=0
z1=(1+sqrt(5))/2
z2=(1-sqrt(5))/2
y(n) = c1*((1+sqrt(5))/2)^n + c2 * ((1+sqrt(5))/2)^n
y(1)=c1*((1+sqrt(5))/2) + c1*((1+sqrt(5))/2) =1
y(2)=c1*((1+sqrt(5))/2)^2 + c2 * ((1+sqrt(5))/2)^2=1
Further solving the system can obtain the unknown constants ... but they are too attractive for mental calculations.
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2012년 10월 27일
편집: Azzi Abdelmalek
2012년 10월 27일
It's easier to solve it in discret time domain
y(1)=1
y(2)=1
for n=3:7
y(n)=-y(n-1)-y(n-2) % equivalent to y(n+2)=-y(n+1)-y(n)
end
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Signal Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!