### Fourrier bessel function series

142

views

0

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}}$

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()

###################################################################

$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`)=`T`0+2(`T``i`−`T`0)`R`·∑_{n=1}^{∞}`J`_{0}(`w`_{n}.`r`)`w`_{n}·`J`_{1}(`w`_{n}.`r`)`e`^{−a.t.wn2}avec $w_n$`w`_{n}(n=1,2,3...) are the root of the equation $J_0\left(w_n.r\right)=0$`J`_{0}(`w`_{n}.`r`)=0I 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.