I'm experiencing different results when integrating the following part of a code:
$Assumptions = {T > 298, P > 0};
ktccx = 70 - 0.01*(T - 298.15);
Vcc = (1 - 4*P/(4*P + ktccx))^(1/4);
dLGcc = Integrate[Vcc, {P, 0, P}]
Mathematica 8.0.4 returns:
ConditionalExpression[
1.33333 (-0.25 +
0.707107 ((18.2454 + P - 0.0025 T)/(72.9815 - 0.01 T))^(
3/4)) (72.9815 - 0.01 T), P - 0.0025 T < -18.2454 || T <= 7298.15]
Mathematica 11.0.1 returns:
ConditionalExpression[(-0.00333333 + 6.16298*10^-35 I) (-1. +
1. (((7298.15 -
3.02923*10^-28 I) + (400. - 4.89859*10^-14 I) P - (1. -
4.93038*10^-32 I) T)/(7298.15 - 1. T))^(3/4)) (-7298.15 +
1. T), P - 0.0025 T <= -18.2454 || T <= 7298.15]
The latter shows Complex numbers and rest of the code crashes when dealing with variable dLGcc
. Why this occurs? Any hint on this issue? The goal is to use the same code on Mathematica ver. 11, and get rid of the imaginary part.
Integrate[(1 - 4 s/(4 s + (70 - 1/100 (T - 29815/100))))^(1/4), {s, 0, P}, Assumptions -> T > 298 && P > 0]
. One can work withConditionalExpression
seamlessly, nevertheless if one needs there isNormal
, otherwise one should choose more specific assumptions. $\endgroup$NIntegrate
, it appears the V8.0.4 expression above is inaccurate. $\endgroup$Integrate
use algorithms that are not always numerically well-conditioned. I think that might be the source of the inaccuracy I mentioned. In any case it is usually better to use exact numbers with such solvers, as Artes suggested. $\endgroup$