ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 08 Jun 2012 15:22:35 +0200Recurrence equation value errorhttps://ask.sagemath.org/question/9049/recurrence-equation-value-error/Hello,
As an anxious student I tried googling for an answer for 2hours without any result. I'm new Sagemath user.
I have to solve equation:
a[n+2]-4*a[n+1]+4*a[n]=2^n+cos(n*pi/2), a[0]=1, a[1]=2
My sage input is:
from sympy import *
y = Function('y')
n = Symbol('n',integer=True)
rsolve(y(n+2)-4*y(n+1)+4*y(n)-2^n-cos(n*pi/2), y(n), {y(0):1,y(1):2})
But I'm getting an error:
> ValueError: 'y' expected, got 'cos'
Sage has some problems with cosine function, any idea how to solve it?blu3Fri, 08 Jun 2012 15:22:35 +0200https://ask.sagemath.org/question/9049/