Plot 1D heat equation solve by Fourier transform into MATLAB
15 views (last 30 days)
I'm solving for this equation below (which I believed to be a 1d heat equation) with initial condition of .
Here are just constants. I'm solving for the general case instead of a specific pde.
Apparently I the solution involves triple convolution, which ends up with a double integral. What I did was I made a function in a separate file, and then try to calculate the integral using integral2 through a loop and then plot the graph. What I don't understand is how do I specify MATLAB to integrate with respect to w and then z? Here is my code so far, and it seems to get caught in an infinite loop? The function I'm integrate is called "Integrals_18June". The solution Im trying to plot is below
sigma = 1;
mu = -1;
x1 = 1; % counter
t1 = 1; % counter
U = ;
for t = transpose(T(:,1))
for x = X(1,:)
% Incorporate coefficients
integ = integral2(@(w,z) Integrals_18June(z,w,x,t,sigma),-Inf,Inf,-Inf,Inf);
x1 = x1 +1;
t1 = t1+1;
x1 = 1;
Shraddha Jain on 21 Jun 2021
Set the Integration method to 'iterated' for the 'Method' name-value pair in the input arguments of the function integral2.
Once this is specified, integral2 calls integral to perform an iterated integral. The outer integral is evaluated over xmin ≤ x ≤ xmax. The inner integral is evaluated over ymin(x) ≤ y ≤ ymax(x). The integration limits can be infinite.
Refer to the documentation of integral2 for more information. Hope this helps!