# Conditional expression exponential equation solving

Module[
{
A = 40 acre, h = 30 ft, por = 0.3, Swi = 0.38, Boi = 1.2,
pini = 6000 psi, pbubble = 930 psi, rf = 0.23,
cr = 3*10^-6  1/psi, cw = 2*10 ^ -6 1/psi, co = 5*10^-5 1/psi,
porvoli, watvoli, OOIP, Np, porvol2, watvol2, Bo2, fmatbal2, soldp2
},
(*calculations*)
porvoli = A*h*por;
watvoli = porvoli Swi;
OOIP = porvoli (1 - Swi)/Boi;
Np = OOIP rf;
(*functions of depletion*)
porvol2[dp_] = porvoli Exp[- cr dp];
watvol2[dp_] = watvoli Exp[+ cw dp];
Bo2[dp_] = Boi Exp[+ co dp];
(*material balance equation*)
fmatbal2[Np_,
dp_] = (OOIP - Np) == (porvol2[dp] - watvol2[dp])/ Bo2[dp];
soldp2 = dp /. Solve[fmatbal2[Np, dp], dp] // First // Simplify;
Grid[{{"Final pressure calculated by using exponential approximation
is", (pini - soldp2)/psi, "psi"}}, Frame -> All] // nf
]


Then the results show that:

ConditionalExpression[
0.000145(9.259*10^6-(0.+(4.332*10^10) I) C[1]), C[1] ∈ Integers]


Which is not a number result, I run the similiar solve function with linear approximation and it works well, I am a new user of Mathematica, I am not sure what does conditionalexpression mean and got stuck here.

• Did you try looking up ConditionalExpression in the documentation? Feb 3, 2016 at 4:18

1. You did not give us a definition for the function nf in your expression, so I left it off.
2. The conditional expression is generated by Solve because by default it looks for complex solutions, not just real ones. You can ask Solve to find only real solutions though: using Solve[fmatbal2[Np, dp], dp, Reals] instead of your Solve expression. This immediately returns $1343.01\ \text{psi}$ as the final answer, with no ConditionalExpression.
• Alternatively, add /. C[1] -> 0 // Chop to the end of the ConditionalExpression, but your solution is better. Feb 3, 2016 at 18:35