Why does Mathematica not solve this simple integral (using units)?

GROUPS:
 I am trying to find the volume of a PFR reactor. For this purpose I have written the rate expression as a function of conversion, and stuffed it in to an integral. I am using the AutomaticUnits package by Jon McLoone.The problem is that when I execute the equation containing the integral, Mathematica starts working, but returns no result. I abort the operation after waiting what I would call suffcient time :-)  My setup is seen below: rA[X_] := k*((1 - X)/(1 + 2* X)*P/(R  T) - (       X/(1 + 2 *X)*P/(R  T)*((2*X)/(1 + 2 *X) *P/(R  T))^2)/       kc) /. {k -> 0.0440238  Minute^-1,      kc -> 0.025  Mol^2* Liter^-2} //. {P -> 10  Atmosphere,     T ->  127  Kelvin + 273.15  Kelvin,     R -> 0.08205746  (Liter*Atmosphere)/(Kelvin*Mol)}   V == FA0*\!$$\*SubsuperscriptBox[\(\[Integral]$$, $$0$$, $$.9*0.512618$$]$$\*SuperscriptBox[\(rA[X]$$, $$-1$$] \[DifferentialD]X\)\)  /. {FA0 ->    2.5  Mol Minute^-1}I have investigated it for a long time now, and have found out the following:If I remove the Units, the expression Evaluates as it is supposed to.If I keep the units, and take the reciprocal of 1/rA   (   so just rA   ), it evaluates. Not with the correct answer of course.I have done the exact same operations once before, but with a much smaller function rA, which worked!I am pretty much on bare ground, and hope someone can help me by pointing out my mistakes. I am afraid the answer is obvious, but I have stared too much at the same two lines of code, and have hence become immune toward finding a solution.I am using Mathematica 9.Best RegardsSimon P.
4 years ago
5 Replies
 Bruce Miller 1 Vote What do you get as a result?   I hope I decyphered the linear syntax of your second input correctly.  In[1]:= \$Version Out[1]= "9.0 for Mac OS X x86 (64-bit) (January 24, 2013)"  In[2]:= rA[X_] := k*((1 - X)/(1 + 2*X)*        P/(R T) - (X/(1 + 2*X)*P/(R T)*((2*X)/(1 + 2*X)*P/(R T))^2)/        kc) /. {k -> 0.0440238 Minute^-1,     kc -> 0.025 Mol^2*Liter^-2} //. {P -> 10 Atmosphere,    T -> 127 Kelvin + 273.15 Kelvin,    R -> 0.08205746 (Liter*Atmosphere)/(Kelvin*Mol)}In[3]:= V == FA0*Integrate[ 1/rA[x], {x, 0, 0.9*0.512618}] /. {FA0 -> 2.5 Mol Minute^-1}Out[3]= V == 270.514 LiterDo you mean "V=" at the end?
4 years ago
 Hello Bruce,Thank you for your reply!You have decyphered it all correctly. I am sorry you had to do that. I use the *dintt* method in Mathematica, and so it pasted it oddly. When I remove the units in the function rA and calculate, I get the same result as you in a matter of seconds (270.514 Liters), which is what I would expect. Nevertheless, when I execute the "V==" with units in rA, Mathematica just keeps running, without finding anything. So after waiting a long time, I just abort. Naturally I would like to calculate the expression with units. Add why does it help reciprocating the reciprocal ( 1/rA )?What is funny, we run the same operating system, and the same version of Mathematica. Thus I do not get why it does that. Did you use the AutomaticUnits package when you executed?Best RegardsSimon P.