How to evaluate an integral?

Hello,
I would like to evaluate the following function which includes an integral. The aim is to get sth. like that: Var_beta_hat_direct = a kind of number. But I only get a symbolic expression and not a number.
Does anybody have an idea?
syms t
Var_beta_hat_direct=vpa(10681743549394799937933824491520*exp(int((140737488355328*exp(-8187485477687969/(4398046511104*(20*heaviside(t - 2000) + 40*heaviside(t - 3000) - 390*heaviside(t - 14000) + 330*heaviside(t)))))/8301382342175545, t, 0, 1671787363946201/274877906944)^(4831891999187463/1125899906842624))*exp(8187485477687969/1715238139330560)*((140737488355328*exp(-int((140737488355328*exp(-8187485477687969/(4398046511104*(20*heaviside(t - 2000) + 40*heaviside(t - 3000) - 390*heaviside(t - 14000) + 330*heaviside(t)))))/8301382342175545, t, 0, 1671787363946201/274877906944)^(4831891999187463/1125899906842624))*exp(-8187485477687969/1715238139330560)*int((140737488355328*exp(-8187485477687969/(4398046511104*(20*heaviside(t - 2000) + 40*heaviside(t - 3000) - 390*heaviside(t - 14000) + 330*heaviside(t)))))/8301382342175545, t, 0, 1671787363946201/274877906944)^(3705992092344839/1125899906842624))/8301382342175545 + (690270285598209*log(int((140737488355328*exp(-8187485477687969/(4398046511104*(20*heaviside(t - 2000) + 40*heaviside(t - 3000) - 390*heaviside(t - 14000) + 330*heaviside(t)))))/8301382342175545, t, 0, 1671787363946201/274877906944))*exp(-int((140737488355328*exp(-8187485477687969/(4398046511104*(20*heaviside(t - 2000) + 40*heaviside(t - 3000) - 390*heaviside(t - 14000) + 330*heaviside(t)))))/8301382342175545, t, 0, 1671787363946201/274877906944)^(4831891999187463/1125899906842624))*exp(-8187485477687969/1715238139330560)*int((140737488355328*exp(-8187485477687969/(4398046511104*(20*heaviside(t - 2000) + 40*heaviside(t - 3000) - 390*heaviside(t - 14000) + 330*heaviside(t)))))/8301382342175545, t, 0, 1671787363946201/274877906944)^(3705992092344839/1125899906842624))/9487294105343480 - (690270285598209*log(int((140737488355328*exp(-8187485477687969/(4398046511104*(20*heaviside(t - 2000) + 40*heaviside(t - 3000) - 390*heaviside(t - 14000) + 330*heaviside(t)))))/8301382342175545, t, 0, 1671787363946201/274877906944))*exp(-int((140737488355328*exp(-8187485477687969/(4398046511104*(20*heaviside(t - 2000) + 40*heaviside(t - 3000) - 390*heaviside(t - 14000) + 330*heaviside(t)))))/8301382342175545, t, 0, 1671787363946201/274877906944)^(4831891999187463/1125899906842624))*exp(-8187485477687969/1715238139330560)*int((140737488355328*exp(-8187485477687969/(4398046511104*(20*heaviside(t - 2000) + 40*heaviside(t - 3000) - 390*heaviside(t - 14000) + 330*heaviside(t)))))/8301382342175545, t, 0, 1671787363946201/274877906944)^(4268942045766151/562949953421312))/9487294105343480))

Respuestas (1)

Walter Roberson
Walter Roberson el 30 de En. de 2016

0 votos

All of those int() expressions are exactly the same. Pull that out of the expression and evaluate it and drop the result into the larger expression.
The result is about -2.546320960311438*10^28 by the way.

8 comentarios

Max
Max el 30 de En. de 2016
Editada: Walter Roberson el 30 de En. de 2016
Hello Walter,
first of all, thank you for your answer. I tried out your approach but I can´t get a result for the integral which repeats up to 9 times. My code is looking like that:
I=vpa(int((140737488355328*...
exp(-8187485477687969/(4398046511104*(20*...
heaviside(t - 2000) + 40*heaviside(t - 3000) - 390*heaviside(t - 14000) + 330*heaviside(t)))))/8301382342175545, t, 0, 1671787363946201/274877906944));
Can you tell me where the error occurred?
Walter Roberson
Walter Roberson el 30 de En. de 2016
What result do you get for that?
The Maple based symbolic toolbox that I am using gives 0.6449536423
By the way, since you are looking for a numeric value, you should use double() instead of vpa()
Max
Max el 30 de En. de 2016
That´s the problem. If I use double() then I´ll get:Error using symengine DOUBLE cannot convert the input expression into a double array. If the input expression contains a symbolic variable, use VPA.
Walter Roberson
Walter Roberson el 30 de En. de 2016
What is the result you get with vpa() ?
Max
Max el 30 de En. de 2016
If I use vpa() then I´ll get: numeric::int((140737488355328*exp(-8187485477687969/(87960930222080*heaviside(t - 2000) + 175921860444160*heaviside(t - 3000) - 1715238139330560*heaviside(t - 14000) + 1451355348664320*heaviside(t))))/8301382342175545, t == 0..6082)
Walter Roberson
Walter Roberson el 30 de En. de 2016
Odd, I cannot see any reason at the moment why a numeric integration of that might fail.
Which MATLAB version are you using? If you are using R2015a or later I suggest you experiment with using sympref to give a definite numeric value to heaviside(0)
Max
Max el 30 de En. de 2016
I´m using the R2015b version.
Max
Max el 30 de En. de 2016
But you also can test out my code and you´ll see that it´s not working.

La pregunta está cerrada.

Etiquetas

Preguntada:

Max
el 30 de En. de 2016

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by