Re: using a previous result
- To: mathgroup at smc.vnet.net
- Subject: [mg67345] Re: [mg67324] using a previous result
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Mon, 19 Jun 2006 00:00:59 -0400 (EDT)
- Reply-to: hanlonr at cox.net
- Sender: owner-wri-mathgroup at wolfram.com
q1 = a + b*p1 + g*p2;
q2 = c + d*p2 + e*p1;
{profit1,profit2}={p1*q1,p2*q2}/.
Solve[{
D[profit1,p1]==0,
D[profit2,p2]==0},
{p1,p2}][[1]]//Simplify;
Bob Hanlon
---- ridley_david at yahoo.com wrote:
> Once I've solved a system of equations, I would like to use the
> previous results in future equations. If my output is {{p1->x,p2->y}}
> how do I assign those values as p1star and p2star so I can reuse them?
>
> Thank you,
> David
>
> For example:
> q1=a+b p1 +g p2;q2 = c+d p2 + e p1;profit1=p1 q1;profit2=p2 q2;
> FullSimplify[Solve[{D[profit1,p1]==0,D[profit2,p2]==0},{p1,p2}]]
>