Solving integral using matlab
20 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
i need to find a percentage error between 1) and 2)
1) finding integral using "int" function (numerical result) i was able to run it easily using
fun = @(x) (exp(x)./(10*x-1));
Q2 = vpa (integral(fun, 0, 200))
BUT, when i did
2) finding integral using symbolic math tool box (exact value), I GOT X2 =NaN
syms x
X2 = vpa(int(exp(x)./(10*x-1),0,200))
MY QUESTION IS: WHY NaN
here is the picture of a question

0 Commenti
Risposte (1)
Walter Roberson
il 28 Mar 2021
The denominator of the function has 10*x-1 . The range of x values passes through 1/10, at which point 10*(1/10) - 1 = 1 - 1 = 0. Therefore the function passes through exp(1/10)/0 . From below, 10*x-1 is negative, so from below it approaches negative infinity as x gets closer to 1/10, and from above 10*x-1 is positive, so it approaches positive infinity from the right of x = 1/10.
So... you have a classical non-removal discontinuity, and there is no Cauchy Principal Value available either. So the integral is undefined, which MATLAB signals to you as NaN.
0 Commenti
Vedere anche
Categorie
Scopri di più su Calculus in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!