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))

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/7fe6b265-dc97-401f-aefc-86419c04164b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to