How can I integrate this function to give a symbolic expression?
Show older comments

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 = .4
sigma = .1
a=1
b=1.3
L=Inf
t=1
Greens= @(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) t
q=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"
Accepted Answer
More Answers (0)
Categories
Find more on Code Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!