I am obliged to give a huge lot of command since the equations in my systems 
are derived. Sorry the comments are in french but they are not important;
var('a x y p_x p_y D Rev R l')
assume(a,'real')
assume(x,'real')
assume(y,'real')
assume(p_x,'real')
assume(p_y,'real')
assume(D,'real')
assume(Rev,'real')
assume(R,'real')
assume(l,'real')
assume(l>0)
#assume(a>-1)
assume(a>0)
assume(p_x>0)
assume(p_y>0)
assume(R>0)
U =(1/(1-(1/a)))*x^(1-(1/a))+y
show(LatexExpr(r'\text{La fonction d}^\prime\text{utilité est }U(x,y) = '),U)
D= x*p_x + y*p_y
show(LatexExpr(r'\text{La Dépense } D = '),D)
Rev= R
show(LatexExpr(r'\text{Le Revenu } Rev = '),R)
L=U+l*(Rev-D)
show(LatexExpr(r'\text{Le lagrangien est } \mathcal{L}(x, y, λ) = '),L)
FOC = [diff(L,x),diff(L,y),diff(L,l)]
show(LatexExpr(r'\text{Les condition du premier ordre sont } 
\left\{\begin{array}{c}\mathcal{L}_x= 0\\\mathcal{L}_y= 0\\\mathcal{L}_λ= 
0\end{array}\right. '))
show(LatexExpr(r'\text{soit }'))
show(LatexExpr(r'\mathcal{L}_x= 0 \Longleftrightarrow '),FOC[0]==0) 
show(LatexExpr(r'\mathcal{L}_y= 0 \Longleftrightarrow '),FOC[1]==0)
show(LatexExpr(r'\mathcal{L}_λ= 0 \Longleftrightarrow '),FOC[2]==0)
sol = solve([FOC[0]==0,FOC[1]==0,FOC[2]==0],x,y,l, algorithm="sympy")
xs=sol[0][x]
ys=sol[0][y]
ls=sol[0][l]
show(LatexExpr(r'\text{À l}\'\text{optimum, on a :}'))
show(LatexExpr(r' \,\,\,\,\,\,\,\,\, x^d = '),xs)
show(LatexExpr(r' \,\,\,\,\,\,\,\,\, y^d = '),ys)
show(LatexExpr(r' \,\,\,\,\,\,\,\,\, \lambda^\star = '),ls)
show(LatexExpr(r'\text{Si le bien } y \text{ sert de numéraire, on a : }p_y =1 
\text{ et, ainsi :}'))
xsn=xs.substitute(p_y=1).factor()
ysn=ys.substitute(p_y=1).factor()
lsn=ls.substitute(p_y=1).factor()
show(LatexExpr(r' \,\,\,\,\,\,\,\,\, x^\star = '),xsn)
show(LatexExpr(r' \,\,\,\,\,\,\,\,\, y^\star = '),ysn)
show(LatexExpr(r' \,\,\,\,\,\,\,\,\, \lambda^\star = '),lsn)
show(LatexExpr(r'\text{On a :}'))
x_p=diff(xsn,p_x).simplify()
show(LatexExpr(r'x_p = '),x_p,LatexExpr(r'< 0.'))var('C c')
assume(c, 'real')
assume(c>0)
C= (1/2)*c*x^2
show(LatexExpr(r'\text{On suppose que la fonction de coût du producteur est : } 
C(x) ='), C)
pi=(p_x *x- C)
show(LatexExpr(r'\text{ Le profit est : } \pi(x) = '), pi)
pip= diff(pi,x)
show(LatexExpr(r'\text{ Le profit marginal est : } \pi^\prime(x) = '), pip, 
LatexExpr(r'( = 0\text{ à l}^\prime\text{optimum})'))
pipp= diff(pi,x,2)
show(LatexExpr(r'\text{ il s}^\prime\text{agit bien d}^\prime\text{un maximum 
puisque : } \pi^{\prime\prime}(x) = '),pipp,LatexExpr(r'<0'))
prod=solve(pip==0,x)[0].rhs()
show(LatexExpr(r'\text{L}^\prime\text{offre de produit est : } x^o = 
'),prod)Until there all is fine now I use some results from above to avaluate 
an equilibrium. But now  it seems that maxima need to know if a certain 
variable is an integer (but I do not see which since I have tried to gives the 
more extended assumptions.I wonder if this is because my variable is p_x which 
is not understood by maxima ?show(LatexExpr(r'\text{L}^\prime\text{équilibre de 
concurrence pure et parfaite est caractérisé par le système 
d}^\prime\text{équations : } '))
show(LatexExpr(r'x^d = x^o'))
show(LatexExpr(r'x^d = '),xsn)
show(LatexExpr(r'x^o = '),prod)
pem= solve(xsn==prod, p_x)[0].rhs()
show(LatexExpr(r'\text{Le prix d}^\prime\text{équilibre du marché est : } p_x^E 
= '),pem)
qem = prod.subs(p_x=pem).simplify()
show(LatexExpr(r'\text{La quantité d}^\prime\text{équilibre du marché est : } 
q^E = '),qem)Also I need the inverse function of 'xsn' (look just above) as a 
function of x. I have tried many thing found here and there but even if some 
times I have the good result it is not considered as a function.Thanks for help

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/1091423200.6245539.1638295441317.JavaMail.zimbra%40univ-orleans.fr.

Reply via email to