I am trying to compute the above double integral to give a function C which depends on x. I attempted to use the following code to compute the double integral: (c,a,b,Da,Beta and sigma are known constants and C_s(x,t) is known to be exp(x*t) in this example. I am trying to plot the function which results with C on the y-axis and x on the x-axis. What is wrong with my integral?
c=0;Da = .4sigma = .1a=1b=1.3L=Inft=1Greens= @(x,zeta,t) (1/2*sqrt(pi*a*t))*exp(b(zeta-x)/2*a + c-b^2/4*a)*(exp(-(x-zeta)^2/4*a*t)+exp(-(x+zeta)^2/4*a*t))fun = @(x,t,zeta,tau) Da.*sigma.*exp(x.*t).*(1/2.*sqrt(pi.*a.*t)).*exp(b(zeta-x)/2.*a + c-b^2/4.*a).*(exp(-(x-zeta)^2/4*a*t)+exp(-(x+zeta)^2/4*a*t))upper=@(tau) tq=integral2(fun,0,L,0,upper)
I am getting the following error: "Error using arrayfun All of the input arguments must be of the same size and shape. Previous inputs had size 45 in dimension 2. Input #4 has size 1"
Best Answer