Ask Your Question
0

Evaluate whatever rsolve returns. Recurrence relations

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

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

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-04-05 19:57:36 -0600

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
edit flag offensive delete link more

Comments

Thank you!

brayn92298 gravatar imagebrayn92298 ( 2016-04-06 11:27:42 -0600 )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 -0600 )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

Stats

Asked: 2016-04-05 12:32:34 -0600

Seen: 121 times

Last updated: Apr 07 '16