Integrating Heat Equation Coefficient with time-dependent forcing.

1 次查看(过去 30 天)
I have solved the heat equation with time-dependent boundary conditions and I got the following equation for the coefficient, and the temperature of the system, where is the temperature data from an experiement. The data is given attached below.
Now I tried to use finite difference method to find . My code follows like this. My issue is that I am getting a constant value for u(r,t); I think it is because C(i) is actually constant at every step. I am not eniterly sure why this the case. So if anyone has an idea what I am doing wrong here, that would be much apperciated.
Note: The equations above are both correct and I have already checked them.
clear; clc;
Time = xlsread('SmallSphereNitrogen.csv','A2:A1442');
T_r0 = xlsread('SmallSphereNitrogen.csv','B2:B1442'); % temperature at r = 0
T_R2 = xlsread('SmallSphereNitrogen.csv','C2:C1442'); % temperature at r = R/2
R = 2.5*2.52/100;
K = 14;
Tr = 3;
C = zeros(200,1);
P = zeros(200,1);
for n = 1:25 % modes
for i = 1:200-1 % time - Regime 1
for j = 1:200-2 % distance - Regime 1
P(i) = T_r0(i);
P2(i) = T_R2(i);
C(i) = 2 * R * (P(i) - Tr) * (-1)^n / pi / n + ( P2(i) - P(i) ) * exp(-K * (n*pi/R)^2 * i);
end
u(j,i) = C(i)/j * sin(n*pi/R * j) * exp(-K * (n*pi/R)^2 * i) + P2(i) - P(i);
end
end

回答(0 个)

产品


版本

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by