Hello everybody,
In the following code I don't understand why integral2 doesn't work. Could you suggest me a solution to achieve the integration? Currently I am calculating many values with vpa and then I use twice trapz to make it work but it takes really long and the accuracy is not very good…
Thank you in advance
clear allWaveFunction = @(x) exp(-x.^2./2)./pi.^(0.25);expression1 = @(x,p,y) exp(-i.*p.*y).* WaveFunction(x-y./2).* conj(WaveFunction(x+y./2));syms yWignerFunction = @(x,p) 1/(2.*pi).* int(expression1(x,p,y),y,-Inf,Inf);t = isa(WignerFunction,'function_handle') % outputs 1
%vpa(WignerFunction(1,1)) % outputs the correct value
t = integral2(WignerFunction,-Inf,Inf,-Inf,Inf) % should output 1
Best Answer