| 1 | initial version |
Managed to figure out this problem. I found that if you define your constraints in the context of the solve() function we get a clearer picture. The contract curve from consumer A's perspective is given by the following:
xa1, xa2, xb1, xb2, a, b, R1, R2 = var('xa1, xa2, xb1, xb2, a, b, R1, R2')
Ua = xa1^a * xa2^b;
Ub = xb1^a*xb2^b;
MUa1=Ua.diff(xa1)
MUa2=Ua.diff(xa2)
MUb1=Ub.diff(xb1)
MUb2=Ub.diff(xb2)
MRSA=MUa1/MUa2
MRSB=MUb1/MUb2
solve([MRSA==MRSB,R1==xa1+xb1,R2==xa2+xb2],xa1,xb1,xb2)
Out: [[xa1 == R1*xa2/R2, xb1 == (R1*R2 - R1*xa2)/R2, xb2 == R2 - xa2]]
If we were to conciser consumer B's perspective we have to only change the last line of code to:
solve([MRSA==MRSB,R1==xa1+xb1,R2==xa2+xb2],xa1,xb1,xa2)
Out: [[xa1 == (R1*R2 - R1*xb2)/R2, xb1 == R1*xb2/R2, xa2 == R2 - xb2]]
The reason why we need to change this last line of code is due to the nature of the solver.
Pretty happy with this result.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.