Thank you for clear code. Everything looks correct (i didn't tested. it only looks)
You have x y and t independent variables, it means that you should have 3D matrix
u_ex(i,j,n) = exp(alpha*xj+beta*yj+gamma*t)*(phixy+PHIxyt);
This part with double integral
for s=1:10
for r=1:10
r1=Ci*exp(-alpha*xj-beta*yj)-phixy
r2=sin(r*pi*xj/m)
r3=sin(s*pi*yj/n)
r4=exp(-Ds*((r^2)/m+(s^2)/n)*pi^2*t)
PHIxyt=((4/(m*n))*int(int( r1*r2*r3,xj,0,m),yj,0,n))*r2*r3*r4;
end
end
for s=1:10
for r=1:10
r1 = @(xj,yj) Ci*exp(-alpha*xj-beta*yj)-phixy
r2 = @(xj) sin(r*pi*xj/m)
r3 = @(yj) sin(s*pi*yj/n)
r4 = exp(-Ds*((r^2)/m+(s^2)/n)*pi^2*t)
R = @(x,y) r1(x,y)*r2(x)*r3(x);
PHIxyt = ((4/(m*n))*integral2( R,0,m,0,n ) *r2(xj)*r3(yj)*r4;
end
end
I didn't tested all those things on my computer (i'm just scared). Let me know if there is something wrong
Best Answer