First time here? Check out the FAQ!

Ask Your Question
0

Evaluate whatever rsolve returns. Recurrence relations

asked 8 years ago

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

sage: from sympy import *
sage: x = Function('x') 
sage: n = var('n')
sage: q = rsolve(x(n+1)-(1+(3/(100)))*x(n),x(n),{x(0):10000})
sage: q
10000*(103/100)**n

I want to evaluate the result , say q(5) , but i get the following: ''TypeError: 'Mul' object is not callable''. Can someone help me

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 8 years ago

tmonteil gravatar image

You should user the subs method to substitute n by 5 in your symbolic expression:

sage: q.subs(n,5)
11592740743/1000000
Preview: (hide)
link

Comments

Thank you!

brayn92298 gravatar imagebrayn92298 ( 8 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 8 years ago

Seen: 964 times

Last updated: Apr 08 '16