Fourrier bessel function series


142
views
0
6 months ago by
mamado  
I tried a calculation for solving the heat equation in a disk. I tried to set the time t and vary the radius to check the boundary condition such that T (r, t = 0) = Ti . with the equation of heat:
$T\left(r,t\right)=T0+\frac{2\left(Ti-T0\right)}{R}\cdot\sum_{n=1}^{\infty}\frac{J_0\left(w_n.r\right)}{w_n\cdot J_1\left(w_n.r\right)}e^{-a.t.w_{n^2}}$T(r,t)=T0+2(TiT0)R ·n=1J0(wn.r)wn·J1(wn.r) ea.t.wn2  avec  $w_n$wn (n=1,2,3...) are the root of the equation $J_0\left(w_n.r\right)=0$J0(wn.r)=0
I tried with this code below but I did not get anyone of you can help me if you want.
import matplotlib.pyplot as plt
from scipy.special import j0, j1, jn_zeros
from scipy import linspace
from math import exp
import numpy as np
import numpy as pl
R = 6.5
Ti = 350.
T0 = 20.
X = 2*(Ti-T0) / R
a = 7*10**(-6)
N = 200 # number of terms in series
z = linspace(0.2, R, 20) # z= rayon r
roots = jn_zeros(0, N) #the first 3 zeros of J0=====> wn
coeff = [1/ (r*j1(r*z)) for r in roots]
t =0
for r in roots :
     expt = exp(-a*t*(r**2))
for h in z :
     def partial_sum(h):
           return sum([coeff[i]*j0(roots[i]*h)*expt for i in range(N)])

plt.plot(z, partial_sum(h))
plt.plot(z, T0+(X*partial_sum(h)))
plt.xlabel("Radius")
plt.ylabel("{}th partial sum".format(N))
plt.show()
###################################################################
Community: FEniCS Project
Please login to add an answer/comment or follow this question.

Similar posts:
Search »