Ask Your Question
0

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
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-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)
11592740743/1000000
edit flag offensive delete link more

Comments

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

Stats

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

Seen: 858 times

Last updated: Apr 08 '16