2
$\begingroup$

I have the following two codes:

In[1]:=f = 10^5;
u = 1;
m = (R1 + R3)/(c*R1*R3);
R1 = 100;
R3 = 100;
n = 100;
k = c*R1;
c = 100*10^(-9);
FullSimplify[
 f*Integrate[(Integrate[(((((u*Sin[2*Pi*f*x])*Sign[u*Sin[2*Pi*f*x]])/
             2) + ((u*Sin[2*Pi*f*x])/2)))*((Exp[-m*(t - x)])/k), {x, 
        0, t}])^2/n, {t, 0, 1/f}]]

Out[1]=(E^4 + (-1 + 
    E (-2 + E (1 + E) (-1 + 3 E))) \[Pi]^2)/(1600 E^4 (1 + \[Pi]^2)^2)

And:

In[2]:=f = 10^5;
u = 1;
m = (R1 + R3)/(c*R1*R3);
R1 = 100;
R3 = 100;
n = 100;
k = c*R1;
c = 100*10^(-9); 
FullSimplify[
 f*Integrate[(Integrate[(((((u*Sin[2*Pi*f*x])*Sign[u*Sin[2*Pi*f*x]])/
             2) + ((u*Sin[2*Pi*f*x])/2)))*((Exp[-m*(t - x)])/k), {x, 
        0, t}, Assumptions -> 
        u > 0 && f > 0 && t >= 0 && m > 0 && k > 0])^2/n, {t, 0, 1/f},
    Assumptions -> 
    n > 0 && u > 0 && f > 0 && t >= 0 &&  m > 0 && 
     k > 0], Assumptions -> 
  n > 0 && u > 0 && f > 0 && t >= 0 && m > 0 && k > 0]

Out[2]=(1 + (2 - 1/E^4) \[Pi]^2)/(1600 (1 + \[Pi]^2)^2)

They both are representing the same computation but gave different results, why is that? And which one is true?

$\endgroup$
0

1 Answer 1

2
$\begingroup$

The numeric integration confirms the former

f = 10^5;u = 1;m = (R1 + R3)/(c*R1*R3);R1 = 100;R3 = 100;n = 100;k = c*R1;c = 100*10^(-9);
g[t_?NumericQ] := (NIntegrate[(((((u*Sin[2*Pi*f*x])*
          Sign[u*Sin[2*Pi*f*x]])/2) + ((u*Sin[2*Pi*f*x])/
        2)))*((Exp[-m*(t - x)])/k), {x, 0, t}])^2/n;
f*NIntegrate[g[t], {t, 0, 1/f}]
(*0.000187112*)

in view of

N[(E^4 + (-1 + 
E (-2 + E (1 + E) (-1 + 3 E))) \[Pi]^2)/(1600 E^4 (1 + \[Pi]^2)^2)]
(*0.000187112*)

The superfluous assumptions may cause the incorrect result of the latter.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.