implementations.problem_classes.HeatEquation_Chebychev module

class Heat1DChebychev(nvars=128, a=0, b=0, f=1, nu=1.0, mode='T2U', **kwargs)[source]

Bases: GenericSpectralLinear

1D Heat equation with Dirichlet Boundary conditions discretized on (-1, 1) using a Chebychev spectral method.

dtype_f

alias of mesh

dtype_u

alias of mesh

eval_f(u, *args, **kwargs)[source]

Abstract interface to RHS computation of the ODE

Parameters:
  • u (dtype_u) – Current values.

  • t (float) – Current time.

Returns:

f – The RHS values.

Return type:

dtype_f

u_exact(t, noise=0, seed=666)[source]

Get exact solution at time t

Parameters:
  • t (float) – When you want the exact solution

  • noise (float) – Add noise of this level

  • seed (int) – Random seed for the noise

Returns:

Exact solution

Return type:

Heat1DChebychev.dtype_u

class Heat1DUltraspherical(nvars=128, a=0, b=0, f=1, nu=1.0, **kwargs)[source]

Bases: GenericSpectralLinear

1D Heat equation with Dirichlet Boundary conditions discretized on (-1, 1) using an ultraspherical spectral method.

dtype_f

alias of mesh

dtype_u

alias of mesh

eval_f(u, *args, **kwargs)[source]

Abstract interface to RHS computation of the ODE

Parameters:
  • u (dtype_u) – Current values.

  • t (float) – Current time.

Returns:

f – The RHS values.

Return type:

dtype_f

u_exact(t, noise=0, seed=666)[source]

Get exact solution at time t

Parameters:
  • t (float) – When you want the exact solution

  • noise (float) – Add noise of this level

  • seed (int) – Random seed for the noise

Returns:

Exact solution

Return type:

Heat1DUltraspherical.dtype_u

class Heat2DChebychev(nx=128, ny=128, base_x='fft', base_y='chebychev', a=0, b=0, c=0, fx=1, fy=1, nu=1.0, **kwargs)[source]

Bases: GenericSpectralLinear

2D Heat equation with Dirichlet Boundary conditions discretized on (-1, 1)x(-1,1) using spectral methods based on FFT and Chebychev.

dtype_f

alias of mesh

dtype_u

alias of mesh

eval_f(u, *args, **kwargs)[source]

Abstract interface to RHS computation of the ODE

Parameters:
  • u (dtype_u) – Current values.

  • t (float) – Current time.

Returns:

f – The RHS values.

Return type:

dtype_f

u_exact(t)[source]
class Heat2DUltraspherical(nx=128, ny=128, base_x='fft', base_y='ultraspherical', a=0, b=0, c=0, fx=1, fy=1, nu=1.0, **kwargs)[source]

Bases: GenericSpectralLinear

2D Heat equation with Dirichlet Boundary conditions discretized on (-1, 1)x(-1,1) using spectral methods based on FFT and Gegenbauer.

dtype_f

alias of mesh

dtype_u

alias of mesh

eval_f(u, *args, **kwargs)[source]

Abstract interface to RHS computation of the ODE

Parameters:
  • u (dtype_u) – Current values.

  • t (float) – Current time.

Returns:

f – The RHS values.

Return type:

dtype_f

u_exact(t)[source]