Hi,
I am not able to do substitution of one expression into another. Can anyone tell me why. The last line of the code is throwing an error.
Thanks.
Ankur Sinha
P.S. I posted this message a while ago but am not able to see it in the topics. Apologies if this attempt leads to two posts.
from IPython.display import display, Math
from sympy import *
#Production
x = symbols('x')
#Tax
t = symbols('t')
#Level of automation (varies between 0 and 1)
l = symbols('l')
#Parameters
a,b,c,d,e,f,g,h = symbols('a b c d e f g h')
k,m,alpha = symbols('k m alpha')
#Solving firm's problem with automation tax
priceF = a - b*x
#Cost without automation
costWoutAutomation = d*x**2 + e*x + f
#Firm's profit
profitF = (1-alpha)*(priceF*x - costWoutAutomation)
#Solving
foc_x = diff(profitF,x)
optimal_x = solve(foc_x,x)
print(optimal_x)
print(optimal_x.subs(x,k))