Ask Your Question

Evaluate whatever rsolve returns. Recurrence relations

asked 2016-04-05 12:32:34 -0500

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-05 19:57:36 -0500

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 11:27:42 -0500 )edit

@brayn92298: if this answers your question, please click the tick mark to mark the answer as accepted.

slelievre gravatar imageslelievre ( 2016-04-07 20:07:32 -0500 )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 12:32:34 -0500

Seen: 93 times

Last updated: Apr 07 '16