Pde heat diffusion solution

raman_kumar
Sun, 04 Jul 2021 10:07:00 +0000
General Usage

m = 100
delta_z = 0.015
delta_t = 0.15
z= delta_z : delta_z : 1-delta_z
print(z)

j=1
n=1
while j<=10
f(j)=1/(j*(delta_z)-1)
a(j) = (1+((2*(delta_t))/((delta_z)^2))+(((delta_t)f(j))/(delta_z))-((delta_t)m(f(j))))
b(j) = (-1)(((delta_t)/((delta_z)^2))+((delta_t)f(j)/(delta_z)))
c(j) = (-1)((delta_t)/((delta_z)^2))
d(j) = (-1)
print(f(j),a(j),b(j),c(j),d(j))
j+=1

end
u= zeros(4,4)
u[1,end] = 0
u[1,1] = 1
a(j)*u[n+1,j] + b(j)*u[n+1,j+1] + c(j)*u[n+1,j-1] + d(j)*u[n,j] = 0
using Plots
j = 1:100; u(n,j);
plot(j,u(n,j))

35 posts - 8 participants