Ask Your Question

Evaluate whatever rsolve returns. Recurrence relations

asked 2016-04-05 19:32:34 +0200

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

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-04-06 02:57:36 +0200

tmonteil gravatar image

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

sage: q.subs(n,5)
edit flag offensive delete link more


Thank you!

brayn92298 gravatar imagebrayn92298 ( 2016-04-06 18:27:42 +0200 )edit

Your Answer

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

Add Answer

Question Tools


Asked: 2016-04-05 19:32:34 +0200

Seen: 888 times

Last updated: Apr 08 '16