Hi, I want to integrate the following equation (singularity at t = \tau)
1./sqrt(4*pi*(t-\tau)).*exp(-(x - \xi).^2./(4*(t-\tau)));space x = (-10 <= x <= 10), time t = (0 <= t <= 2.1)variable of integration \xi, \tau\xi = x, 0 < \tau < t
So I tried as following code.
x = linspace(-10, 10, 41);t = linspace(0.1, 2.1, 41);xi = x;ta = t;nx = length(x); % number of interval of x
nt = length(t); % number of interval of t
for mt = 1:nt for mx = 1:nx GLA = @(ta, xi) 1./sqrt(4*pi*(t(mt)-ta)).*exp(-(x(mx) - xi).^2 ... ./(4*(t(mt)-ta))); funGLA = quad2d(GLA, 0.05, ta(mt), xi(1), xi(end)); Int_GLA(mt, mx) = funGA; endend
However, it leads to wrong results. I don't know what's wrong. Could you help me?
Best Answer