matlab not displaying an approximated value of an improper integral?
Mostra commenti meno recenti
I want to calculate an approximate value of an improper integral:
>> fun= 4./(x.*(1-x).*(2-x).*(pi.^2+(log(x./(1-x)).^2))
>> vpa(int(fun,0,1))
then matlab displays the result:
ans =
vpaintegral(4/(x*(log(-x/(x - 1))^2 + 2778046668940015/281474976710656)*(x - 1)*(x - 2)), x, 0, 1).
how can I get the approximate value of this improper integral? thanks in advance.
6 Commenti
Hey Lahcen, I can not reproduce your results. Your fun variable is not correct. It seems there is a bracket missing at the end. But if I add it I do not get the answer you got. Have you done something beforehand? Can you show how you defined x and p? And make sure to "clear 'all'" at the start of the script
clear 'all'
syms x p
fun= 4./(x.*(1-x).*(2-x).*(p.^2+(log(x./(1-x)).^2))) % added bracket at the end
vpa(int(fun,0,1))
Dyuman Joshi
il 23 Ago 2023
Modificato: Dyuman Joshi
il 23 Ago 2023
"But if I add it I do not get the answer you got"
If you check the term given by OP as the result and the final output of your code, they are the same (with a value substituted for p)
You can try solving numerically, but as there are singularities at x==0 and x==1, the result will not be accurate -
%p^2 value taken from above
p2=2778046668940015/281474976710656;
fun= @(x) 4./(x.*(1-x).*(2-x).*(p2+(log(x./(1-x)).^2)));
integral(fun,0,1)
@Dyuman Joshi good catch. I saw that but did not realise that p is probably just this numerical value then
p = 2778046668940015/281474976710656
Lahcen
il 23 Ago 2023
I had an inkling because of the value but wasn't sure due to the format of the value -
sqrt(2778046668940015/281474976710656)
Lahcen
il 24 Ago 2023
Spostato: John D'Errico
il 28 Ago 2023
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su MATLAB in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!












