On 3/17/2012 1:52 AM, Thomas Nguyen wrote:
> Hello,
>
> I keep getting an error when using the double function for the following code:
>
> syms t;
> u = 13.7;
> s = 2.458;
> a = 1/(sqrt(2*pi)*s)
> b = exp((1/(2*s^2))*(tu)^2)
> f1 = a*b
> f2 = (t^(2))*f1
> double(int(f2,t,0,inf))
>
> I did some research and tried to use
>
> double(vpa(int(f2,t,0,inf)))
>
> but I kept getting the same error. Any help would be greatly appreciated.
>
> Thanks,
> Tom
The interesting thing is that the error message tells
you exactly all the problem(s) you had and what to do.
In addition, the error message says that the int() failed
to find an explicit integral.

Warning: Explicit integral could not be found.
....
If the input expression contains a symbolic variable, use the VPA function
instead.

For example

EDU>> clear all
EDU>> syms t
EDU>> expr=5847603923053631/(36028797018963968*t^2)
EDU>> double(expr)
??? Error using ==> mupadmex
Error in MuPAD command: DOUBLE cannot convert the input expression into a double
array.
EDU>> vpa(expr)
0.16230361285656333403260020986636/t^2

So, you need to use vpa() as the message says. Not double() and
not vpa(double()).
In your case, however, since int() itself was not
successful, as the message says, then no need to worry
about using vpa() before fixing the int() problem first.
reading the error messages always helps :)
Nasser
